diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2023-04-25 11:06:50 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-05-13 10:20:48 -0500 |
| commit | fed09bb2f9a4d3b38e8b3452549e1e3cc2e555c9 (patch) | |
| tree | 33602f5f8c25d23f04e465ef6f7bc39f489f2abc /meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | |
| parent | ccff8f7cce68bcf5c0a2251f63200caea6adad98 (diff) | |
| download | meta-xilinx-fed09bb2f9a4d3b38e8b3452549e1e3cc2e555c9.tar.gz | |
device-tree: Move from file CONFIG_DTFILE access to SRC_URI
Move from declaring DT_FILES_PATH to the CONFIG_DTFILE dirname, to the
default where it is set to S. This adds the requirement that CONFIG_DTFILE
_must_ be self contained (or preprocessed).
This prevents the system from compiling any other dts (or dtsi) files
located in that directory, to only the ones we've specifically requested.
Additionally this simplifies the check_devicetree_variables, as hashing
and file validation are now done for us by the fetchers.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb')
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb index df63d4a1..4662c558 100644 --- a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb +++ b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | |||
| @@ -17,7 +17,6 @@ inherit devicetree image-artifact-names | |||
| 17 | # system. | 17 | # system. |
| 18 | SYSTEM_DTFILE ??= "" | 18 | SYSTEM_DTFILE ??= "" |
| 19 | CONFIG_DTFILE ??= "${SYSTEM_DTFILE}" | 19 | CONFIG_DTFILE ??= "${SYSTEM_DTFILE}" |
| 20 | DT_FILES_PATH = "${@os.path.dirname(d.getVar('CONFIG_DTFILE')) if d.getVar('CONFIG_DTFILE') else d.getVar('S')}" | ||
| 21 | 20 | ||
| 22 | EXTRA_DT_FILES ?= "" | 21 | EXTRA_DT_FILES ?= "" |
| 23 | EXTRA_DTFILE_PREFIX ?= "system-top" | 22 | EXTRA_DTFILE_PREFIX ?= "system-top" |
| @@ -32,6 +31,11 @@ CONFIG_DTFILE[doc] = "Domain Specific Device Tree which accepts 0...1 dts file" | |||
| 32 | EXTRA_DT_FILES[doc] = "Add extra files to DT_FILES_PATH, it accepts 1...n dtsi files and adds to SRC_URI" | 31 | EXTRA_DT_FILES[doc] = "Add extra files to DT_FILES_PATH, it accepts 1...n dtsi files and adds to SRC_URI" |
| 33 | EXTRA_OVERLAYS[doc] = "Add extra files to DT_FILES_PATH and adds a #include for each to the BASE_DTS, it access 1..n dtsi files and adds to SRC_URI" | 32 | EXTRA_OVERLAYS[doc] = "Add extra files to DT_FILES_PATH and adds a #include for each to the BASE_DTS, it access 1..n dtsi files and adds to SRC_URI" |
| 34 | 33 | ||
| 34 | # There should only be ONE CONFIG_DTFILE listed | ||
| 35 | # These need to be passed in from global, not from a bbappend | ||
| 36 | FILESEXTRAPATHS:prepend := "${@'%s:' % os.path.dirname(d.getVar('CONFIG_DTFILE') or '') if (d.getVar('CONFIG_DTFILE')) else ''}" | ||
| 37 | SRC_URI:append := " ${@'file://%s' % os.path.basename(d.getVar('CONFIG_DTFILE') or '') if (d.getVar('CONFIG_DTFILE')) else ''}" | ||
| 38 | |||
| 35 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_DT_FILES') or "").split()])}" | 39 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_DT_FILES') or "").split()])}" |
| 36 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_OVERLAYS') or "").split()])}" | 40 | SRC_URI:append = " ${@" ".join(["file://%s" % f for f in (d.getVar('EXTRA_OVERLAYS') or "").split()])}" |
| 37 | 41 | ||
| @@ -131,14 +135,6 @@ def check_devicetree_variables(d): | |||
| 131 | 135 | ||
| 132 | if not d.getVar('CONFIG_DTFILE'): | 136 | if not d.getVar('CONFIG_DTFILE'): |
| 133 | raise bb.parse.SkipRecipe("CONFIG_DTFILE or SYSTEM_DTFILE is not defined.") | 137 | raise bb.parse.SkipRecipe("CONFIG_DTFILE or SYSTEM_DTFILE is not defined.") |
| 134 | else: | ||
| 135 | if not os.path.exists(d.getVar('CONFIG_DTFILE')): | ||
| 136 | if not d.getVar('WITHIN_EXT_SDK'): | ||
| 137 | raise bb.parse.SkipRecipe("The device tree %s is not available." % d.getVar('CONFIG_DTFILE')) | ||
| 138 | else: | ||
| 139 | d.appendVar('SRC_URI', ' file://${CONFIG_DTFILE}') | ||
| 140 | d.setVarFlag('do_install', 'file-checksums', '${CONFIG_DTFILE}:True') | ||
| 141 | d.setVarFlag('do_deploy', 'file-checksums', '${CONFIG_DTFILE}:True') | ||
| 142 | 138 | ||
| 143 | python() { | 139 | python() { |
| 144 | # Need to allow bbappends to change the check | 140 | # Need to allow bbappends to change the check |
