blob: ddae03f5f5a78e5280b6e719856b2cacb3d396bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
SUMMARY = "Xilinx BSP device trees"
DESCRIPTION = "Xilinx BSP device trees from within layer."
SECTION = "bsp"
# the device trees from within the layer are licensed as MIT, kernel includes are GPL
LICENSE = "MIT & GPLv2"
LIC_FILES_CHKSUM = " \
file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
file://${COMMON_LICENSE_DIR}/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c \
"
inherit devicetree image-artifact-names
#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..
#SRC_URI += "file://${CONFIG_DTFILE}"
#DT_FILES_PATH = "${@d.getVar('WORKDIR')+'/'+os.path.dirname(d.getVar('CONFIG_DTFILE'))}"
# Fall back to SYSTEM_DTFILE if specified...
# CONFIG_DTFILE is intended to hold a specific configuration's (multiconfig)
# device tree, while SYSTEM_DTFILE is used for the full heterogenous
# system.
SYSTEM_DTFILE ??= ""
CONFIG_DTFILE ??= "${SYSTEM_DTFILE}"
DT_FILES_PATH = "${@os.path.dirname(d.getVar('CONFIG_DTFILE')) if d.getVar('CONFIG_DTFILE') else d.getVar('S')}"
COMPATIBLE_MACHINE:zynq = ".*"
COMPATIBLE_MACHINE:zynqmp = ".*"
COMPATIBLE_MACHINE:versal = ".*"
DEPENDS += "python3-dtc-native"
PROVIDES = "virtual/dtb"
# common zynq include
SRC_URI:append:zynq = " file://zynq-7000-qspi-dummy.dtsi"
DTB_FILE_NAME = "${@os.path.basename(d.getVar('CONFIG_DTFILE')).replace('.dts', '.dtb') if d.getVar('CONFIG_DTFILE') else ''}"
DTB_BASE_NAME ?= "${MACHINE}-system${IMAGE_VERSION_SUFFIX}"
do_install:prepend() {
for DTB_FILE in ${CONFIG_DTFILE}; do
install -Dm 0644 ${DTB_FILE} ${D}/boot/devicetree/$(basename ${DTB_FILE})
done
}
devicetree_do_deploy:append() {
for DTB_FILE in ${CONFIG_DTFILE}; do
install -Dm 0644 ${DTB_FILE} ${DEPLOYDIR}/devicetree/$(basename ${DTB_FILE})
done
if [ -n "${DTB_FILE_NAME}" ]; then
if [ -e "${DEPLOYDIR}/devicetree/${DTB_FILE_NAME}" ]; then
# We need the output to be system.dtb for WIC setup to match XSCT flow
ln -sf devicetree/${DTB_FILE_NAME} ${DEPLOYDIR}/${DTB_BASE_NAME}.dtb
ln -sf devicetree/${DTB_FILE_NAME} ${DEPLOYDIR}/${MACHINE}-system.dtb
ln -sf devicetree/${DTB_FILE_NAME} ${DEPLOYDIR}/system.dtb
else
bberror "Expected filename ${DTB_FILE_NAME} doesn't exist in ${DEPLOYDIR}/devicetree"
fi
fi
}
def check_devicetree_variables(d):
# Don't cache this, as the items on disk can change!
d.setVar('BB_DONT_CACHE', '1')
if not d.getVar('CONFIG_DTFILE'):
raise bb.parse.SkipRecipe("CONFIG_DTFILE or SYSTEM_DTFILE is not defined.")
else:
if not os.path.exists(d.getVar('CONFIG_DTFILE')):
if not d.getVar('WITHIN_EXT_SDK'):
raise bb.parse.SkipRecipe("The device tree %s is not available." % d.getVar('CONFIG_DTFILE'))
else:
d.appendVar('SRC_URI', ' file://${CONFIG_DTFILE}')
d.setVarFlag('do_install', 'file-checksums', '${CONFIG_DTFILE}:True')
d.setVarFlag('do_deploy', 'file-checksums', '${CONFIG_DTFILE}:True')
python() {
# Need to allow bbappends to change the check
check_devicetree_variables(d)
}
|