summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorHu, Hebo <hebo.hu@intel.com>2019-07-04 10:32:52 +0800
committerCommit Bot <commit-bot@chromium.org>2019-07-12 01:11:10 +0000
commit5c2243bb6b5b0b8a7afe2f79a0388c8ed8391a1a (patch)
treefb7f43cd306bae68b798313c055542695e0f49d3 /chip
parent220d0bf43c6ec01bac79360b99b75199b04d4ada (diff)
downloadchrome-ec-5c2243bb6b5b0b8a7afe2f79a0388c8ed8391a1a.tar.gz
ish: fix aon task not auto rebuild issue in increment build
aon task image build rules are lack of dependent rules of source code, so can't track the source code changes and trigger auto build. Refactor build rules for aon task to make sure always auto rebuild when aon task's source code and dependent header files update BUG=b:136691893 BRANCH=none TEST= ish aon task should always rebuild when it's code and dependent header files update Change-Id: I0d8c7c6a4a2b7e99d724b88b233e09a29b8facea Signed-off-by: Hu, Hebo <hebo.hu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1688701 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Tested-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/ish/aontaskfw/ish_aontask.lds.S (renamed from chip/ish/aontaskfw/ish_aontask.ld.in)0
-rw-r--r--chip/ish/build.mk50
2 files changed, 37 insertions, 13 deletions
diff --git a/chip/ish/aontaskfw/ish_aontask.ld.in b/chip/ish/aontaskfw/ish_aontask.lds.S
index b5361432a2..b5361432a2 100644
--- a/chip/ish/aontaskfw/ish_aontask.ld.in
+++ b/chip/ish/aontaskfw/ish_aontask.lds.S
diff --git a/chip/ish/build.mk b/chip/ish/build.mk
index 40fd5420d5..34eace379e 100644
--- a/chip/ish/build.mk
+++ b/chip/ish/build.mk
@@ -30,26 +30,50 @@ chip-$(CONFIG_LOW_POWER_IDLE)+=power_mgt.o
# There is no framework for on-board tests in ISH. Do not specify any.
test-list-y=
-ifeq ($(CONFIG_ISH_PM_AONTASK),y)
+# Build ish aon task fw
+ish-aon-name=ish_aontask
+ish-aon-$(CONFIG_ISH_PM_AONTASK)=aontaskfw/ish_aontask.o dma.o
-ish-aontask-fw=chip/ish/aontaskfw/ish_aontask
-ish-aontask-dma=chip/ish/dma
-ish-aontask-fw-bin=$(out)/$(ish-aontask-fw).bin
-PROJECT_EXTRA+=$(ish-aontask-fw-bin)
+# Rules for building ish aon task fw
+ish-aon-out=$(out)/aontaskfw
+ish-aon-bin-$(CONFIG_ISH_PM_AONTASK)=$(ish-aon-out)/$(ish-aon-name).bin
+ish-aon-elf-$(CONFIG_ISH_PM_AONTASK)=$(ish-aon-out)/$(ish-aon-name).elf
+ish-aon-lds-$(CONFIG_ISH_PM_AONTASK)=$(ish-aon-out)/$(ish-aon-name).lds
-_aon_size_str=$(shell stat -L -c %s $(ish-aontask-fw-bin))
-_aon_size=$(shell echo "$$(($(_aon_size_str)))")
+ish-aon-objs=$(call objs_from_dir,$(ish-aon-out)/chip/$(CHIP),ish-aon)
+ish-aon-deps+=$(addsuffix .d, $(ish-aon-objs)) $(ish-aon-lds-y).d
-$(out)/$(PROJECT).bin: $(ish-aontask-fw-bin) $(out)/RW/$(PROJECT).RW.flat
+cmd_ish_aon_elf = $(CC) $(ish-aon-objs) $(LDFLAGS) \
+ -o $@ -Wl,-T,$< -Wl,-Map,$(patsubst %.elf,%.map,$@)
-endif
+PROJECT_EXTRA+=$(ish-aon-bin-y)
+deps-$(CONFIG_ISH_PM_AONTASK)+=$(ish-aon-deps)
-_kernel_size_str=$(shell stat -L -c %s $(out)/RW/$(PROJECT).RW.flat)
-_kernel_size=$(shell echo "$$(($(_kernel_size_str)))")
+$(out)/$(PROJECT).bin: $(ish-aon-bin-y) $(out)/RW/$(PROJECT).RW.flat
+
+$(ish-aon-bin-y): $(ish-aon-elf-y)
+ $(call quiet,elf_to_bin,EXTBIN )
+
+$(ish-aon-elf-y): $(ish-aon-lds-y) $(ish-aon-objs)
+ $(call quiet,ish_aon_elf,LD )
-# location of the scripts used to pack image
+$(ish-aon-lds-y): chip/$(CHIP)/aontaskfw/ish_aontask.lds.S
+ -@ mkdir -p $(@D)
+ $(call quiet,lds,LDS )
+
+$(ish-aon-out)/%.o: %.c
+ -@ mkdir -p $(@D)
+ $(call quiet,c_to_o,CC )
+
+# Location of the scripts used to pack image
SCRIPTDIR:=./chip/${CHIP}/util
+# Calculate aon binary file size and kernel binary file size
+_aon_size_str=$(shell stat -L -c %s $(ish-aon-bin-y))
+_aon_size=$(shell echo "$$(($(_aon_size_str)))")
+
+_kernel_size_str=$(shell stat -L -c %s $(out)/RW/$(PROJECT).RW.flat)
+_kernel_size=$(shell echo "$$(($(_kernel_size_str)))")
# Commands to convert ec.RW.flat to $@.tmp - This will add the manifest header
# needed to load the FW onto the ISH HW.
@@ -58,7 +82,7 @@ ifeq ($(CONFIG_ISH_PM_AONTASK),y)
cmd_obj_to_bin = ${SCRIPTDIR}/pack_ec.py -o $@.tmp \
-k $(out)/RW/$(PROJECT).RW.flat \
--kernel-size $(_kernel_size) \
- -a $(ish-aontask-fw-bin) \
+ -a $(ish-aon-bin-y) \
--aon-size $(_aon_size);
else
cmd_obj_to_bin = ${SCRIPTDIR}/pack_ec.py -o $@.tmp \