Philipp Deppenwiese has uploaded this change for review. ( https://review.coreboot.org/28336
Change subject: soc/cavium: Add dynamic dtb support ......................................................................
soc/cavium: Add dynamic dtb support
* Add a kconfig variable containing the per board dts name. * Add auto generation of device tree (DTB) file if kconfig option is set in the mainboard implementation. * Fix cavium/cn81xx for dynamic device tree loading.
Change-Id: Ie470092e424b86e04141b8e2bd2b080a5aadcf58 Signed-off-by: Philipp Deppenwiese zaolin@das-labor.org --- M Makefile.inc M src/mainboard/Kconfig M src/soc/cavium/cn81xx/soc.c 3 files changed, 26 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/28336/1
diff --git a/Makefile.inc b/Makefile.inc index 7ce2360..455e058 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -568,6 +568,26 @@ smm-y+=$(DEVICETREE_STATIC_C)
####################################################################### +# needed objects that every mainboard uses +# Creation of these is architecture and mainboard independent +FIT_DEVICETREE_NAME := $(call strip_quotes,$(CONFIG_MAINBOARD_FIT_DTS)) +FIT_DEVICETREE_FILE := $(src)/mainboard/$(MAINBOARDDIR)/$(FIT_DEVICETREE_NAME) + +ifneq ($(FIT_DEVICETREE_NAME),) + +FIT_DEVICETREE := $(obj)/fit.dtb + +$(FIT_DEVICETREE): $(FIT_DEVICETREE_FILE) + @printf " DTC $(subst $(src)/,,$(<))\n" + dtc -I dts -O dtb -o $@ -i $(src)/mainboard/$(MAINBOARDDIR) -i $(src)/mainboard/$(VARIANT_DIR) $< + +cbfs-files-y += $(FIT_DEVICETREE_NAME) +$(FIT_DEVICETREE_NAME)-file := $(FIT_DEVICETREE) +$(FIT_DEVICETREE_NAME)-type := raw + +endif + +####################################################################### # Clean up rules clean-abuild: rm -rf coreboot-builds diff --git a/src/mainboard/Kconfig b/src/mainboard/Kconfig index 04dca4a..f8f3bff 100644 --- a/src/mainboard/Kconfig +++ b/src/mainboard/Kconfig @@ -180,3 +180,8 @@ config ENABLE_POWER_BUTTON def_bool y if !POWER_BUTTON_IS_OPTIONAL && POWER_BUTTON_FORCE_ENABLE def_bool n if !POWER_BUTTON_IS_OPTIONAL && POWER_BUTTON_FORCE_DISABLE + +config MAINBOARD_FIT_DTS + string + help + Set the FIT payload supported FIT device tree per mainboard. diff --git a/src/soc/cavium/cn81xx/soc.c b/src/soc/cavium/cn81xx/soc.c index 8efcb13..0d10f4e 100644 --- a/src/soc/cavium/cn81xx/soc.c +++ b/src/soc/cavium/cn81xx/soc.c @@ -327,7 +327,7 @@
size_t size = 0;
- void *ptr = cbfs_boot_map_with_leak("sff8104-linux.dtb", + void *ptr = cbfs_boot_map_with_leak(CONFIG_MAINBOARD_FIT_DTS, CBFS_TYPE_RAW, &size); if (ptr) memcpy(_sff8104, ptr, size);