summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2018-03-29 22:56:26 +1000
committerManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2019-01-01 20:03:46 -0800
commitb6f2540b0ab22dba8b90e68f4151e865483d51d9 (patch)
treeca60eb9346afee005f355809bf3c11f9d0912b3f
parent0e911125d168bb424d58afcd24646694fbd438e4 (diff)
downloadmeta-xilinx-b6f2540b0ab22dba8b90e68f4151e865483d51d9.tar.gz
device-tree: Consolidate device-tree recipe and append
With the introduction of devicetree.bbclass in oe-core/meta, remove the implementation of device tree compilation from device-tree.bb keeping the meta-xilinx specific information and licensing. Also consolidate the device-tree.bb and device-tree.bbappend. The only differences between the existing device-tree.bb implementation and the devicetree.bbclass implementation is the device trees are deployed in a "devicetree/" subdirectory within the deployed images directory. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
-rw-r--r--meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb90
-rw-r--r--meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend30
2 files changed, 23 insertions, 97 deletions
diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb b/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb
index d1b67710..cf38c6ce 100644
--- a/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb
+++ b/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb
@@ -1,86 +1,42 @@
1SUMMARY = "Device Trees for BSPs" 1SUMMARY = "Xilinx BSP device trees"
2DESCRIPTION = "Device Tree generation and packaging for BSP Device Trees." 2DESCRIPTION = "Xilinx BSP device trees from within layer."
3SECTION = "bsp" 3SECTION = "bsp"
4 4
5# the device trees from within the layer are licensed as MIT, kernel includes are GPL
5LICENSE = "MIT & GPLv2" 6LICENSE = "MIT & GPLv2"
6LIC_FILES_CHKSUM = " \ 7LIC_FILES_CHKSUM = " \
7 file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \ 8 file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
8 file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \ 9 file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
9 " 10 "
10 11
11inherit deploy kernel-arch 12inherit devicetree
12 13
13PROVIDES = "virtual/dtb" 14PROVIDES = "virtual/dtb"
14 15
15INHIBIT_DEFAULT_DEPS = "1" 16# common zynq include
16DEPENDS += "dtc-native" 17SRC_URI_append_zynq = " file://zynq-7000-qspi-dummy.dtsi"
17 18
18COMPATIBLE_MACHINE ?= "^$" 19# device tree sources for the various machines
20COMPATIBLE_MACHINE_picozed-zynq7 = ".*"
21SRC_URI_append_picozed-zynq7 = " file://picozed-zynq7.dts"
19 22
20PACKAGE_ARCH = "${MACHINE_ARCH}" 23COMPATIBLE_MACHINE_microzed-zynq7 = ".*"
24SRC_URI_append_microzed-zynq7 = " file://microzed-zynq7.dts"
21 25
22FILES_${PN} = "/boot/devicetree/*.dtb /boot/devicetree/*.dtbo" 26COMPATIBLE_MACHINE_qemu-zynq7 = ".*"
27SRC_URI_append_qemu-zynq7 = " file://qemu-zynq7.dts"
23 28
24S = "${WORKDIR}" 29COMPATIBLE_MACHINE_zybo-linux-bd-zynq7 = ".*"
25B = "${WORKDIR}/build" 30SRC_URI_append_zybo-linux-bd-zynq7 = " \
26 31 file://zybo-linux-bd-zynq7.dts \
27SYSROOT_DIRS += "/boot/devicetree" 32 file://pcw.dtsi \
28 33 file://pl.dtsi \
29# By default provide the current kernel arch's boot/dts and boot/dts/include.
30KERNEL_DTS_INCLUDE ??= " \
31 ${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts \
32 ${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/include \
33 ${STAGING_KERNEL_DIR}/scripts/dtc/include-prefixes \
34 "
35# For arm64/zynqmp the xilinx specific includes are subdired under a vendor directory.
36KERNEL_DTS_INCLUDE_append_zynqmp = " \
37 ${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/xilinx \
38 " 34 "
39 35
40DTS_FILES_PATH ?= "${S}" 36COMPATIBLE_MACHINE_kc705-microblazeel = ".*"
41DTS_INCLUDE ?= "${DTS_FILES_PATH} ${KERNEL_DTS_INCLUDE}" 37SRC_URI_append_kc705-microblazeel = " \
42 38 file://kc705-microblazeel.dts \
43DT_PADDING_SIZE ?= "0x3000" 39 file://pl.dtsi \
44DEVICETREE_FLAGS ?= " \ 40 file://system-conf.dtsi \
45 -R 8 -p ${DT_PADDING_SIZE} -b 0 \
46 ${@' '.join(['-i %s' % i for i in d.getVar('DTS_INCLUDE', True).split()])} \
47 "
48DEVICETREE_OFLAGS ?= "-@ -H epapr"
49DEVICETREE_PP_FLAGS ?= " \
50 -nostdinc -Ulinux -x assembler-with-cpp \
51 ${@' '.join(['-I%s' % i for i in d.getVar('DTS_INCLUDE', True).split()])} \
52 " 41 "
53 42
54python () {
55 # auto add dependency on kernel tree
56 if d.getVar("KERNEL_DTS_INCLUDE") != "":
57 d.appendVarFlag("do_compile", "depends", " virtual/kernel:do_configure")
58}
59
60do_compile() {
61 for DTS_FILE in ${DTS_FILES_PATH}/*.dts; do
62 DTS_NAME=`basename -s .dts ${DTS_FILE}`
63 ${BUILD_CPP} ${DEVICETREE_PP_FLAGS} -o `basename ${DTS_FILE}`.pp ${DTS_FILE}
64
65 # for now use the existance of the '/plugin/' tag to detect overlays
66 if grep -qse "/plugin/;" `basename ${DTS_FILE}`.pp; then
67 dtc ${DEVICETREE_OFLAGS} -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}.dtbo `basename ${DTS_FILE}`.pp
68 else
69 dtc -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}.dtb `basename ${DTS_FILE}`.pp
70 fi
71 done
72}
73
74do_install() {
75 for DTB_FILE in `ls *.dtb *.dtbo`; do
76 install -Dm 0644 ${B}/${DTB_FILE} ${D}/boot/devicetree/${DTB_FILE}
77 done
78}
79
80do_deploy() {
81 for DTB_FILE in `ls *.dtb *.dtbo`; do
82 install -Dm 0644 ${B}/${DTB_FILE} ${DEPLOYDIR}/${DTB_FILE}
83 done
84}
85addtask deploy before do_build after do_install
86
diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend
deleted file mode 100644
index e128e0e8..00000000
--- a/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend
+++ /dev/null
@@ -1,30 +0,0 @@
1
2FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
3
4# common zynq include
5SRC_URI_append_zynq = " file://zynq-7000-qspi-dummy.dtsi"
6
7# device tree sources for the various machines
8COMPATIBLE_MACHINE_picozed-zynq7 = ".*"
9SRC_URI_append_picozed-zynq7 = " file://picozed-zynq7.dts"
10
11COMPATIBLE_MACHINE_microzed-zynq7 = ".*"
12SRC_URI_append_microzed-zynq7 = " file://microzed-zynq7.dts"
13
14COMPATIBLE_MACHINE_qemu-zynq7 = ".*"
15SRC_URI_append_qemu-zynq7 = " file://qemu-zynq7.dts"
16
17COMPATIBLE_MACHINE_zybo-linux-bd-zynq7 = ".*"
18SRC_URI_append_zybo-linux-bd-zynq7 = " \
19 file://zybo-linux-bd-zynq7.dts \
20 file://pcw.dtsi \
21 file://pl.dtsi \
22 "
23
24COMPATIBLE_MACHINE_kc705-microblazeel = ".*"
25SRC_URI_append_kc705-microblazeel = " \
26 file://kc705-microblazeel.dts \
27 file://pl.dtsi \
28 file://system-conf.dtsi \
29 "
30