[U-Boot-Users] Ideas on U-Boot configuration with FDT

Jerry Van Baren gvb.uboot at gmail.com
Sun May 20 14:39:50 CEST 2007


Wolfgang Denk wrote:
> In message <46500875.6060706 at grandegger.com> you wrote:
>> CFG_FDT_ADDR_FLASH:
>> 	If defined, "fdt" is set to that address at compile time. The
>>          FDT can be used from the early beginning of the boot.
> 
> Just nitpicking: maybe we should  call  this  CFG_FDT_ADDR_STATIC  or
> CFG_FDT_ADDR_DEFAULT  or  CFG_FDT_ADDR_INIT  or  something like that.
> Rationale: flash is just one of the  possible  storage  devies  -  it
> could be ROM instead, or even RAM in certain configurations.
> 
> Also, while we are defining this, please keep in mind that sooner or
> later someone will come up with the idea of storing the FDT in EEPROM,
> so we might want to reserve such identifiers.

Good points, I agree with them.  One possibility would be to name it 
CFG_FDT_ADDR_INIT (my 2c for name choice) and #define it to a static 
address for the typical flash storage case and #define it to be a 
function that returns an address for the read-from-EEPROM case.

>> CFG_FDT_ADDR_BY_ENV:
>> 	If defined, the env variable "fdtaddr" is looked up early in the
>>          boot and "fdt" is set accordingly. This allows to hold more than
>>          one blob in FLASH and select one via env setting. This would
>>          allow for _one_ combination of images of U-Boot + Linux + Blobs
>>          for a _set_ of boards.
> 
> Traditionally, that should be named CFG_FDT_ADDR_IN_ENV

Ditto.

>> CFG_FDT_ADDR_RAM:
>> 	If defined, the blob is moved to RAM after relocation for
>>          further preparation or for performance reasons. "fdt" is re-set
>>          accordingly. The blob is then ready and in place for booting
>>          Linux. If CFG_FDT_ADDR_RAM is set to 0, the blob will be copied
>> 	to a default location, e.g. before the initrd location.
> 
> I'm not sure I understand  this  -  will  CFG_FDT_ADDR_RAM  hold  the
> *address*  in  RAM  where  the FDT gets copied to? That sounds pretty
> static to me.

This would be used if the blob has to be copied out of flash into RAM 
(or could be part of the read-from-EEPROM usage).

I'm not sure this is necessary (echoing wd's "pretty static" reaction). 
  The board-specific code in the start up should know where a good place 
to place the RAM copy of the blob is, for instance, right after the RAM 
copy of u-boot.  Is there a case where it _must_ be a fixed address?  I 
cannot think of any.

If there is a case where it _must_ be fixed, it seems to me it would be 
so unusual a case that I would leave it up to the board supporter to 
hardcode it in the board-specific start up.

My gut feel is to not document/define a CFG_FDT_ADDR_RAM until we get 
use cases that show that it is a Good Thing[tm].

>> A board-specific checkboad function is called as early as possible to 
>> verify the FDT.
> 
> "checkboard()" is a name that can mean anything. If the  function  is
> to  check  or  to  verify the FDT, the function name should represent
> this, i. e. please  callit  checkfdt()  or  verifyfdt()  of  probably
> fdtcheck() / fdtverify() or fdt_check() / fdt_verify().

I'm somewhat skeptical about the fdt_checkboard() concept, how well it 
would work in practice.  If the blob is for the wrong board, will the 
serial work?  Sometimes yes, sometimes no.  For the times the answer is 
"yes", the ability is probably worth considering, at least.

I would like to see the verification/validation that we currently do on 
the env data to be done on the blob as well.  This is heading towards my 
assertion that the blob can take over most, perhaps all, of the duties 
of the current "env" storage.  Not all of the thoughts below are 
directly on topic since I'm expanding beyond just u-boot config.
* A CRC
* Backup copy (if selected in the board config)
* Default compiled in copy (?)
   * Likely not useful since, by definition, some parts of the fdt would
       be board specific and not detectable by the board start up code.
   * Hmm, if we had a minimal default compiled in copy, we could compare
       its values to a user-loadable version as (part of) a
       fdt_checkboard() function.

> Best regards,
> Wolfgang Denk

Ditto,
gvb





More information about the U-Boot mailing list