diff options
| -rw-r--r-- | meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | 44 | ||||
| -rw-r--r-- | meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend | 15 |
2 files changed, 40 insertions, 19 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 626a9cb1..9bc81c41 100644 --- a/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb +++ b/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb | |||
| @@ -12,11 +12,18 @@ LIC_FILES_CHKSUM = " \ | |||
| 12 | inherit devicetree image-artifact-names | 12 | inherit devicetree image-artifact-names |
| 13 | 13 | ||
| 14 | #this way of going through SRC_URI is better but if dts is including other dtsis, need to add all of them to SRC_URI.. | 14 | #this way of going through SRC_URI is better but if dts is including other dtsis, need to add all of them to SRC_URI.. |
| 15 | #SRC_URI += "file://${SYSTEM_DTFILE}" | 15 | #SRC_URI += "file://${CONFIG_DTFILE}" |
| 16 | #DT_FILES_PATH = "${@d.getVar('WORKDIR')+'/'+os.path.dirname(d.getVar('SYSTEM_DTFILE'))}" | 16 | #DT_FILES_PATH = "${@d.getVar('WORKDIR')+'/'+os.path.dirname(d.getVar('CONFIG_DTFILE'))}" |
| 17 | 17 | ||
| 18 | DT_FILES_PATH = "${@os.path.dirname(d.getVar('SYSTEM_DTFILE')) if d.getVar('SYSTEM_DTFILE') else d.getVar('S')}" | 18 | # Fall back to SYSTEM_DTFILE if specified... |
| 19 | # CONFIG_DTFILE is intended to hold a specific configuration's (multiconfig) | ||
| 20 | # device tree, while SYSTEM_DTFILE is used for the full heterogenous | ||
| 21 | # system. | ||
| 22 | SYSTEM_DTFILE ??= "" | ||
| 23 | CONFIG_DTFILE ??= "${SYSTEM_DTFILE}" | ||
| 24 | DT_FILES_PATH = "${@os.path.dirname(d.getVar('CONFIG_DTFILE')) if d.getVar('CONFIG_DTFILE') else d.getVar('S')}" | ||
| 19 | 25 | ||
| 26 | COMPATIBLE_MACHINE:zynq = ".*" | ||
| 20 | COMPATIBLE_MACHINE:zynqmp = ".*" | 27 | COMPATIBLE_MACHINE:zynqmp = ".*" |
| 21 | COMPATIBLE_MACHINE:versal = ".*" | 28 | COMPATIBLE_MACHINE:versal = ".*" |
| 22 | 29 | ||
| @@ -27,10 +34,21 @@ PROVIDES = "virtual/dtb" | |||
| 27 | # common zynq include | 34 | # common zynq include |
| 28 | SRC_URI:append:zynq = " file://zynq-7000-qspi-dummy.dtsi" | 35 | SRC_URI:append:zynq = " file://zynq-7000-qspi-dummy.dtsi" |
| 29 | 36 | ||
| 30 | DTB_FILE_NAME = "${@os.path.basename(d.getVar('SYSTEM_DTFILE')).replace('.dts', '.dtb') if d.getVar('SYSTEM_DTFILE') else ''}" | 37 | DTB_FILE_NAME = "${@os.path.basename(d.getVar('CONFIG_DTFILE')).replace('.dts', '.dtb') if d.getVar('CONFIG_DTFILE') else ''}" |
| 38 | |||
| 31 | DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}" | 39 | DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}" |
| 32 | 40 | ||
| 41 | do_install:prepend() { | ||
| 42 | for DTB_FILE in ${CONFIG_DTFILE}; do | ||
| 43 | install -Dm 0644 ${DTB_FILE} ${D}/boot/devicetree/$(basename ${DTB_FILE}) | ||
| 44 | done | ||
| 45 | } | ||
| 46 | |||
| 33 | devicetree_do_deploy:append() { | 47 | devicetree_do_deploy:append() { |
| 48 | for DTB_FILE in ${CONFIG_DTFILE}; do | ||
| 49 | install -Dm 0644 ${DTB_FILE} ${DEPLOYDIR}/devicetree/$(basename ${DTB_FILE}) | ||
| 50 | done | ||
| 51 | |||
| 34 | if [ -n "${DTB_FILE_NAME}" ]; then | 52 | if [ -n "${DTB_FILE_NAME}" ]; then |
| 35 | if [ -e "${DEPLOYDIR}/devicetree/${DTB_FILE_NAME}" ]; then | 53 | if [ -e "${DEPLOYDIR}/devicetree/${DTB_FILE_NAME}" ]; then |
| 36 | # We need the output to be system.dtb for WIC setup to match XSCT flow | 54 | # We need the output to be system.dtb for WIC setup to match XSCT flow |
| @@ -42,3 +60,21 @@ devicetree_do_deploy:append() { | |||
| 42 | fi | 60 | fi |
| 43 | fi | 61 | fi |
| 44 | } | 62 | } |
| 63 | |||
| 64 | def check_devicetree_variables(d): | ||
| 65 | if not d.getVar('CONFIG_DTFILE'): | ||
| 66 | d.setVar('BB_DONT_CACHE', '1') | ||
| 67 | raise bb.parse.SkipRecipe("CONFIG_DTFILE or SYSTEM_DTFILE is not defined.") | ||
| 68 | else: | ||
| 69 | if not os.path.exists(d.getVar('CONFIG_DTFILE')): | ||
| 70 | d.setVar('BB_DONT_CACHE', '1') | ||
| 71 | raise bb.parse.SkipRecipe("The device tree %s is not available." % d.getVar('CONFIG_DTFILE')) | ||
| 72 | else: | ||
| 73 | d.appendVar('SRC_URI', ' file://${CONFIG_DTFILE}') | ||
| 74 | d.setVarFlag('do_install', 'file-checksums', '${CONFIG_DTFILE}:True') | ||
| 75 | d.setVarFlag('do_deploy', 'file-checksums', '${CONFIG_DTFILE}:True') | ||
| 76 | |||
| 77 | python() { | ||
| 78 | # Need to allow bbappends to change the check | ||
| 79 | check_devicetree_variables(d) | ||
| 80 | } | ||
diff --git a/meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend deleted file mode 100644 index c36ba70b..00000000 --- a/meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | CONFIG_DTFILE ?= "" | ||
| 2 | |||
| 3 | do_install:prepend() { | ||
| 4 | for DTB_FILE in ${CONFIG_DTFILE}; do | ||
| 5 | install -Dm 0644 ${DTB_FILE} ${D}/boot/devicetree/$(basename ${DTB_FILE}) | ||
| 6 | done | ||
| 7 | } | ||
| 8 | |||
| 9 | # This needs to run BEFORE the device tree version, otherwise it can error with | ||
| 10 | # Expected filename ${DTB_FILE_NAME} doesn't exist in ${DEPLOYDIR}/devicetree | ||
| 11 | devicetree_do_deploy:prepend() { | ||
| 12 | for DTB_FILE in ${CONFIG_DTFILE}; do | ||
| 13 | install -Dm 0644 ${DTB_FILE} ${DEPLOYDIR}/devicetree/$(basename ${DTB_FILE}) | ||
| 14 | done | ||
| 15 | } | ||
