diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2016-02-23 20:10:54 +1000 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2016-03-06 20:04:03 +1000 |
commit | d9afe0553794e57682de10baeb413494e3399477 (patch) | |
tree | 10724f9ee33beca9d9cfae2999958aab09235fd0 | |
parent | 2aa978a72ea45f121f1cfb37172f02afe2c11bd2 (diff) | |
download | meta-xilinx-d9afe0553794e57682de10baeb413494e3399477.tar.gz |
device-tree.bb: Add support to use kernel source tree includes
* Add support to use the base platform includes directly from the
currently selected kernel source tree
* Setup 'zynq-7000.dtsi' as default for 'zynq' targets
* Setup 'zynqmp.dtsi' as default for 'zynqmp' targets
* Remove use of awk, use basename -s instead
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
-rw-r--r-- | recipes-bsp/device-tree/device-tree.bb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/recipes-bsp/device-tree/device-tree.bb b/recipes-bsp/device-tree/device-tree.bb index 3cd6b266..6332e9c2 100644 --- a/recipes-bsp/device-tree/device-tree.bb +++ b/recipes-bsp/device-tree/device-tree.bb | |||
@@ -15,7 +15,26 @@ DEVICETREE_FLAGS ?= "-R 8 -p 0x3000" | |||
15 | 15 | ||
16 | S = "${WORKDIR}" | 16 | S = "${WORKDIR}" |
17 | 17 | ||
18 | KERNEL_DTS_INCLUDE ??= "" | ||
19 | KERNEL_DTS_INCLUDE_zynq = "arch/arm/boot/dts/skeleton.dtsi arch/arm/boot/dts/zynq-7000.dtsi" | ||
20 | KERNEL_DTS_INCLUDE_zynqmp = "arch/arm/boot/dts/skeleton.dtsi arch/arm64/boot/dts/xilinx/zynqmp.dtsi" | ||
21 | |||
22 | python () { | ||
23 | # auto add dependency on kernel tree | ||
24 | if d.getVar("KERNEL_DTS_INCLUDE", True) != "": | ||
25 | d.setVarFlag("do_compile", "depends", | ||
26 | " ".join([d.getVarFlag("do_compile", "depends", True) or "", "virtual/kernel:do_shared_workdir"])) | ||
27 | } | ||
28 | |||
18 | do_compile() { | 29 | do_compile() { |
30 | for i in ${KERNEL_DTS_INCLUDE}; do | ||
31 | DTSI_NAME=`basename $i` | ||
32 | if test -e ${STAGING_KERNEL_DIR}/$i; then | ||
33 | mkdir -p ${WORKDIR}/devicetree | ||
34 | cp ${STAGING_KERNEL_DIR}/$i ${WORKDIR}/devicetree/${DTSI_NAME} | ||
35 | fi | ||
36 | done | ||
37 | |||
19 | if test -n "${MACHINE_DEVICETREE}"; then | 38 | if test -n "${MACHINE_DEVICETREE}"; then |
20 | mkdir -p ${WORKDIR}/devicetree | 39 | mkdir -p ${WORKDIR}/devicetree |
21 | for i in ${MACHINE_DEVICETREE}; do | 40 | for i in ${MACHINE_DEVICETREE}; do |
@@ -27,7 +46,7 @@ do_compile() { | |||
27 | fi | 46 | fi |
28 | 47 | ||
29 | for DTS_FILE in ${DEVICETREE}; do | 48 | for DTS_FILE in ${DEVICETREE}; do |
30 | DTS_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` | 49 | DTS_NAME=`basename -s .dts ${DTS_FILE}` |
31 | dtc -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}.dtb ${DTS_FILE} | 50 | dtc -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}.dtb ${DTS_FILE} |
32 | done | 51 | done |
33 | } | 52 | } |
@@ -38,7 +57,7 @@ do_install() { | |||
38 | echo "Warning: ${DTS_FILE} is not available!" | 57 | echo "Warning: ${DTS_FILE} is not available!" |
39 | continue | 58 | continue |
40 | fi | 59 | fi |
41 | DTS_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` | 60 | DTS_NAME=`basename -s .dts ${DTS_FILE}` |
42 | install -d ${D}/boot/devicetree | 61 | install -d ${D}/boot/devicetree |
43 | install -m 0644 ${B}/${DTS_NAME}.dtb ${D}/boot/devicetree/${DTS_NAME}.dtb | 62 | install -m 0644 ${B}/${DTS_NAME}.dtb ${D}/boot/devicetree/${DTS_NAME}.dtb |
44 | done | 63 | done |
@@ -50,7 +69,7 @@ do_deploy() { | |||
50 | echo "Warning: ${DTS_FILE} is not available!" | 69 | echo "Warning: ${DTS_FILE} is not available!" |
51 | continue | 70 | continue |
52 | fi | 71 | fi |
53 | DTS_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` | 72 | DTS_NAME=`basename -s .dts ${DTS_FILE}` |
54 | install -d ${DEPLOY_DIR_IMAGE} | 73 | install -d ${DEPLOY_DIR_IMAGE} |
55 | install -m 0644 ${B}/${DTS_NAME}.dtb ${DEPLOY_DIR_IMAGE}/${DTS_NAME}.dtb | 74 | install -m 0644 ${B}/${DTS_NAME}.dtb ${DEPLOY_DIR_IMAGE}/${DTS_NAME}.dtb |
56 | done | 75 | done |
@@ -61,7 +80,7 @@ DEPLOY_KERNEL_DTB_qemuzynq = "1" | |||
61 | do_deploy_append() { | 80 | do_deploy_append() { |
62 | if [ ! -z "${DEPLOY_KERNEL_DTB}" -a ! -z "${KERNEL_IMAGETYPE}" ]; then | 81 | if [ ! -z "${DEPLOY_KERNEL_DTB}" -a ! -z "${KERNEL_IMAGETYPE}" ]; then |
63 | for DTS_FILE in ${DEVICETREE}; do | 82 | for DTS_FILE in ${DEVICETREE}; do |
64 | DTS_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` | 83 | DTS_NAME=`basename -s .dts ${DTS_FILE}` |
65 | KERNELDTBPATH=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_NAME}.dtb | 84 | KERNELDTBPATH=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_NAME}.dtb |
66 | if [ ! -e ${KERNELDTBPATH} -o -h ${KERNELDTBPATH} ]; then | 85 | if [ ! -e ${KERNELDTBPATH} -o -h ${KERNELDTBPATH} ]; then |
67 | ln -sf ${DTS_NAME}.dtb ${KERNELDTBPATH} | 86 | ln -sf ${DTS_NAME}.dtb ${KERNELDTBPATH} |