[U-Boot] [RFC PATCH v2 2/6] fdt: Add support for embedded device tree (CONFIG_OF_EMBED)

Simon Glass
2011-09-14T20:32:43Z

On Wed, Sep 14, 2011 at 1:11 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Grant Likely,
>
> In message <20110914164528.GM3134@ponder.secretlab.ca> you wrote:
>>
>> May I suggest an alternate approach? ?Rather than hard linking the dtb
>> into the u-boot image, this would be so much more useful if the dtb
>> can be concatenated to the u-boot binary so that it can be configured
>> at install time. ?Otherwise, switching to .dtb doesn't seem to
>
> Actually the DTB address should _always_ be taken from an environment
> variable, so we have full flexibility.

Hi Wolfgang,

That is not implemented in my RFC patch but is easy enough to do. The
fdt is available very early (in board_init_f) so that it can handle
the console UART. At that point we have access to the default
environment only.

Perhaps the behaviour you refer to should be called
CONFIG_OF_ENVIRONMENT and be the default? If people want Grant's
option then they can set CONFIG_OF_SEPARATE and it will be
concatenated with U-Boot.

One reason for CONFIG_OF_SEPARATE is that some SOCs are going to
prefer the fdt to be loaded by the SOC boot ROM. For example, on
Tegra, the boot ROM loads U-Boot into SDRAM. If the fdt is somewhere
else in the flash, then U-Boot will need to load it after starting up
since the boot ROM can't find it. But that means that it is not
available very early. For example, if it is in SPI flash then the fdt
is not available until after relocation, and so you can't use the
serial console until then. Of course we could start with built-in
default fdt and move to the loaded one later, but that's not very
nice.

It also ties into the build system - e.g. does the U-Boot makefile do
the work for you, or do you need to take u-boot.bin and munge it
yourself (or flash u-boot.bin and u-boot.dtb into separate places...)

I have thought quite a bit about these issues in creating this RFC,
and these are the sorts of things we need to get right for run-time
config to work nicely.

Regards,
Simon

>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> In the beginning there was nothing.
> And the Lord said "Let There Be Light!"
> And still there was nothing, but at least now you could see it.
>