summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Sukhomlinov <sukhomlinov@google.com>2021-09-29 18:59:29 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-30 17:21:18 +0000
commitc13fecc4b009ea4ec6583896cea4cea07390df68 (patch)
treed5e9efc766db9ae3259914870b1686873fbdcb12
parent9fbc265dbcf7a98c46a55c6eac7667e16117eaef (diff)
downloadchrome-ec-c13fecc4b009ea4ec6583896cea4cea07390df68.tar.gz
cr50: make CONFIG_FW_INCLUDE_RO work properly
CONFIG_FW_INCLUDE_RO option controls wherever RO is built. This option didn't work properly and RO was always built. Fix this behavior. However, when RO is not built RW image should include some 16KB stub. This is not added yet, so for Cr50 we still set CONFIG_FW_INCLUDE_RO. Also, corrected behavior of CONFIG_CUSTOMIZED_RO which earlier was not properly taken into account and behavior depended on custom-ro_objs variable state which always added some common files so actual result was that CONFIG_CUSTOMIZED_RO is effectively on for chip/g. BUG=none TEST=make buildall -j; make BOARD=cr50 & flash Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: I31599170050b360fad5c61dd1f81844bb315e1d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3195319 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--Makefile6
-rw-r--r--Makefile.rules3
-rw-r--r--board/cr50/board.h4
3 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index acabb9a2b3..79e282871f 100644
--- a/Makefile
+++ b/Makefile
@@ -319,7 +319,7 @@ dirs+=$(shell find driver -type d)
common_dirs=util
custom-ro_objs-y += $(custom-board-ro_objs-y)
-ifeq ($(custom-ro_objs-y),)
+ifneq ($(CONFIG_CUSTOMIZED_RO),y)
ro-common-objs := $(sort $(foreach obj, $(all-obj-y), $(out)/RO/$(obj)))
ro-only-objs := $(sort $(foreach obj, $(all-obj-ro), $(out)/RO/$(obj)))
ro-objs := $(sort $(ro-common-objs) $(ro-only-objs))
@@ -361,7 +361,11 @@ $(rw-eps) $(out)/RW/str_blob: $(rw-es)
$(rw-objs): $(out)/RW/str_blob $(rw-eps)
endif
+ifeq ($(CONFIG_FW_INCLUDE_RO),y)
deps := $(ro-deps) $(rw-deps) $(deps-y)
+else
+deps := $(rw-deps) $(deps-y)
+endif
.PHONY: ro rw
$(config): $(out)/$(PROJECT).bin
diff --git a/Makefile.rules b/Makefile.rules
index 976e0a92e2..abb1cf289d 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -238,7 +238,8 @@ dis-$(CONFIG_SHAREDLIB) += $(out)/$(SHOBJLIB)/$(SHOBJLIB).dis
dis: $(dis-y)
.PHONY: dis
-hex-y := $(out)/RO/$(PROJECT).RO.hex $(out)/RW/$(PROJECT).RW.hex $(out)/$(PROJECT).hex
+hex-y := $(out)/RW/$(PROJECT).RW.hex $(out)/$(PROJECT).hex
+hex-$(CONFIG_FW_INCLUDE_RO) += $(out)/RO/$(PROJECT).RO.hex
hex-$(CONFIG_RW_B) += $(out)/RW/$(PROJECT).RW_B.hex
hex: $(hex-y)
.PHONY: hex
diff --git a/board/cr50/board.h b/board/cr50/board.h
index 06fd5e1fd9..c7ddf13d13 100644
--- a/board/cr50/board.h
+++ b/board/cr50/board.h
@@ -28,6 +28,10 @@
#undef CONFIG_CMD_SYSJUMP
#undef CONFIG_CMD_SYSLOCK
+#define CONFIG_CUSTOMIZED_RO
+/* TODO: find a way to drop RO build. */
+#define CONFIG_FW_INCLUDE_RO
+
#ifndef CR50_DEV
/* Disable stuff that should only be in debug builds */
#undef CONFIG_CMD_CRASH