summaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
authorFrancois Muller <francois@concept-embarque.fr>2015-02-05 14:07:00 +0100
committerFrancois Muller <francois@concept-embarque.fr>2015-02-05 14:07:00 +0100
commit4dc75cedf738989c606766c4090f27da3a7d5cfd (patch)
tree77f1fc0fb7230c7b2f352ef7544ca4b6418dcbf2 /recipes-kernel
parent327c0c12b5f56bbd442863931cca757a08db203f (diff)
downloadmeta-raspberrypi-4dc75cedf738989c606766c4090f27da3a7d5cfd.tar.gz
devicetree: Add minimal support with RPi bootloader
[RPi DT info] https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md#part-3-using-device-trees-on-raspberry-pi RPi bootloader detects a DT-ready kernel by checking for a specific trailer in kernel.img. Using latest raspberrypi/firmware (firmware.inc) enables this check ability. Using latest raspberrypi/tools (rpi-mkimage.bb) gives access to mkknlimg for adding the required trailer to kernel image. If KERNEL_DEVICETREE is filled in, the trailer is added to the kernel image before kernel install task. While creating the SDCard image, this modified kernel is put on boot partition (as kernel.img) as well as DeviceTree blobs (.dtb files). If KERNEL_DEVICETREE is empty, this new process isn't operated, legacy one does. KERNEL_DEVICETREE for RPi is really supported only starting from linux-rapsberry 3.18+ kernels, so as for now it defaults to empty (in machine config file). Change-Id: Ifea71bbda729b8f3c47be7ba0ba03be5ad2ceeaa Signed-off-by: Francois Muller <francois@concept-embarque.fr>
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-raspberrypi.inc24
-rw-r--r--recipes-kernel/linux/linux-raspberrypi_3.18.5.bb5
2 files changed, 29 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc
index 4145b1a..ff0c5ce 100644
--- a/recipes-kernel/linux/linux-raspberrypi.inc
+++ b/recipes-kernel/linux/linux-raspberrypi.inc
@@ -21,6 +21,20 @@ CMDLINE_raspberrypi = "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA
21 21
22UDEV_GE_141 ?= "1" 22UDEV_GE_141 ?= "1"
23 23
24# Set programmatically some variables during recipe parsing
25# See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
26python __anonymous () {
27 kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
28 kerneldt = d.getVar('KERNEL_DEVICETREE', True)
29
30 # Add dependency to 'rpi-mkimage-native' package only if RPi bootloader is used with DT-enable kernel
31 if kerneldt:
32 if kerneltype != 'uImage' and len(kerneldt.strip()) > 1:
33 depends = d.getVar("DEPENDS", True)
34 depends = "%s rpi-mkimage-native" % depends
35 d.setVar("DEPENDS", depends)
36}
37
24do_kernel_configme_prepend() { 38do_kernel_configme_prepend() {
25 install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available." 39 install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
26} 40}
@@ -34,3 +48,13 @@ do_deploy_append() {
34 install -d ${DEPLOYDIR}/bcm2835-bootfiles 48 install -d ${DEPLOYDIR}/bcm2835-bootfiles
35 echo "${CMDLINE}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt 49 echo "${CMDLINE}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
36} 50}
51
52do_rpiboot_mkimage() {
53 if test "x${KERNEL_IMAGETYPE}" != "xuImage" ; then
54 if test -n "${KERNEL_DEVICETREE}"; then
55 # Add RPi bootloader trailer to kernel image to enable DeviceTree support
56 ${STAGING_DIR_NATIVE}/usr/lib/rpi-mkimage/mkknlimg --dtok ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}
57 fi
58 fi
59}
60addtask rpiboot_mkimage before do_install after do_compile
diff --git a/recipes-kernel/linux/linux-raspberrypi_3.18.5.bb b/recipes-kernel/linux/linux-raspberrypi_3.18.5.bb
new file mode 100644
index 0000000..663522e
--- /dev/null
+++ b/recipes-kernel/linux/linux-raspberrypi_3.18.5.bb
@@ -0,0 +1,5 @@
1SRCREV = "a6cf3c99bc89e2c010c2f78fbf9e3ed478ccfd46"
2SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y \
3 file://sl030raspberrypii2ckernel.patch \
4 "
5require linux-raspberrypi.inc