summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb44
-rw-r--r--meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend15
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 = " \
12inherit devicetree image-artifact-names 12inherit 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
18DT_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.
22SYSTEM_DTFILE ??= ""
23CONFIG_DTFILE ??= "${SYSTEM_DTFILE}"
24DT_FILES_PATH = "${@os.path.dirname(d.getVar('CONFIG_DTFILE')) if d.getVar('CONFIG_DTFILE') else d.getVar('S')}"
19 25
26COMPATIBLE_MACHINE:zynq = ".*"
20COMPATIBLE_MACHINE:zynqmp = ".*" 27COMPATIBLE_MACHINE:zynqmp = ".*"
21COMPATIBLE_MACHINE:versal = ".*" 28COMPATIBLE_MACHINE:versal = ".*"
22 29
@@ -27,10 +34,21 @@ PROVIDES = "virtual/dtb"
27# common zynq include 34# common zynq include
28SRC_URI:append:zynq = " file://zynq-7000-qspi-dummy.dtsi" 35SRC_URI:append:zynq = " file://zynq-7000-qspi-dummy.dtsi"
29 36
30DTB_FILE_NAME = "${@os.path.basename(d.getVar('SYSTEM_DTFILE')).replace('.dts', '.dtb') if d.getVar('SYSTEM_DTFILE') else ''}" 37DTB_FILE_NAME = "${@os.path.basename(d.getVar('CONFIG_DTFILE')).replace('.dts', '.dtb') if d.getVar('CONFIG_DTFILE') else ''}"
38
31DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}" 39DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}"
32 40
41do_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
33devicetree_do_deploy:append() { 47devicetree_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
64def 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
77python() {
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 @@
1CONFIG_DTFILE ?= ""
2
3do_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
11devicetree_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}