diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2016-04-12 23:18:56 +1000 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2016-04-12 23:27:05 +1000 |
commit | b7862924902489ece6dbd028afcd26e5937e5e37 (patch) | |
tree | b85ca27a19efc57fd6d8d0347b2b0826156ae65a | |
parent | 4da6c8c362d7712e7d4585cd9ef30ac0f83177fb (diff) | |
download | meta-xilinx-b7862924902489ece6dbd028afcd26e5937e5e37.tar.gz |
device-tree.bb: Rework pre-processor and dtc flags
Add 'DEVICETREE_PP_FLAGS' for handling of flags for the pre-processor
step. Also merge the building of the include path args into the
variables with inline python.
Use BUILD_CPP instead of CPP to avoid dependence on the target
toolchain.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
-rw-r--r-- | recipes-bsp/device-tree/device-tree.bb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/recipes-bsp/device-tree/device-tree.bb b/recipes-bsp/device-tree/device-tree.bb index ddfa7580..95ca0f35 100644 --- a/recipes-bsp/device-tree/device-tree.bb +++ b/recipes-bsp/device-tree/device-tree.bb | |||
@@ -11,7 +11,15 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" | |||
11 | DEPENDS += "dtc-native" | 11 | DEPENDS += "dtc-native" |
12 | 12 | ||
13 | FILES_${PN} = "/boot/devicetree*" | 13 | FILES_${PN} = "/boot/devicetree*" |
14 | DEVICETREE_FLAGS ?= "-R 8 -p 0x3000" | 14 | DEVICETREE_FLAGS ?= "-R 8 -p 0x3000 \ |
15 | -i ${WORKDIR}/devicetree \ | ||
16 | ${@' '.join(['-i %s' % i for i in d.getVar('KERNEL_DTS_INCLUDE', True).split()])} \ | ||
17 | " | ||
18 | DEVICETREE_PP_FLAGS ?= "-nostdinc -Ulinux \ | ||
19 | -I${WORKDIR}/devicetree \ | ||
20 | ${@' '.join(['-I%s' % i for i in d.getVar('KERNEL_DTS_INCLUDE', True).split()])} \ | ||
21 | -x assembler-with-cpp \ | ||
22 | " | ||
15 | 23 | ||
16 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | 24 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" |
17 | SRC_URI_append_zynq = " file://common/zynq7-base.dtsi" | 25 | SRC_URI_append_zynq = " file://common/zynq7-base.dtsi" |
@@ -41,7 +49,6 @@ do_compile() { | |||
41 | mkdir -p ${WORKDIR}/devicetree | 49 | mkdir -p ${WORKDIR}/devicetree |
42 | for i in ${MACHINE_DEVICETREE}; do | 50 | for i in ${MACHINE_DEVICETREE}; do |
43 | if test -e ${WORKDIR}/$i; then | 51 | if test -e ${WORKDIR}/$i; then |
44 | echo cp ${WORKDIR}/$i ${WORKDIR}/devicetree | ||
45 | cp ${WORKDIR}/$i ${WORKDIR}/devicetree | 52 | cp ${WORKDIR}/$i ${WORKDIR}/devicetree |
46 | fi | 53 | fi |
47 | done | 54 | done |
@@ -49,15 +56,8 @@ do_compile() { | |||
49 | 56 | ||
50 | for DTS_FILE in ${DEVICETREE}; do | 57 | for DTS_FILE in ${DEVICETREE}; do |
51 | DTS_NAME=`basename -s .dts ${DTS_FILE}` | 58 | DTS_NAME=`basename -s .dts ${DTS_FILE}` |
52 | for d in ${KERNEL_DTS_INCLUDE}; do | 59 | ${BUILD_CPP} ${DEVICETREE_PP_FLAGS} -o ${DTS_FILE}.pp ${DTS_FILE} |
53 | dtc_include="${dtc_include} -i $d" | 60 | dtc -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}.dtb ${DTS_FILE}.pp |
54 | cpp_include="${cpp_include} -I${d}" | ||
55 | done | ||
56 | ${CPP} -E -nostdinc -Ulinux -I${WORKDIR}/devicetree \ | ||
57 | ${cpp_include} -x assembler-with-cpp \ | ||
58 | -o ${DTS_FILE}.pp ${DTS_FILE} | ||
59 | dtc -I dts -O dtb ${DEVICETREE_FLAGS} -i ${WORKDIR}/devicetree \ | ||
60 | ${dtc_include} -o ${DTS_NAME}.dtb ${DTS_FILE}.pp | ||
61 | done | 61 | done |
62 | } | 62 | } |
63 | 63 | ||