diff options
author | Ryan Eatmon <reatmon@ti.com> | 2023-07-26 11:35:15 -0500 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2023-07-31 14:55:48 -0500 |
commit | e969884edb5a679c09960207253d785d82b72d3d (patch) | |
tree | aa4f7b51acd6aa0077ca26ab253fbf1dfb7d5014 /meta-ti-bsp/recipes-kernel | |
parent | 19340ce0cd136a5c86000c80d416bc345a855157 (diff) | |
download | meta-ti-e969884edb5a679c09960207253d785d82b72d3d.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>
Diffstat (limited to 'meta-ti-bsp/recipes-kernel')
-rw-r--r-- | meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc | 22 |
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 | ||
21 | KERNEL_DEVICETREE = "${@get_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} ${KERNEL_DEVICETREE_DTBMERGE}" | 21 | def 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 | |||
36 | KERNEL_DEVICETREE_DTBMERGE ?= "" | ||
37 | |||
38 | KERNEL_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 | ||