Device tree flattening code not copying properties from blob

Grant Likely grant.likely at secretlab.ca
Sun Jun 16 05:46:02 EST 2013


On Sat, Jun 15, 2013 at 7:59 PM, Walter Goossens <waltergoossens at home.nl> wrote:
> On 06/15/13 15:14, Grant Likely wrote:
>> My first recommendation would be the way it is described in
>> Documentation/arm/Booting and Documentation/devicetree/booting-without-of.txt,
>> by which I mean passing the dtb into the kernel from the bootloader.
>> This is the preferred approach on both PowerPC and ARM, but I do
>> undertstand that doesn't work in all situations; such as if there is no
>> bootloader.
>
> Nios2 also supports passing a devicetree through u-boot if I'm not mistaken.

Okay, good. I'm glad to hear it.

>> The second choice is to attach it to the kernel image as a
>> post-processing step. On ARM that is enabled by CONFIG_ARM_APPENDED_DTB
>> which makes it possible to merely dd the DTB onto the end of the kernel
>> image. PowerPC uses a slighly different approach where a script takes
>> care of linking the DTB into the bootwrapper. See the
>> arch/powerpc/boot/wrapper script for details.
>
> dd-ing the dtb onto the end sounds nice.

:-)

>> Either way, I don't think it is a good architectural decision to link
>> the dtb directly into the kernel proper because doing so precludes ever
>> having a single kernel image bootable on multiple platforms. On an FPGA
>> platform it is particularly useful not having to rebuild the kernel
>> every time the FPGA design changes.
>
> Yes I know, it's just one of the supported ways of passing the
> devicetree. It's just easier to explain to new users who might not have
> much experience with linux/uboot.
> Thanks for all the advice!

It's /sort of/ supported. That mechanism isn't intended to be the
primary way of getting a dtb into the kernel. If it is used, the
assumption is that the kernel may have multiple DTBs to choose from,
and once it chooses the correct dtb, it copies it into safe memory
before all the __init sections get discarded.

As an aside, I'm also plan to use that facility as part of the DT
selftest code so that it can load an overlay of testcase data at
runtime, and then discard it again at init section removal.

g.


More information about the devicetree-discuss mailing list