aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei@gherzan.ro>2015-02-07 22:14:22 +0100
committerGherzan Code Review <gerrit2@gherzan.ro>2015-02-07 22:14:22 +0100
commitb99a09b25757ea2afe15fcf31323420edca1137d (patch)
tree47ef6584304078ad81734e0863f33bb438f165cf
parent4905c7cc2b72110e5254bb0172ffccfc0f582a40 (diff)
parent2dbc974596bfc44179f0191c3fbb97d772a3ebb0 (diff)
downloadmeta-raspberrypi-b99a09b25757ea2afe15fcf31323420edca1137d.tar.gz
meta-raspberrypi-b99a09b25757ea2afe15fcf31323420edca1137d.tar.bz2
meta-raspberrypi-b99a09b25757ea2afe15fcf31323420edca1137d.zip
Merge "devicetree: Add support for DT overlays with RPi bootloader"
-rw-r--r--classes/sdcard_image-rpi.bbclass20
-rw-r--r--conf/machine/raspberrypi.conf17
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"
# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
FATPAYLOAD ?= ""
+# Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' string and will be put in a dedicated folder
+DT_ALL = "${@d.getVar('KERNEL_DEVICETREE', True) or ''}"
+DT_OVERLAYS = "${@oe.utils.str_filter('\S+\-overlay\.dtb$', '${DT_ALL}', d)}"
+DT_ROOT = "${@oe.utils.str_filter_out('\S+\-overlay\.dtb$', '${DT_ALL}', d)}"
+
IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"
IMAGE_CMD_rpi-sdimg () {
@@ -104,15 +109,20 @@ IMAGE_CMD_rpi-sdimg () {
;;
*)
if test -n "${KERNEL_DEVICETREE}"; then
- for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '/dts/'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
+ # Copy board device trees to root folder
+ for DTB in ${DT_ROOT}; do
DTB_BASE_NAME=`basename ${DTB} .dtb`
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
done
+
+ # Copy device tree overlays to dedicated folder
+ mmd -i ${WORKDIR}/boot.img overlays
+ for DTB in ${DT_OVERLAYS}; do
+ DTB_BASE_NAME=`basename ${DTB} .dtb`
+
+ mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::overlays/${DTB_BASE_NAME}.dtb
+ done
fi
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::kernel.img
;;
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 = " \
KERNEL_IMAGETYPE ?= "Image"
# Really supported starting from linux-rapsberry 3.18.y only !
-#KERNEL_DEVICETREE ?= "bcm2708-rpi-b.dtb bcm2708-rpi-b-plus.dtb"
+#KERNEL_DEVICETREE ?= " \
+# bcm2708-rpi-b.dtb \
+# bcm2708-rpi-b-plus.dtb \
+# ds1307-rtc-overlay.dtb \
+# hifiberry-amp-overlay.dtb \
+# hifiberry-dac-overlay.dtb \
+# hifiberry-dacplus-overlay.dtb \
+# hifiberry-digi-overlay.dtb \
+# iqaudio-dac-overlay.dtb \
+# iqaudio-dacplus-overlay.dtb \
+# lirc-rpi-overlay.dtb \
+# pcf8523-rtc-overlay.dtb \
+# pps-gpio-overlay.dtb \
+# w1-gpio-overlay.dtb \
+# w1-gpio-pullup-overlay.dtb \
+# "
MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"