diff options
| author | Francois Muller <francois@concept-embarque.fr> | 2015-02-07 20:54:37 +0100 |
|---|---|---|
| committer | Francois Muller <francois@concept-embarque.fr> | 2015-02-07 20:54:37 +0100 |
| commit | 2dbc974596bfc44179f0191c3fbb97d772a3ebb0 (patch) | |
| tree | 75bc4ede7acf14b9a2cc992c65493791473d43c9 | |
| parent | 4dc75cedf738989c606766c4090f27da3a7d5cfd (diff) | |
| download | meta-raspberrypi-2dbc974596bfc44179f0191c3fbb97d772a3ebb0.tar.gz | |
devicetree: Add support for DT overlays with RPi bootloader
Compile overlay device trees and put them in 'overlays/' folder
on sdcard RPi boot partition.
Change-Id: I3da0032b3c2618165008eec1fc94e97824d09099
Signed-off-by: Francois Muller <francois@concept-embarque.fr>
| -rw-r--r-- | classes/sdcard_image-rpi.bbclass | 20 | ||||
| -rw-r--r-- | conf/machine/raspberrypi.conf | 17 |
2 files changed, 31 insertions, 6 deletions
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass index 63cd62a..43f1346 100644 --- a/classes/sdcard_image-rpi.bbclass +++ b/classes/sdcard_image-rpi.bbclass | |||
| @@ -66,6 +66,11 @@ SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg" | |||
| 66 | # Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. | 66 | # Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. |
| 67 | FATPAYLOAD ?= "" | 67 | FATPAYLOAD ?= "" |
| 68 | 68 | ||
| 69 | # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' string and will be put in a dedicated folder | ||
| 70 | DT_ALL = "${@d.getVar('KERNEL_DEVICETREE', True) or ''}" | ||
| 71 | DT_OVERLAYS = "${@oe.utils.str_filter('\S+\-overlay\.dtb$', '${DT_ALL}', d)}" | ||
| 72 | DT_ROOT = "${@oe.utils.str_filter_out('\S+\-overlay\.dtb$', '${DT_ALL}', d)}" | ||
| 73 | |||
| 69 | IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}" | 74 | IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}" |
| 70 | 75 | ||
| 71 | IMAGE_CMD_rpi-sdimg () { | 76 | IMAGE_CMD_rpi-sdimg () { |
| @@ -104,15 +109,20 @@ IMAGE_CMD_rpi-sdimg () { | |||
| 104 | ;; | 109 | ;; |
| 105 | *) | 110 | *) |
| 106 | if test -n "${KERNEL_DEVICETREE}"; then | 111 | if test -n "${KERNEL_DEVICETREE}"; then |
| 107 | for DTB in ${KERNEL_DEVICETREE}; do | 112 | # Copy board device trees to root folder |
| 108 | if echo ${DTB} | grep -q '/dts/'; then | 113 | for DTB in ${DT_ROOT}; do |
| 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` | 114 | DTB_BASE_NAME=`basename ${DTB} .dtb` |
| 113 | 115 | ||
| 114 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb | 116 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb |
| 115 | done | 117 | done |
| 118 | |||
| 119 | # Copy device tree overlays to dedicated folder | ||
| 120 | mmd -i ${WORKDIR}/boot.img overlays | ||
| 121 | for DTB in ${DT_OVERLAYS}; do | ||
| 122 | DTB_BASE_NAME=`basename ${DTB} .dtb` | ||
| 123 | |||
| 124 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::overlays/${DTB_BASE_NAME}.dtb | ||
| 125 | done | ||
| 116 | fi | 126 | fi |
| 117 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::kernel.img | 127 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::kernel.img |
| 118 | ;; | 128 | ;; |
diff --git a/conf/machine/raspberrypi.conf b/conf/machine/raspberrypi.conf index 01021ca..af0907e 100644 --- a/conf/machine/raspberrypi.conf +++ b/conf/machine/raspberrypi.conf | |||
| @@ -25,7 +25,22 @@ XSERVER = " \ | |||
| 25 | KERNEL_IMAGETYPE ?= "Image" | 25 | KERNEL_IMAGETYPE ?= "Image" |
| 26 | 26 | ||
| 27 | # Really supported starting from linux-rapsberry 3.18.y only ! | 27 | # Really supported starting from linux-rapsberry 3.18.y only ! |
| 28 | #KERNEL_DEVICETREE ?= "bcm2708-rpi-b.dtb bcm2708-rpi-b-plus.dtb" | 28 | #KERNEL_DEVICETREE ?= " \ |
| 29 | # bcm2708-rpi-b.dtb \ | ||
| 30 | # bcm2708-rpi-b-plus.dtb \ | ||
| 31 | # ds1307-rtc-overlay.dtb \ | ||
| 32 | # hifiberry-amp-overlay.dtb \ | ||
| 33 | # hifiberry-dac-overlay.dtb \ | ||
| 34 | # hifiberry-dacplus-overlay.dtb \ | ||
| 35 | # hifiberry-digi-overlay.dtb \ | ||
| 36 | # iqaudio-dac-overlay.dtb \ | ||
| 37 | # iqaudio-dacplus-overlay.dtb \ | ||
| 38 | # lirc-rpi-overlay.dtb \ | ||
| 39 | # pcf8523-rtc-overlay.dtb \ | ||
| 40 | # pps-gpio-overlay.dtb \ | ||
| 41 | # w1-gpio-overlay.dtb \ | ||
| 42 | # w1-gpio-pullup-overlay.dtb \ | ||
| 43 | # " | ||
| 29 | 44 | ||
| 30 | MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" | 45 | MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" |
| 31 | 46 | ||
