summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSipke Vriend <sipke.vriend@xilinx.com>2013-08-21 12:00:46 +1000
committerSipke Vriend <sipke.vriend@xilinx.com>2013-08-21 12:00:46 +1000
commitad5139ef91c7a1f4a32261238426f8661eb57871 (patch)
tree31d4f9a8ad6fdfcee61c0795ca4db5905564b0b7
parentb8b83bb1e60741e496b6daaa188a4b6252f06ecb (diff)
downloadmeta-xilinx-ad5139ef91c7a1f4a32261238426f8661eb57871.tar.gz
recipes-kernel: Move DTB generation to meta-xilinx
oe-core changed the DTB generation to use the linux make system. http://git.openembedded.org/openembedded-core/commit/?id=72980d5bb465f0640ed451d1ebb9c5d2a210ad0c This resulted in the kernel make failing as the meta-xilinx contained dts/dtsi files are not in the kernel tree. To resolve, move the DTB creation using DTC into meta-xilinx layer. This will correct the make error and build the DTS files in meta-xilinx. Additionally the user can set KERNEL_DEVICETREE within local.conf to build an in-kernel-tree DTS if they desire. Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
-rw-r--r--recipes-kernel/linux/linux-dtb.inc64
-rw-r--r--recipes-kernel/linux/linux-machine-common.inc2
-rw-r--r--recipes-kernel/linux/linux-machine-config.inc6
3 files changed, 68 insertions, 4 deletions
diff --git a/recipes-kernel/linux/linux-dtb.inc b/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 00000000..afd47aef
--- /dev/null
+++ b/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,64 @@
1# Support for device tree generation
2OOT_KERNEL_DEVICETREE_FLAGS ?= "-R 8 -p 0x3000"
3
4python __anonymous () {
5 oot_devicetree = d.getVar("OOT_KERNEL_DEVICETREE", True) or ''
6 if oot_devicetree:
7 depends = d.getVar("DEPENDS", True)
8 d.setVar("DEPENDS", "%s dtc-native" % depends)
9}
10
11do_install_append() {
12 if test -n "${OOT_KERNEL_DEVICETREE}"; then
13 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}; do
14 if [ ! -f ${DTS_FILE} ]; then
15 echo "Warning: ${DTS_FILE} is not available!"
16 continue
17 fi
18 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
19 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
20 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
21 dtc -I dts -O dtb ${OOT_KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
22 install -m 0644 ${DTS_BASE_NAME} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
23 done
24 fi
25}
26
27do_deploy_append() {
28 if test -n "${OOT_KERNEL_DEVICETREE}"; then
29 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}; do
30 if [ ! -f ${DTS_FILE} ]; then
31 echo "Warning: ${DTS_FILE} is not available!"
32 continue
33 fi
34 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
35 DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
36 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
37 install -d ${DEPLOYDIR}
38 install -m 0644 ${B}/${DTS_BASE_NAME} ${DEPLOYDIR}/${DTB_NAME}.dtb
39 cd ${DEPLOYDIR}
40 ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
41 cd -
42 done
43 fi
44}
45
46pkg_postinst_kernel-devicetree () {
47 cd /${KERNEL_IMAGEDEST}
48 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}
49 do
50 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
51 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
52 update-alternatives --install /${KERNEL_IMAGEDEST}/${DTS_BASE_NAME}.dtb ${DTS_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
53 done
54}
55
56pkg_postrm_kernel-devicetree () {
57 cd /${KERNEL_IMAGEDEST}
58 for DTS_FILE in ${OOT_KERNEL_DEVICETREE}
59 do
60 DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
61 DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
62 update-alternatives --remove ${DTS_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
63 done
64}
diff --git a/recipes-kernel/linux/linux-machine-common.inc b/recipes-kernel/linux/linux-machine-common.inc
index 2ef76ff9..8e31a0b9 100644
--- a/recipes-kernel/linux/linux-machine-common.inc
+++ b/recipes-kernel/linux/linux-machine-common.inc
@@ -1,4 +1,4 @@
1 1require linux-dtb.inc
2require linux-machine-config.inc 2require linux-machine-config.inc
3 3
4# MicroBlaze is a uImage target, but its not called 'uImage' 4# MicroBlaze is a uImage target, but its not called 'uImage'
diff --git a/recipes-kernel/linux/linux-machine-config.inc b/recipes-kernel/linux/linux-machine-config.inc
index 6568e4b5..f9af2abe 100644
--- a/recipes-kernel/linux/linux-machine-config.inc
+++ b/recipes-kernel/linux/linux-machine-config.inc
@@ -8,7 +8,7 @@
8# 8#
9# This will expand out to: 9# This will expand out to:
10# SRC_URI_append += "file://zc702/zc702-zynq7.dts file://common/rtc.cfg" 10# SRC_URI_append += "file://zc702/zc702-zynq7.dts file://common/rtc.cfg"
11# KERNEL_DEVICETREE ?= "${WORKDIR}/devicetree/zc702-zynq7.dts" 11# OOT_KERNEL_DEVICETREE ?= "${WORKDIR}/devicetree/zc702-zynq7.dts"
12# 12#
13# This include also adds all the 'conf/machine/boards' for all layers (that are 13# This include also adds all the 'conf/machine/boards' for all layers (that are
14# available) to the FILESEXTRAPATHS. 14# available) to the FILESEXTRAPATHS.
@@ -37,9 +37,9 @@ def get_additional_bbpath_filespath(path, d):
37 return ":".join(board_extrapaths) + ":" 37 return ":".join(board_extrapaths) + ":"
38 return "" 38 return ""
39 39
40# If KERNEL_DEVICETREE is not set, default to the device tree's provided by 40# If OOT_KERNEL_DEVICETREE is not set, default to the device tree's provided by
41# MACHINE_DEVICETREE 41# MACHINE_DEVICETREE
42KERNEL_DEVICETREE ?= "${@get_all_devicetrees(d)}" 42OOT_KERNEL_DEVICETREE ?= "${@get_all_devicetrees(d)}"
43 43
44# Appends the '<layer>/conf/machine/boards' path to FILESEXTRAPATHS for all 44# Appends the '<layer>/conf/machine/boards' path to FILESEXTRAPATHS for all
45# layers (using the ${BBPATH}) 45# layers (using the ${BBPATH})