summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerrit <chrome-bot@google.com>2012-05-14 14:40:43 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-05-14 14:40:43 -0700
commite9f4bf29c1ece072be59c25ce6127346c4ca48ba (patch)
treec843367d14cba772c146247b41e8d8bafd05d0d9
parentf783aee46faa72ec64b37049c1ef65d8ae330c9e (diff)
parentdf38373a5fa6a26e86782c8e9345e10df3cba3f1 (diff)
downloadchrome-ec-e9f4bf29c1ece072be59c25ce6127346c4ca48ba.tar.gz
Merge "Extract A and B images from signed EC binary for openocd macros"
-rw-r--r--Makefile.rules8
-rw-r--r--chip/lm4/openocd/lm4x_cmds.tcl4
2 files changed, 9 insertions, 3 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 5a94984813..ba8574d842 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -48,7 +48,11 @@ cmd_sign = vbutil_ec --sign $@ \
--signpubkey $(VBOOT_DEVKEYS)/ec_root_key.vbpubk \
$(silent)
cmd_mv = mv $^ $@
-
+cmd_extractab = cd $(out) && \
+ dump_fmap -x $(PROJECT).bin.tmp RW_SECTION_A RW_SECTION_B $(silent) && \
+ mv RW_SECTION_A $(PROJECT).A.bin && mv RW_SECTION_B $(PROJECT).B.bin
+cmd_copyab = cd $(out) && cp $(PROJECT).A.flat $(PROJECT).A.bin && \
+ cp $(PROJECT).B.flat $(PROJECT).B.bin
.PHONY: all tests utils
all: $(out)/$(PROJECT).bin $(foreach s,A B RO,$(out)/$(PROJECT).$(s).dis) utils
@@ -82,6 +86,8 @@ $(out)/%.bin: $(out)/%.bin.tmp
$(out)/%.bin.tmp: $(out)/%.obj
$(call quiet,obj_to_bin,OBJCOPY)
$(if $(sign-y),$(call quiet,sign,SIGN ),)
+ $(if $(sign-y),$(call quiet,extractab,EXTR_AB), \
+ $(call quiet,copyab,COPY_AB))
$(out)/%.obj: common/firmware_image.S $(out)/firmware_image.lds \
$(out)/%.RO.flat $(out)/%.A.flat $(out)/%.B.flat
diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl
index a0465ed677..ea81c4c81c 100644
--- a/chip/lm4/openocd/lm4x_cmds.tcl
+++ b/chip/lm4/openocd/lm4x_cmds.tcl
@@ -24,11 +24,11 @@ proc flash_link { } {
}
proc flash_link_a { } {
- flash_lm4 ../../../build/link/ec.A.flat 81920 81920
+ flash_lm4 ../../../build/link/ec.A.bin 81920 81920
}
proc flash_link_b { } {
- flash_lm4 ../../../build/link/ec.B.flat 163840 81920
+ flash_lm4 ../../../build/link/ec.B.bin 163840 81920
}
proc flash_bds { } {