summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@konsulko.com>2025-07-25 16:49:08 -0400
committerRyan Eatmon <reatmon@ti.com>2025-07-25 16:08:55 -0500
commit3fd46742645be6be766558ae6431e561e483fedb (patch)
tree286ad1fe5a7391c5c760e1e2d27085a2dc46463f
parent5e8eca8bfd4fa345af36c9b74212811359f4898d (diff)
downloadmeta-ti-3fd46742645be6be766558ae6431e561e483fedb.tar.gz
meta-ti-bsp: convert DTB prefix matching into class
Convert devicetree prefix matching functionality into a generic class that can be used by the kernel and wic images. That way dynamically generated KERNEL_DEVICETREE list will be the same when populating /boot dir of rootfs and/or FAT boot partition of a wic image. Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r--meta-ti-bsp/classes/ti-devicetree-prefix.bbclass (renamed from meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc)7
-rw-r--r--meta-ti-bsp/conf/machine/include/ti-soc.inc8
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb2
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb1
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb1
5 files changed, 13 insertions, 6 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc b/meta-ti-bsp/classes/ti-devicetree-prefix.bbclass
index 2d7be280..5858cc65 100644
--- a/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc
+++ b/meta-ti-bsp/classes/ti-devicetree-prefix.bbclass
@@ -1,3 +1,4 @@
1# Generate list of DTBs from the kernel source
1def get_dtbs_from_kernel(dts_dir, dts_prefix): 2def get_dtbs_from_kernel(dts_dir, dts_prefix):
2 import os 3 import os
3 import glob 4 import glob
@@ -17,6 +18,8 @@ def get_dtbs_from_kernel(dts_dir, dts_prefix):
17 matches.append(filename) 18 matches.append(filename)
18 return ' '.join(matches) 19 return ' '.join(matches)
19 20
21# Generate list of "merged" DTBs from the kernel source
22# It is TI custom feature to merge DTB overlays into a single DTB
20def get_merge_dtbs_from_kernel(dts_dir, dts_pattern): 23def get_merge_dtbs_from_kernel(dts_dir, dts_pattern):
21 import os 24 import os
22 matches = [] 25 matches = []
@@ -32,9 +35,9 @@ def get_merge_dtbs_from_kernel(dts_dir, dts_pattern):
32 matches.append(pattern) 35 matches.append(pattern)
33 return ' '.join(matches) 36 return ' '.join(matches)
34 37
35KERNEL_DEVICETREE_DTBMERGE ?= ""
36
37KERNEL_DEVICETREE = " \ 38KERNEL_DEVICETREE = " \
38 ${@get_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} \ 39 ${@get_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} \
39 ${@get_merge_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_DTBMERGE}')} \ 40 ${@get_merge_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_DTBMERGE}')} \
40" 41"
42
43do_image_wic[depends] += "virtual/kernel:do_shared_workdir"
diff --git a/meta-ti-bsp/conf/machine/include/ti-soc.inc b/meta-ti-bsp/conf/machine/include/ti-soc.inc
index 85f6f338..018e9bfb 100644
--- a/meta-ti-bsp/conf/machine/include/ti-soc.inc
+++ b/meta-ti-bsp/conf/machine/include/ti-soc.inc
@@ -19,3 +19,11 @@ KERNEL_DTBVENDORED = "1"
19 19
20# Also build a non-vendored list w/o dir structure 20# Also build a non-vendored list w/o dir structure
21DEVICETREE_FILES = "${@' '.join([os.path.basename(f) for f in d.getVar("KERNEL_DEVICETREE").split()])}" 21DEVICETREE_FILES = "${@' '.join([os.path.basename(f) for f in d.getVar("KERNEL_DEVICETREE").split()])}"
22
23KERNEL_DEVICETREE_DTBMERGE ?= ""
24
25# Dynamically build DTBs list based on prefix matching
26CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''}"
27
28KERNEL_CLASSES += "${CLASS_DEVICETREE_PREFIX}"
29IMAGE_CLASSES += "${CLASS_DEVICETREE_PREFIX}"
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb
index 1feb7564..60b647f1 100644
--- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb
@@ -2,8 +2,6 @@ require linux-ti-mainline_git.bb
2 2
3SUMMARY = "Linux-next kernel for TI devices" 3SUMMARY = "Linux-next kernel for TI devices"
4 4
5include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''}
6
7# 6.6.0-rc3+ version 5# 6.6.0-rc3+ version
8SRCREV = "6465e260f48790807eef06b583b38ca9789b6072" 6SRCREV = "6465e260f48790807eef06b583b38ca9789b6072"
9PV = "6.6.0-rc3+git" 7PV = "6.6.0-rc3+git"
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb
index 9235cbc5..aa677cb2 100644
--- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb
@@ -8,7 +8,6 @@ inherit kernel
8 8
9require recipes-kernel/linux/setup-defconfig.inc 9require recipes-kernel/linux/setup-defconfig.inc
10require recipes-kernel/linux/ti-kernel.inc 10require recipes-kernel/linux/ti-kernel.inc
11include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''}
12include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''} 11include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''}
13 12
14DEPENDS += "gmp-native libmpc-native" 13DEPENDS += "gmp-native libmpc-native"
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb
index 17bcd300..d6985b27 100644
--- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb
+++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb
@@ -8,7 +8,6 @@ inherit kernel
8 8
9require recipes-kernel/linux/setup-defconfig.inc 9require recipes-kernel/linux/setup-defconfig.inc
10require recipes-kernel/linux/ti-kernel.inc 10require recipes-kernel/linux/ti-kernel.inc
11include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''}
12include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''} 11include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''}
13 12
14DEPENDS += "gmp-native libmpc-native" 13DEPENDS += "gmp-native libmpc-native"