summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2023-07-27 10:12:15 -0500
committerRyan Eatmon <reatmon@ti.com>2023-07-31 22:18:51 -0500
commit57b7b11a503754b433b156918c9ce9bbb858b09f (patch)
tree055bf9bb41bf1865144eb7b61071bfbbc90dbdb9
parent50df03d21e4d4b1e113b89ecae88d2b8f497c43f (diff)
downloadmeta-ti-57b7b11a503754b433b156918c9ce9bbb858b09f.tar.gz
ti-kernel-devicetree-prefix: Add search function for DTBMERGE
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 <reatmon@ti.com>
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc22
1 files changed, 21 insertions, 1 deletions
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):
18 matches.append(filename) 18 matches.append(filename)
19 return ' '.join(matches) 19 return ' '.join(matches)
20 20
21KERNEL_DEVICETREE = "${@get_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} ${KERNEL_DEVICETREE_DTBMERGE}" 21def get_merge_dtbs_from_kernel(dts_dir, dts_pattern):
22 import os
23 matches = []
24 if dts_dir == "":
25 return ' '
26 for pattern in dts_pattern.split():
27 pattern_dir = os.path.split(pattern)[0]
28 pattern_target = os.path.split(pattern)[1].replace(".","-") + "s"
29 makefile = dts_dir + "/" + pattern_dir + "/Makefile"
30 if os.path.exists(makefile):
31 with open(makefile) as f:
32 if pattern_target in f.read():
33 matches.append(pattern)
34 return ' '.join(matches)
35
36KERNEL_DEVICETREE_DTBMERGE ?= ""
37
38KERNEL_DEVICETREE = " \
39 ${@get_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} \
40 ${@get_merge_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_DTBMERGE}')} \
41"
22 42