From df38373a5fa6a26e86782c8e9345e10df3cba3f1 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 14 May 2012 10:28:58 -0700 Subject: Extract A and B images from signed EC binary for openocd macros Signed-off-by: Randall Spangler BUG=none TEST=build, then flash_link_a from openocd telnet session Change-Id: If922f54adb4684e27a38ed87348111bd9047535d --- Makefile.rules | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile.rules') 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 -- cgit v1.2.1