- enable BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS in raspberrypi3_defconfig
- add copy of rpi-firmware/overlays directory to boot partition in genimage-raspberrypi3.cfg
- enhance post-image.sh script to add 'dtoverlay=pi3-miniuart-bt' on request
- add BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay" in raspberrypi3_defconfig
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
"rpi-firmware/config.txt",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
+ "rpi-firmware/overlays",
"kernel-marked/zImage"
}
}
GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+case "${2}" in
+ --add-pi3-miniuart-bt-overlay)
+ if ! grep -qE '^dtoverlay=' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+ echo "Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console)."
+ cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# fixes rpi3 ttyAMA0 serial console
+dtoverlay=pi3-miniuart-bt
+__EOF__
+ fi
+ ;;
+esac
+
# Mark the kernel as DT-enabled
mkdir -p "${BINARIES_DIR}/kernel-marked"
${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \
| +-- cmdline.txt
| +-- config.txt
| +-- fixup.dat
- | `-- start.elf
+ | +-- start.elf
+ | `-- overlays/ [3]
+-- sdcard.img
`-- zImage
[2] This is the mkknlimg DT-marked kernel.
+[3] Only for the Raspberry Pi 3 Model (overlay pi3-miniuart-bt is needed
+ to enable the RPi3 serial console otherwise occupied by the bluetooth
+ chip). Alternative would be to disable the serial console in cmdline.txt
+ and /etc/inittab.
+
How to write the SD card
========================
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b"
BR2_PACKAGE_RPI_FIRMWARE=y
-# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
+BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS=y
# Required tools to create the SD image
BR2_PACKAGE_HOST_DOSFSTOOLS=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay"