summaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2023-03-17 10:20:53 -0500
committerRyan Eatmon <reatmon@ti.com>2023-03-31 09:25:37 -0500
commit4baa0cbd9b2dfa54dba4461926d8d3e6d033c405 (patch)
tree1b5fa7fb9b0559ab4ce9314d38863b3ecef6ca8d /meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
parent2d5d741f9b30639ae3ab1f75a6ae547c007cb3f5 (diff)
downloadmeta-ti-4baa0cbd9b2dfa54dba4461926d8d3e6d033c405.tar.gz
linux-ti-*: Add filtering for which dtb/dtbo to include
We often carry more dtbs/dtbos in our kernel than we have upstreamed. The inclusion of all of the dtb/dtbo in the KERNEL_DEVICETREE has become problematic as we start testing the linux-next and 6.1 as part of our LTS migration. To address this issue we are adding in two step method for managing the KERNEL_DEVICETREE. Going forward we will only accept dtb/dtbo in KERNEL_DEVICETREE if it is available in upstream. This way we ensure that the variable is more accurate for whichever kernel you might be looking at. We have also added a new variable KERNEL_DEVICETREE_PREFIX which our kernel recipes will use to auto set KERNEL_DEVICETREE based on what files are in the kernel and not a fixed list in the conf files. Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Andrew Davis <afd@ti.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc')
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc22
1 files changed, 22 insertions, 0 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
new file mode 100644
index 00000000..1496a749
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
@@ -0,0 +1,22 @@
1
2def get_dtbs_from_kernel(dts_dir, dts_prefix):
3 import os
4 import glob
5 matches = []
6
7 for prefix in dts_prefix.split():
8 filenames = glob.glob(dts_dir + prefix + '*.dts')
9 filenames += glob.glob(dts_dir + prefix + '*.dtso')
10 for filename in filenames:
11 # Before v6.2 kernels DTB Overlays shared the same name as DTB files
12 # so we need to search the file to find the type
13 with open(filename) as f:
14 file_postfix = '.dtbo' if '/plugin/;' in f.read() else '.dtb'
15 filename = os.path.split(filename)[1]
16 filename = os.path.splitext(filename)[0] + file_postfix
17 filename = os.path.join(os.path.split(prefix)[0], filename)
18 matches.append(filename)
19 return ' '.join(matches)
20
21KERNEL_DEVICETREE = "${@get_dtbs_from_kernel('${S}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} ${KERNEL_DEVICETREE_DTBMERGE}"
22