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

Wolfgang Grandegger wg at grandegger.com
Sun May 20 15:05:03 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.

Then something similar to the ENV could be chosen:

   CFG_FDT_ADDR
   CFG_FDT_IS_IN_FLASH
   CFG_FDT_IS_IN_xxx
   ...

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

OK for me.

>> 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.

Well, yes, this address must be suitable for Linux and should be treated 
similar to the initial ramdisk. Therefore a proper default address seems 
sufficient.

>> 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().

Then checkfdt(). In principle, this could be done in the already 
existing board-specific checkboard function, but a dedicated function 
for verifying the FDT makes sense, I think.

Wolfgang.





More information about the U-Boot mailing list