summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-05-14 10:28:58 -0700
committerRandall Spangler <rspangler@chromium.org>2012-05-14 10:46:16 -0700
commitdf38373a5fa6a26e86782c8e9345e10df3cba3f1 (patch)
tree096e2881529a0464250b9e48b7722e0d1365538e
parentfb0d6f078dd70f05079db829902de84b378548fb (diff)
downloadchrome-ec-df38373a5fa6a26e86782c8e9345e10df3cba3f1.tar.gz
Extract A and B images from signed EC binary for openocd macros
Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=build, then flash_link_a from openocd telnet session Change-Id: If922f54adb4684e27a38ed87348111bd9047535d
-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 { } {