summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-09-29 13:52:19 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-29 19:38:22 -0700
commit5ed966769deb6b77497b569702d6acb6bf6604cb (patch)
treed46fc824e562d0f4162173b34dd62ed2966a5dc4 /Makefile.rules
parentb8475a13c068633bea328f311c3b655e1fb9b107 (diff)
downloadchrome-ec-5ed966769deb6b77497b569702d6acb6bf6604cb.tar.gz
cr50: upgrade signer to latest and greatest
This patch brings in the enhanced signer utility published along with FPGA version 20150925_21715, and the image.cc file updated to fix the bug where it was not picking up the initialized data segment from the elf file. The new signed image header format, among other things, describes memory areas as read-only and read-execute, which allows the bootrom to configure the MMU appropriately. Makefiles had to be modified to reflect the fact that the signed image now depends on .elf, not on .raw, and that building the signer requires more source files. Note that some signer features are not yet being utilized (like processing xml files describing fuses or retrieving keys from gnubby), the source are kept for completeness. BRANCH=none BUG=chrome-os-partner:43791 TEST=build the cr50 image and boot in on the FPGA board using the spiflash utility outside chroot. Observe the target starting the console session. Change-Id: Ib59b8ebbeb98a8146d4d997e1f78178c4fbc031a Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/303070 Commit-Ready: Marius Schilder <mschilder@chromium.org> Reviewed-by: Marius Schilder <mschilder@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile.rules b/Makefile.rules
index e2951d095a..cdd75caa33 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -40,8 +40,9 @@ 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_raw_to_flat ?= $(out)/util/signer util/signer/rom-testkey.pem $< \
- && mv $<.signed $@
+cmd_elf_to_signed ?= $(out)/util/signer --key=util/signer/rom-testkey-A.pem \
+ --input=$< --format=bin --output=$@.signed \
+ && mv $@.signed $@
cmd_elf_to_dis = $(OBJDUMP) -D $< > $@
cmd_elf_to_hex = $(OBJCOPY) -O ihex $< $@
cmd_bin_to_hex = $(OBJCOPY) -I binary -O ihex \
@@ -57,7 +58,7 @@ cmd_c_to_build = $(BUILDCC) $(BUILD_CFLAGS) \
-MMD -MF $@.d -o $@
cmd_c_to_host = $(HOSTCC) $(HOST_CFLAGS) -MMD -MF $@.d -o $@ \
$(sort $(foreach c,$($(*F)-objs),util/$(c:%.o=%.c)) $*.c)
-cmd_cxx_to_host = $(HOSTCXX) -std=c++0x $(COMMON_WARN) \
+cmd_cxx_to_host = $(HOSTCXX) -std=c++0x $(COMMON_WARN) $(HOST_CXXFLAGS)\
-I ./$($(notdir $@)_ROOT) -o $@ $(filter %.cc,$^) $($(notdir $@)_LIBS)
cmd_host_test = ./util/run_host_test $* $(silent)
cmd_version = ./util/getversion.sh > $@
@@ -201,8 +202,8 @@ $(out)/RW/ec.RW.flat: $(out)/RW/ec.RW.elf
$(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/ec.RO.flat: $(out)/RO/ec.RO.flat.raw
- $(call quiet,raw_to_flat,RO_SIGN)
+$(out)/RO/ec.RO.flat: $(out)/RO/ec.RO.elf $(out)/RO/ec.RO.smap
+ $(call quiet,elf_to_signed,RO_SIGN)
$(out)/RO/%.hex: $(out)/RO/%.flat
$(call quiet,bin_to_hex,OBJCOPY)