All of lore.kernel.org
 help / color / mirror / Atom feed
* add kernel modules & dtbo's for Raspberry Pi3
@ 2017-12-20 23:40 Greg Wilson-Lindberg
  2017-12-21 12:30 ` Trevor Woerner
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Wilson-Lindberg @ 2017-12-20 23:40 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

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.


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


Regards,

Greg

[-- Attachment #2: Type: text/html, Size: 1483 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: add kernel modules & dtbo's for Raspberry Pi3
  2017-12-20 23:40 add kernel modules & dtbo's for Raspberry Pi3 Greg Wilson-Lindberg
@ 2017-12-21 12:30 ` Trevor Woerner
  2017-12-22  0:07   ` Greg Wilson-Lindberg
  0 siblings, 1 reply; 3+ messages in thread
From: Trevor Woerner @ 2017-12-21 12:30 UTC (permalink / raw)
  To: Greg Wilson-Lindberg; +Cc: yocto

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"
		}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: add kernel modules & dtbo's for Raspberry Pi3
  2017-12-21 12:30 ` Trevor Woerner
@ 2017-12-22  0:07   ` Greg Wilson-Lindberg
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Wilson-Lindberg @ 2017-12-22  0:07 UTC (permalink / raw)
  To: Trevor Woerner; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 3090 bytes --]

Hi Trevor,

Other than the fact that I was using '()' instead of '{}' for the file name, your catch of the missing ':' got the file include fixed. And your suggestion for including the Device Tree Overlays was perfect. Thanks,


I seem to have something still messed up in the kernel configs though, it looks like my file is getting included, or at least the path is not blowing up, but the config elements are not being set.


Here is my Scribe.cfg file:

# Enable MAX9768
CONFIG_SND_SOC_MAX9768=m

# Enable MAX11606
CONFIG_MAX1363=m


The 'CONFIG_SND_SOC_MAX9768' is not showing up at all in the .config file, and the 'CONFIG_MAX1363' is not set. They both are found in the appropriate Kconfig files.


Is there something else that I'm missing?


Regards,

Greg

________________________________
From: Trevor Woerner <twoerner@gmail.com>
Sent: Thursday, December 21, 2017 4:30:20 AM
To: Greg Wilson-Lindberg
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] add kernel modules & dtbo's for Raspberry Pi3

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"
                }

[-- Attachment #2: Type: text/html, Size: 5047 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-22  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20 23:40 add kernel modules & dtbo's for Raspberry Pi3 Greg Wilson-Lindberg
2017-12-21 12:30 ` Trevor Woerner
2017-12-22  0:07   ` Greg Wilson-Lindberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.