[yocto] add kernel modules & dtbo's for Raspberry Pi3

Trevor Woerner twoerner at gmail.com
Thu Dec 21 04:30:20 PST 2017


On Wed 2017-12-20 @ 11:40:50 PM, Greg Wilson-Lindberg wrote:
> I'm building an image for the Raspberry Pi 3 and I'm trying to add some
> modules to the kernel and I need to add some device tree overlays. The
> modules and overlays are part of the kernel, just not built by default.
> 
> For the kernel modules I've added a linux-raspberrypi_4.4.bbappend file in
> the path .../recipes-bsp/linux. The file consists of:
> 
> # Scribe additions to Kernel configuration
> 
> FILESEXTRAPATHS_prepend += "$(THISDIR)/files"
> SRC_URI += "file://Scribe.cfg"
> 
> Whether I use "+=" or ":=" as suggested in "Embedded Linux Systems withe
> the Yocto Project", I get an error that "file://0001-fix-dtbo-rules.patch"
> cannot be found. I don't get this error if my .bbappend file is not being
> used.

You're missing a colon at the end of the path definition, and you should use
the ':=' operator:

	FILESEXTRAPATHS_prepend := "$(THISDIR)/files:"

The path you're introducing is getting added to a bunch of other paths, and
therefore needs the separator. The := operator causes your change to this
variable to be immediately expanded by bitbake, which is what you want.

> Also, if there are any quick tips on how to add dtbo's to the kernel build I
> would appreciate them.

If you look through the raspberry pi kernel sources
	($TMPDIR/work/raspberrypi3-*/linux-raspberrypi/${VERSION}/linux-raspberrypi3-standard-build/source)
at
	arch/arm/boot/dts/overlays

and find an overlay you like (e.g. spi1-3cs-overlay.dts) then to have it added
to your image and applied at boot time:

1. edit local.conf to add it to the kernel's device tree (but add it as a dtbo
without the "-overlay"):

	KERNEL_DEVICETREE_append = " overlays/spi1-3cs.dtbo"

2. extend rpi-config to include it in the image's config.txt file:

	rpi-config_%.bbappend:
		do_deploy_append() {
			echo "dtoverlay=spi1-3cs" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt"
		}



More information about the yocto mailing list