Michael Niewöhner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35455 )
Change subject: config: provide a way to specify a user override devicetree ......................................................................
config: provide a way to specify a user override devicetree
Change-Id: Ie4652cbf59ba6ba03f97a75ca4644349ffa04915 Signed-off-by: Michael Niewöhner foss@mniewoehner.de --- M Makefile.inc M src/Kconfig 2 files changed, 25 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/35455/1
diff --git a/Makefile.inc b/Makefile.inc index 3c3088d..7b7954d 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -26,6 +26,7 @@ CONFIG_FMDFILE:=$(call strip_quotes,$(CONFIG_FMDFILE)) CONFIG_DEVICETREE:=$(call strip_quotes, $(CONFIG_DEVICETREE)) CONFIG_OVERRIDE_DEVICETREE:=$(call strip_quotes, $(CONFIG_OVERRIDE_DEVICETREE)) +CONFIG_USER_OVERRIDE_DEVICETREE:=$(call strip_quotes, $(CONFIG_USER_OVERRIDE_DEVICETREE))
####################################################################### # misleadingly named, this is the coreboot version @@ -590,12 +591,23 @@
endif
+ifneq ($(CONFIG_USER_OVERRIDE_DEVICETREE),) + +USER_OVERRIDE_DEVICETREE_FILE := $(CONFIG_USER_OVERRIDE_DEVICETREE) + +# check/convert absolute/relative path +ifeq ($(call substr,$(USER_OVERRIDE_DEVICETREE_FILE),1,1),/) +USER_OVERRIDE_DEVICETREE_FILE := $(src)/$(USER_OVERRIDE_DEVICETREE_FILE) +endif + +endif + DEVICETREE_STATIC_C := $(obj)/mainboard/$(MAINBOARDDIR)/static.c
-$(DEVICETREE_STATIC_C): $(DEVICETREE_FILE) $(OVERRIDE_DEVICETREE_FILE) $(objutil)/sconfig/sconfig +$(DEVICETREE_STATIC_C): $(DEVICETREE_FILE) $(OVERRIDE_DEVICETREE_FILE) $(USER_OVERRIDE_DEVICETREE_FILE) $(objutil)/sconfig/sconfig @printf " SCONFIG $(subst $(src)/,,$(<))\n" mkdir -p $(dir $(DEVICETREE_STATIC_C)) - $(objutil)/sconfig/sconfig $(DEVICETREE_FILE) $(DEVICETREE_STATIC_C) $(OVERRIDE_DEVICETREE_FILE) + $(objutil)/sconfig/sconfig $(DEVICETREE_FILE) $(DEVICETREE_STATIC_C) $(OVERRIDE_DEVICETREE_FILE) $(USER_OVERRIDE_DEVICETREE_FILE)
ramstage-y+=$(DEVICETREE_STATIC_C) romstage-y+=$(DEVICETREE_STATIC_C) diff --git a/src/Kconfig b/src/Kconfig index a1c016e..427e009 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -346,6 +346,17 @@ Examples: "devicetree.variant-override.cb" "variant/devicetree-override.cb"
+config USER_OVERRIDE_DEVICETREE + string + default "" + help + This symbol allows to provide an additional override devicetree file to + override the registers and/or add new devices on top of the ones + provided by the devicetree using DEVICETREE and/or OVERRIDE_DEVICETREE. + + Examples: "relative/path/to/devicetree-override.cb" + "/abolute/path/to/devicetree-override.cb" + config CBFS_SIZE hex "Size of CBFS filesystem in ROM" # Default value set at the end of the file