From: Ming Liu <[email protected]>

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 <[email protected]>
---
 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

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to