summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-12-28 11:26:03 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-24 00:51:29 -0800
commitd7579bd4589d08eeabf7c01f055b925acb7aed67 (patch)
tree3adead141ceea596ac42f0ed05e2aa59d47a41d1 /Makefile.rules
parent3cd175cd9ddec3fd88153b3edb9e1d7e4526420d (diff)
downloadchrome-ec-d7579bd4589d08eeabf7c01f055b925acb7aed67.tar.gz
mt_scp: Add support to store some code in DRAM
This allows to store specific code/data in a .dram region. This is used by mt_scp to run code off DRAM, as we plan to have more code than what can fit in SRAM. BRANCH=none BUG=b:122058243 TEST=make BOARD=kukui_scp -j objdump -x build/kukui_scp/ec.obj => Some code is loaded in DRAM TEST=Load kukui_scp, icachetest works Change-Id: Idbab809ba86cabe3b984944adc2781b37d2d544b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1391542
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index bf7680cd43..28eae3a7d3 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -61,8 +61,9 @@ cmd_obj_to_bin ?= $(OBJCOPY) --gap-fill=0xff -O binary $^ $(out)/$*.bin.tmp
cmd_flat_to_obj = $(CC) -Wl,-T $(out)/firmware_image.lds -nostdlib $(CPPFLAGS) \
-Wl,--build-id=none -o $@ $<
# Allow the .roshared section to overlap other sections (itself)
-cmd_ec_elf_to_flat ?= $(OBJCOPY) --set-section-flags .roshared=share \
+cmd_ec_elf_to_flat ?= $(OBJCOPY) --set-section-flags .roshared=share -R .dram \
-O binary $< $@
+cmd_ec_elf_to_flat_dram ?= $(OBJCOPY) -j .dram -O binary $< $@
cmd_elf_to_signed ?= $(SIGNER) --key=util/signer/$(3) \
--b --input=$< --format=bin --output=$@.signed $(SIGNER_EXTRAS) \
&& sudo chown $(shell whoami) $@.signed && mv $@.signed $@
@@ -382,6 +383,8 @@ flat-$(CONFIG_FW_INCLUDE_RO) += $(out)/RO/$(PROJECT).RO.flat
deps += $(out)/firmware_image.lds.d $(flat-y:%.flat=%.lds.d)
+flat-$(CONFIG_DRAM_BASE) += $(out)/RW/$(PROJECT).RW.flat.dram
+
flat-$(CONFIG_RWSIG_TYPE_RWSIG) += $(out)/key.vbpubk2
flat-$(CONFIG_RWSIG_TYPE_RWSIG) += $(out)/RW/$(PROJECT).RW.flat.sig
@@ -401,6 +404,9 @@ ifeq ($(SIGNED_IMAGES),)
$(out)/%.flat: $(out)/%.elf $(out)/%.smap utils-build
$(call quiet,ec_elf_to_flat,OBJCOPY)
+$(out)/%.flat.dram: $(out)/%.elf $(out)/%.smap utils-build
+ $(call quiet,ec_elf_to_flat_dram,OBJCOPY)
+
$(out)/RO/%.hex: $(out)/RO/%.elf $(out)/RO/%.smap
$(call quiet,elf_to_hex,OBJCOPY)
else