diff options
| -rw-r--r-- | meta/classes-recipe/devicetree.bbclass | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes-recipe/devicetree.bbclass b/meta/classes-recipe/devicetree.bbclass index ed2a92e447..bd50d7fa1d 100644 --- a/meta/classes-recipe/devicetree.bbclass +++ b/meta/classes-recipe/devicetree.bbclass | |||
| @@ -53,8 +53,10 @@ KERNEL_INCLUDE ??= " \ | |||
| 53 | 53 | ||
| 54 | DT_INCLUDE[doc] = "Search paths to be made available to both the device tree compiler and preprocessor for inclusion." | 54 | DT_INCLUDE[doc] = "Search paths to be made available to both the device tree compiler and preprocessor for inclusion." |
| 55 | DT_INCLUDE ?= "${DT_FILES_PATH} ${KERNEL_INCLUDE}" | 55 | DT_INCLUDE ?= "${DT_FILES_PATH} ${KERNEL_INCLUDE}" |
| 56 | DT_FILES_PATH[doc] = "Defaults to source directory, can be used to select dts files that are not in source (e.g. generated)." | 56 | DT_FILES_PATH[doc] = "Path to the directory containing dts files to build. Defaults to source directory." |
| 57 | DT_FILES_PATH ?= "${S}" | 57 | DT_FILES_PATH ?= "${S}" |
| 58 | DT_FILES[doc] = "Space-separated list of dts or dtb files (relative to DT_FILES_PATH) to build. If empty, all dts files are built." | ||
| 59 | DT_FILES ?= "" | ||
| 58 | 60 | ||
| 59 | DT_PADDING_SIZE[doc] = "Size of padding on the device tree blob, used as extra space typically for additional properties during boot." | 61 | DT_PADDING_SIZE[doc] = "Size of padding on the device tree blob, used as extra space typically for additional properties during boot." |
| 60 | DT_PADDING_SIZE ??= "0x3000" | 62 | DT_PADDING_SIZE ??= "0x3000" |
| @@ -125,9 +127,12 @@ def devicetree_compile(dtspath, includes, d): | |||
| 125 | subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 127 | subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 126 | 128 | ||
| 127 | python devicetree_do_compile() { | 129 | python devicetree_do_compile() { |
| 130 | import re | ||
| 128 | includes = expand_includes("DT_INCLUDE", d) | 131 | includes = expand_includes("DT_INCLUDE", d) |
| 132 | dtfiles = d.getVar("DT_FILES").split() | ||
| 133 | dtfiles = [ re.sub(r"\.dtbo?$", ".dts", dtfile) for dtfile in dtfiles ] | ||
| 129 | listpath = d.getVar("DT_FILES_PATH") | 134 | listpath = d.getVar("DT_FILES_PATH") |
| 130 | for dts in os.listdir(listpath): | 135 | for dts in dtfiles or os.listdir(listpath): |
| 131 | dtspath = os.path.join(listpath, dts) | 136 | dtspath = os.path.join(listpath, dts) |
| 132 | try: | 137 | try: |
| 133 | if not(os.path.isfile(dtspath)) or not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)): | 138 | if not(os.path.isfile(dtspath)) or not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)): |
