summaryrefslogtreecommitdiffstats
path: root/classes
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 /classes
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 'classes')
-rw-r--r--classes/sdcard_image-rpi.bbclass23
1 files changed, 17 insertions, 6 deletions
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 71b6477..63cd62a 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -50,7 +50,7 @@ IMAGE_DEPENDS_rpi-sdimg = " \
50 dosfstools-native \ 50 dosfstools-native \
51 virtual/kernel \ 51 virtual/kernel \
52 ${IMAGE_BOOTLOADER} \ 52 ${IMAGE_BOOTLOADER} \
53 ${@base_contains("KERNEL_IMAGETYPE", "uImage", "u-boot", "",d)} \ 53 ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot', '',d)} \
54 " 54 "
55 55
56# SD card image name 56# SD card image name
@@ -99,12 +99,23 @@ IMAGE_CMD_rpi-sdimg () {
99 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ 99 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/
100 case "${KERNEL_IMAGETYPE}" in 100 case "${KERNEL_IMAGETYPE}" in
101 "uImage") 101 "uImage")
102 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.img ::kernel.img 102 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.img ::kernel.img
103 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage 103 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage
104 ;; 104 ;;
105 *) 105 *)
106 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::kernel.img 106 if test -n "${KERNEL_DEVICETREE}"; then
107 ;; 107 for DTB in ${KERNEL_DEVICETREE}; do
108 if echo ${DTB} | grep -q '/dts/'; then
109 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
110 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
111 fi
112 DTB_BASE_NAME=`basename ${DTB} .dtb`
113
114 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
115 done
116 fi
117 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::kernel.img
118 ;;
108 esac 119 esac
109 120
110 if [ -n ${FATPAYLOAD} ] ; then 121 if [ -n ${FATPAYLOAD} ] ; then