[U-Boot-Users] [PATCH] fdt: add fdtcmd env var to allow post processing of device tree before boot

Kumar Gala galak at kernel.crashing.org
Mon Aug 4 22:50:53 CEST 2008


On Aug 4, 2008, at 3:27 PM, Wolfgang Denk wrote:

> In message  
> <A9365AF6-497C-403B-8580-2E8B9BCD20C3 at kernel.crashing.org> you wrote:
>>
>>>> Added the 'fdtcmd' environment variable as a way to provide 'fdt'
>>>> commands
>>>> that the user can supply to manipulate the device tree after
>>>> ft_board_setup()
>>>> and before the tree is handled to the kernel.
>>>
>>> Where exactly is the needed, i. e. which spoecific situation  do   
>>> you
>>> have  in  mind  where  this function cannot be implemented as part  
>>> of
>>> either a "preboot" or a standard "bootcmd" command sequence?
>>
>> The situation is if we are fixing up or adding properties or nodes  
>> via
>> the ft_board_setup() how do I go about modifying that before the
>> device tree is handed to the kernel.
>>
>> An example would be if we start adding the i2c node via code in u- 
>> boot
>> and after we have done that we want to add a frequency property at
>> runtime w/o changing the u-boot code.
>
> So just run the needed commands before you run "bootm" as part of your
> boot command sequence.


This doesnt work.  Lets say I want to remove a node or property that  
ft_board_setup() adds.  If I do what you are suggesting the node or  
prop will get added back:

fdt addr <FOO>
fdt boardsetup (we assume this adds /bar/prop)
fdt rm /bar/prop
bootm (will call ft_board_setup and add /bar/prop back)

This assumes I know the best location for the device tree before  
"bootm" which I'd argue isn't really true.  Especially if my dtb is in  
flash.

- k




More information about the U-Boot mailing list