summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2011-02-09 00:45:23 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-09 11:16:34 +0000
commit970f3959d39708f3da3e5c181e645c1f9a010628 (patch)
treea0df45c8653983f3303be4d28d906832e97975e7
parent1de7185d8ee3c432ea4262d795e340b79ad9795d (diff)
downloadpoky-970f3959d39708f3da3e5c181e645c1f9a010628.tar.gz
linux: factor dts/dtc/dtb handling into a specific include
Fixes [BUGID #610] The powerpc linux-yocto kernels were not creating dtb images in the deploy directories. This was due to two problems: - the dtb generation rules were not being configured - the boards were not specifying a device tree in their config This change addresses the first point by factoring out the dtb generation routines into a new include that can be used by multiple recipes. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta/recipes-kernel/linux/linux-dtb.inc27
-rw-r--r--meta/recipes-kernel/linux/linux-yocto.inc1
-rw-r--r--meta/recipes-kernel/linux/linux.inc27
3 files changed, 29 insertions, 26 deletions
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 0000000000..0b27d18ded
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,27 @@
1# Support for device tree generation
2FILES_kernel_devicetree = "/boot/devicetree*"
3KERNEL_DEVICETREE_FLAGS = "-R 8 -p 0x3000"
4
5python __anonymous () {
6 import bb
7
8 devicetree = bb.data.getVar("KERNEL_DEVICETREE", d, 1) or ''
9 if devicetree:
10 depends = bb.data.getVar("DEPENDS", d, 1)
11 bb.data.setVar("DEPENDS", "%s dtc-native" % depends, d)
12 packages = bb.data.getVar("PACKAGES", d, 1)
13 bb.data.setVar("PACKAGES", "%s kernel-devicetree" % packages, d)
14}
15
16do_install_append() {
17 if test -n "${KERNEL_DEVICETREE}"; then
18 dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}
19 install -m 0644 devicetree ${D}/boot/devicetree-${KERNEL_VERSION}
20 install -d ${DEPLOY_DIR_IMAGE}
21 install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb
22 cd ${DEPLOY_DIR_IMAGE}
23 rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
24 ln -sf ${KERNEL_IMAGE_BASE_NAME}.dtb ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
25 fi
26}
27
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 03935fa702..0812144d46 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -18,5 +18,6 @@ addtask kernel_configme before do_configure after do_patch
18 18
19# Pick up shared functions 19# Pick up shared functions
20inherit kernel-yocto 20inherit kernel-yocto
21require linux-dtb.inc
21 22
22B = "${WORKDIR}/linux-${MACHINE}-${LINUX_KERNEL_TYPE}-build" 23B = "${WORKDIR}/linux-${MACHINE}-${LINUX_KERNEL_TYPE}-build"
diff --git a/meta/recipes-kernel/linux/linux.inc b/meta/recipes-kernel/linux/linux.inc
index 93859bb5a8..726d3d6904 100644
--- a/meta/recipes-kernel/linux/linux.inc
+++ b/meta/recipes-kernel/linux/linux.inc
@@ -3,6 +3,7 @@ SECTION = "kernel"
3LICENSE = "GPL" 3LICENSE = "GPL"
4 4
5inherit kernel 5inherit kernel
6require linux-dtb.inc
6 7
7DEPENDS_append_em-x270 = " mtd-utils " 8DEPENDS_append_em-x270 = " mtd-utils "
8 9
@@ -15,21 +16,6 @@ CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfs
15#boot from nfs 16#boot from nfs
16#CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=301 root=/dev/nfs nfsroot=172.20.3.1:/data/at91 ip=172.20.0.5:::255.255.0.0" 17#CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=301 root=/dev/nfs nfsroot=172.20.3.1:/data/at91 ip=172.20.0.5:::255.255.0.0"
17 18
18# Support for device tree generation
19FILES_kernel_devicetree = "/boot/devicetree*"
20KERNEL_DEVICETREE_FLAGS = "-R 8 -p 0x3000"
21
22python __anonymous () {
23 import bb
24
25 devicetree = bb.data.getVar("KERNEL_DEVICETREE", d, 1) or ''
26 if devicetree:
27 depends = bb.data.getVar("DEPENDS", d, 1)
28 bb.data.setVar("DEPENDS", "%s dtc-native" % depends, d)
29 packages = bb.data.getVar("PACKAGES", d, 1)
30 bb.data.setVar("PACKAGES", "%s kernel-devicetree" % packages, d)
31}
32
33do_configure_prepend() { 19do_configure_prepend() {
34 echo "" > ${S}/.config 20 echo "" > ${S}/.config
35 21
@@ -105,14 +91,3 @@ do_install_prepend() {
105 fi 91 fi
106} 92}
107 93
108do_install_append() {
109 if test -n "${KERNEL_DEVICETREE}"; then
110 dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o devicetree ${KERNEL_DEVICETREE}
111 install -m 0644 devicetree ${D}/boot/devicetree-${KERNEL_VERSION}
112 install -d ${DEPLOY_DIR_IMAGE}
113 install -m 0644 devicetree ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.dtb
114 cd ${DEPLOY_DIR_IMAGE}
115 rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
116 ln -sf ${KERNEL_IMAGE_BASE_NAME}.dtb ${KERNEL_IMAGE_SYMLINK_NAME}.dtb
117 fi
118}