[coreboot-gerrit] Change in coreboot[master]: soc/cavium: Add dynamic dtb support
Philipp Deppenwiese (Code Review)
gerrit at coreboot.org
Fri Aug 24 14:42:08 CEST 2018
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 at 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);
--
To view, visit https://review.coreboot.org/28336
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie470092e424b86e04141b8e2bd2b080a5aadcf58
Gerrit-Change-Number: 28336
Gerrit-PatchSet: 1
Gerrit-Owner: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180824/26619471/attachment.html>
More information about the coreboot-gerrit
mailing list