Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] kernel-fitimage.bbclass: introduce OVERLAY_FDT_DEFAULT_BOOT
@ 2019-01-28  9:23 liu.ming50
  0 siblings, 0 replies; only message in thread
From: liu.ming50 @ 2019-01-28  9:23 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ming Liu

From: Ming Liu <liu.ming50@gmail.com>

The FDT overlays can be applied to a base DT configuration by setting
this variable.

The FDT overlays set in this variable must be available in
KERNEL_DEVICETREE.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
 meta/classes/kernel-fitimage.bbclass | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 718162a..71771dc 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -36,11 +36,23 @@ python __anonymous () {
         if d.getVar('UBOOT_SIGN_ENABLE') == "1":
             uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
             d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn)
+
+        # Verified any FDT listed in OVERLAY_FDT_DEFAULT_BOOT must be availabe
+        # in KERNEL_DEVICETREE.
+        kernel_devicetree = set((d.getVar('KERNEL_DEVICETREE') or '').split())
+        fdt_default_boot = set((d.getVar('OVERLAY_FDT_DEFAULT_BOOT') or '').split())
+        if fdt_default_boot:
+            missing = set.difference(fdt_default_boot, kernel_devicetree)
+            if missing:
+                bb.fatal("Any FDT set in OVERLAY_FDT_DEFAULT_BOOT must be available in KERNEL_DEVICETREE.")
 }
 
 # Options for the device tree compiler passed to mkimage '-D' feature:
 UBOOT_MKIMAGE_DTCOPTS ??= ""
 
+# FDT Overlay to be set in the default boot configuration
+OVERLAY_FDT_DEFAULT_BOOT ??= ""
+
 #
 # Emit the fitImage ITS header
 #
@@ -291,6 +303,12 @@ fitimage_emit_section_config() {
 
 	if [ "${6}" = "1" ]; then
 		default_line="default = \"conf@${3}\";"
+
+		for dtbo in ${OVERLAY_FDT_DEFAULT_BOOT}; do
+			dbto=$(echo "${dtbo}" | tr '/' '_')
+			dtbos="$dtbos, \"fdt@$dbto\""
+		done
+		fdt_line=$(echo $fdt_line | sed "s/;/$dtbos;/")
 	fi
 
 	cat << EOF >> ${1}
-- 
2.7.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-28  9:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-28  9:23 [PATCH] kernel-fitimage.bbclass: introduce OVERLAY_FDT_DEFAULT_BOOT liu.ming50

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox