summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2022-01-21 12:41:42 -0800
committerMark Hatle <mark.hatle@xilinx.com>2022-01-22 08:31:30 -0800
commit2c4e691200c816037a5760fe9749b28cca06c023 (patch)
tree69f3c37c00b5ab8c5864200672fa7b801af32ecb /meta-xilinx-core
parentdb61d8e2a7a3ebe46a3482bf3dfa191a1cfc43b7 (diff)
downloadmeta-xilinx-2c4e691200c816037a5760fe9749b28cca06c023.tar.gz
device-tree: Merge experimental and standard flows
We need a method for regular building to specify a device tree. Since the experimental flow already contained this, merge it in and connect to the existing SYSTEM_DTFILE as a fall back. Also enable addition 'early package failure' messages to alert the user as soon as possible they need to pass in additional information. Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-core')
-rw-r--r--meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb44
1 files changed, 40 insertions, 4 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}