With the change to the vendored arch/arm/boot/dts directory, we need to
add support to the KERNEL_DEVICETREE_DTBMERGE to make it a search
pattern instead of a fixed list.

Signed-off-by: Ryan Eatmon <[email protected]>
---
 .../linux/ti-kernel-devicetree-prefix.inc     | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc 
b/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
index 1496a749..04c91004 100644
--- a/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
+++ b/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
@@ -18,5 +18,25 @@ def get_dtbs_from_kernel(dts_dir, dts_prefix):
             matches.append(filename)
     return ' '.join(matches)
 
-KERNEL_DEVICETREE = "${@get_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', 
'${KERNEL_DEVICETREE_PREFIX}')} ${KERNEL_DEVICETREE_DTBMERGE}"
+def get_merge_dtbs_from_kernel(dts_dir, dts_pattern):
+    import os
+    matches = []
+    if dts_dir == "":
+        return ' '
+    for pattern in dts_pattern.split():
+        pattern_dir = os.path.split(pattern)[0]
+        pattern_target = os.path.split(pattern)[1].replace(".","-") + "s"
+        makefile = dts_dir + "/" + pattern_dir + "/Makefile"
+        if os.path.exists(makefile):
+            with open(makefile) as f:
+                if pattern_target in f.read():
+                    matches.append(pattern)
+    return ' '.join(matches)
+
+KERNEL_DEVICETREE_DTBMERGE ?= ""
+
+KERNEL_DEVICETREE = " \
+    ${@get_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', 
'${KERNEL_DEVICETREE_PREFIX}')} \
+    ${@get_merge_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', 
'${KERNEL_DEVICETREE_DTBMERGE}')} \
+"
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#16864): 
https://lists.yoctoproject.org/g/meta-ti/message/16864
Mute This Topic: https://lists.yoctoproject.org/mt/100392352/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/meta-ti/leave/6695321/21656/1393940836/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to