From: "Petter Mabäcker" <petter@technux.se>
To: Herve Jourdain <herve.jourdain@neuf.fr>,
francois@concept-embarque.fr, Andrei Gherzan <andrei@gherzan.ro>
Cc: yocto@yoctoproject.org
Subject: Re: [meta-raspberrypi] Adding an additional device tree overlay in the SDCard
Date: Fri, 31 Jul 2015 15:29:20 +0200 [thread overview]
Message-ID: <55BB7830.8010909@technux.se> (raw)
In-Reply-To: <086901d0ca77$9e8f1300$dbad3900$@neuf.fr>
[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]
Hi Herve,
See inline answers.
BR,
Petter
On 07/30/2015 05:27 AM, Herve Jourdain wrote:
>
> Hello,
>
> I’m trying to add a specific .dts file to the raspberrypi.
>
> Therefore, in my own layer, I have made a
> linux-raspberrypi_3.%.bbappend, that applies a patch to the
> arch/arm/boot/dts makefile to add my own layer, and a new rule that
> copies my specific .dts file to the kernel source directory.
>
> And, initially, I had also defined KERNEL_DEVICETREE +=
> “myown-overlay.dtb” in there.
>
> It definitely compiles well, installation process is smooth, I get the
> Image-myown-overlay.dtb in tmp/deploy/raspberrypi2.
>
> BUT when I flash my SDCard, it does NOT appear in the “overlays”
> directory of the DOS partition!
>
> If I add it manually, everything works fine, so I know my overlay has
> been correctly generated and is working.
>
> What I discovered is that, the sdcard_image_rpi class takes the list
> of .dtb to be considered from split_overlays(), which is defined in
> linux-raspberrypi-base class.
>
> And split_overlays() basically gets the value of KERNEL_DEVICETREE
> (dts = d.getVar("KERNEL_DEVICETREE", True)).
>
> But when I set KERNEL_DEVICETREE in linux-raspberrypi_3.%.bbappend, it
> seems the additional value it defines is NOT taken into account when
> linux-raspberry-class evaluates the value of KERNEL_DEVICETREE.
>
> I’ve checked in the create_image.rpi-sdimg script created, it does not
> appear in DTS nor DT_OVERLAYS.
>
> But when I define KERNEL_DEVICETREE in my distro.conf, THEN it is
> taken into account…
>
> My goal would be to add that overlay by NOT modifying distro.conf
> (distros are not necessarily RaspberryPi centric) nor in the raspberry
> machine files (or local.conf).
>
> This leads me to several questions:
>
> #1 Is there a specific reason why my addition to KERNEL_DEVICETREE
> gets lost when creating the image? I mean, is it normal, or are there
> some steps I missed there?
>
Yes, in the current solution KERNEL_DEVICETREE is needed in both the
kernel recipe and image creation context. When appending
KERNEL_DEVICETREE in linux-raspberrypi_3.%.bbappend your new overlay
will only be visible within the linux-raspberrypi scope and NOT within
the image class.
> #2 Is there a way that I could achieve adding my .dtb overlay in the
> sdcard image only from my linux kernel bbappend?
>
If I remember the code correct within the kernel scope we are only
interesting if device tree should be used. At least in theory (assuming
you are using a >= 3.18 kernel since then KERNEL_DEVICETREE will bve set
by default) you should be able to skip the KERNEL_DEVICETREE += code in
linux-raspberrypi_3.%.bbappend (since it will be set any way and the
overlays themselves isn't really used in here..) then append the
KERNEL_DEVICETREE within the image scope. If you don't want to put this
into the layer.conf or similiar in your own layer I guess it should work
to "prepend" for example the IMAGE_CMD. But in the current solution I
guess local.conf, layer.conf (in your own layer) or rpi-base.inc (in
meta-raspberrypi) is the easiest options..
> #3 On a more general note, wouldn’t it be simpler (better?) to just
> add all the .dtb that are found in the deploy/images/ directory to the
> DOS partition of the SDCard? After all, the .dtb need to be compiled
> from a .dts, so all the .dtb that appear in deploy/images are “legit”.
>
That might perhaps be a better solution. Have you tried it out? Andrei
or Francois might have some comments about this?
>
> Herve
>
>
>
[-- Attachment #2: Type: text/html, Size: 8730 bytes --]
next prev parent reply other threads:[~2015-07-31 13:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 3:27 [meta-raspberrypi] Adding an additional device tree overlay in the SDCard Herve Jourdain
2015-07-31 13:29 ` Petter Mabäcker [this message]
2015-07-31 15:16 ` Francois Muller
2015-08-01 1:34 ` Herve Jourdain
2015-08-01 1:22 ` Herve Jourdain
2015-08-01 21:44 ` Petter Mabäcker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55BB7830.8010909@technux.se \
--to=petter@technux.se \
--cc=andrei@gherzan.ro \
--cc=francois@concept-embarque.fr \
--cc=herve.jourdain@neuf.fr \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.