diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2018-03-29 22:56:26 +1000 |
---|---|---|
committer | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2019-01-01 20:03:46 -0800 |
commit | b6f2540b0ab22dba8b90e68f4151e865483d51d9 (patch) | |
tree | ca60eb9346afee005f355809bf3c11f9d0912b3f | |
parent | 0e911125d168bb424d58afcd24646694fbd438e4 (diff) | |
download | meta-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.bb | 90 | ||||
-rw-r--r-- | meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend | 30 |
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 @@ | |||
1 | SUMMARY = "Device Trees for BSPs" | 1 | SUMMARY = "Xilinx BSP device trees" |
2 | DESCRIPTION = "Device Tree generation and packaging for BSP Device Trees." | 2 | DESCRIPTION = "Xilinx BSP device trees from within layer." |
3 | SECTION = "bsp" | 3 | SECTION = "bsp" |
4 | 4 | ||
5 | # the device trees from within the layer are licensed as MIT, kernel includes are GPL | ||
5 | LICENSE = "MIT & GPLv2" | 6 | LICENSE = "MIT & GPLv2" |
6 | LIC_FILES_CHKSUM = " \ | 7 | LIC_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 | ||
11 | inherit deploy kernel-arch | 12 | inherit devicetree |
12 | 13 | ||
13 | PROVIDES = "virtual/dtb" | 14 | PROVIDES = "virtual/dtb" |
14 | 15 | ||
15 | INHIBIT_DEFAULT_DEPS = "1" | 16 | # common zynq include |
16 | DEPENDS += "dtc-native" | 17 | SRC_URI_append_zynq = " file://zynq-7000-qspi-dummy.dtsi" |
17 | 18 | ||
18 | COMPATIBLE_MACHINE ?= "^$" | 19 | # device tree sources for the various machines |
20 | COMPATIBLE_MACHINE_picozed-zynq7 = ".*" | ||
21 | SRC_URI_append_picozed-zynq7 = " file://picozed-zynq7.dts" | ||
19 | 22 | ||
20 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 23 | COMPATIBLE_MACHINE_microzed-zynq7 = ".*" |
24 | SRC_URI_append_microzed-zynq7 = " file://microzed-zynq7.dts" | ||
21 | 25 | ||
22 | FILES_${PN} = "/boot/devicetree/*.dtb /boot/devicetree/*.dtbo" | 26 | COMPATIBLE_MACHINE_qemu-zynq7 = ".*" |
27 | SRC_URI_append_qemu-zynq7 = " file://qemu-zynq7.dts" | ||
23 | 28 | ||
24 | S = "${WORKDIR}" | 29 | COMPATIBLE_MACHINE_zybo-linux-bd-zynq7 = ".*" |
25 | B = "${WORKDIR}/build" | 30 | SRC_URI_append_zybo-linux-bd-zynq7 = " \ |
26 | 31 | file://zybo-linux-bd-zynq7.dts \ | |
27 | SYSROOT_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. | ||
30 | KERNEL_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. | ||
36 | KERNEL_DTS_INCLUDE_append_zynqmp = " \ | ||
37 | ${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/xilinx \ | ||
38 | " | 34 | " |
39 | 35 | ||
40 | DTS_FILES_PATH ?= "${S}" | 36 | COMPATIBLE_MACHINE_kc705-microblazeel = ".*" |
41 | DTS_INCLUDE ?= "${DTS_FILES_PATH} ${KERNEL_DTS_INCLUDE}" | 37 | SRC_URI_append_kc705-microblazeel = " \ |
42 | 38 | file://kc705-microblazeel.dts \ | |
43 | DT_PADDING_SIZE ?= "0x3000" | 39 | file://pl.dtsi \ |
44 | DEVICETREE_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 | " | ||
48 | DEVICETREE_OFLAGS ?= "-@ -H epapr" | ||
49 | DEVICETREE_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 | ||
54 | python () { | ||
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 | |||
60 | do_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 | |||
74 | do_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 | |||
80 | do_deploy() { | ||
81 | for DTB_FILE in `ls *.dtb *.dtbo`; do | ||
82 | install -Dm 0644 ${B}/${DTB_FILE} ${DEPLOYDIR}/${DTB_FILE} | ||
83 | done | ||
84 | } | ||
85 | addtask 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 | |||
2 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
3 | |||
4 | # common zynq include | ||
5 | SRC_URI_append_zynq = " file://zynq-7000-qspi-dummy.dtsi" | ||
6 | |||
7 | # device tree sources for the various machines | ||
8 | COMPATIBLE_MACHINE_picozed-zynq7 = ".*" | ||
9 | SRC_URI_append_picozed-zynq7 = " file://picozed-zynq7.dts" | ||
10 | |||
11 | COMPATIBLE_MACHINE_microzed-zynq7 = ".*" | ||
12 | SRC_URI_append_microzed-zynq7 = " file://microzed-zynq7.dts" | ||
13 | |||
14 | COMPATIBLE_MACHINE_qemu-zynq7 = ".*" | ||
15 | SRC_URI_append_qemu-zynq7 = " file://qemu-zynq7.dts" | ||
16 | |||
17 | COMPATIBLE_MACHINE_zybo-linux-bd-zynq7 = ".*" | ||
18 | SRC_URI_append_zybo-linux-bd-zynq7 = " \ | ||
19 | file://zybo-linux-bd-zynq7.dts \ | ||
20 | file://pcw.dtsi \ | ||
21 | file://pl.dtsi \ | ||
22 | " | ||
23 | |||
24 | COMPATIBLE_MACHINE_kc705-microblazeel = ".*" | ||
25 | SRC_URI_append_kc705-microblazeel = " \ | ||
26 | file://kc705-microblazeel.dts \ | ||
27 | file://pl.dtsi \ | ||
28 | file://system-conf.dtsi \ | ||
29 | " | ||
30 | |||