summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-11-06 10:59:33 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-10 06:54:43 -0800
commit62691cac030c4f0bd350a086e4b182673730d64c (patch)
treef9a8f6d6708814a9f85e610edf08bb184e833322 /Makefile.rules
parentb895b9e933714f17b24f9f080b20ea4e62c124dc (diff)
downloadchrome-ec-62691cac030c4f0bd350a086e4b182673730d64c.tar.gz
cr50: make customized RO work
This patch completes introduction of building of proper RO and RW images for cr50. A few small mods were required: - both RO and RW images have to be signed, using the same dedicated signer, but with different keys, dev_key.pem is not needed any more. - the RW image offset is not at the half of available flash, a chip specific value of 16K is used instead. The suggested new image layout is as follows: +----------------------------------------+ | 1KB RO signature header. | +----------------------------------------+ - - | 15KB RO image. | - - +========================================+ | 1KB RW-A signature header. | +----------------------------------------+ - - - - | 239K RW-A image. | - - - - +========================================+ - - | 16 KB NVRAM, shared | - - +========================================+ | 1KB RW-B signature header. | +----------------------------------------+ - - - - | 239K RW-B image. | - - - - +========================================+ BRANCH=none BUG=chrome-os-partner:43025 TEST=The combined image (build/cr50/ec.hex) is successfully loaded and started by the spiflash utility from the latest FPGA tarball. Corrupting a byte in the generated image in the RW section causes failure to verify. Change-Id: I41a05168b0d4e9f88efa1003f261b6dd03972a24 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/311422 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules14
1 files changed, 6 insertions, 8 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 32ba66a8ba..23d743fbdb 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -40,7 +40,7 @@ cmd_flat_to_obj = $(CC) -T $(out)/firmware_image.lds -nostdlib $(CPPFLAGS) \
# Allow the .roshared section to overlap other sections (itself)
cmd_ec_elf_to_flat ?= $(OBJCOPY) --set-section-flags .roshared=share \
-O binary $< $@
-cmd_elf_to_signed ?= $(out)/util/signer --key=util/signer/rom-testkey-A.pem \
+cmd_elf_to_signed ?= $(out)/util/signer --key=util/signer/$(3).pem \
--input=$< --format=bin --output=$@.signed \
&& mv $@.signed $@
cmd_elf_to_dis = $(OBJDUMP) -D $< > $@
@@ -199,20 +199,18 @@ $(out)/%.dis: $(out)/%.elf
$(out)/RW/%.hex: $(out)/RW/%.elf $(out)/RW/%.smap
$(call quiet,elf_to_hex,OBJCOPY)
-ifeq ($(SIGNED_RO_IMAGE),)
+ifeq ($(SIGNED_IMAGES),)
$(out)/%.flat: $(out)/%.elf $(out)/%.smap
$(call quiet,ec_elf_to_flat,OBJCOPY)
$(out)/RO/%.hex: $(out)/RO/%.elf $(out)/RO/%.smap
$(call quiet,elf_to_hex,OBJCOPY)
else
-$(out)/RW/ec.RW.flat: $(out)/RW/ec.RW.elf
- $(call quiet,ec_elf_to_flat,OBJCOPY)
-$(out)/RO/ec.RO.flat.raw: $(out)/RO/ec.RO.elf $(out)/RO/ec.RO.smap
- $(call quiet,ec_elf_to_flat,OBJCOPY)
+$(out)/RO/%.flat: $(out)/RO/%.elf $(out)/RO/%.smap
+ $(call quiet,elf_to_signed,RO_SIGN,rom-testkey-A)
-$(out)/RO/ec.RO.flat: $(out)/RO/ec.RO.elf $(out)/RO/ec.RO.smap
- $(call quiet,elf_to_signed,RO_SIGN)
+$(out)/RW/%.flat: $(out)/RW/%.elf $(out)/RW/%.smap
+ $(call quiet,elf_to_signed,RW_SIGN,loader-testkey-A)
$(out)/RO/%.hex: $(out)/RO/%.flat
$(call quiet,bin_to_hex,OBJCOPY)