[U-Boot-Users] Update on the fdt command

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Wed Mar 21 16:15:14 CET 2007


Wolfgang Denk wrote:
> Hi,
> 
> in message <46013C58.2040300 at smiths-aerospace.com> you wrote:
>> I'm getting close to having a functional "fdt" command.  For a sneak 
>> peek you can look here:
>> <http://www.cideas.us/cgi-bin/gitweb.cgi?p=u-boot/u-boot-mpc83xx;a=summary>
>>
>> The new fdt command can be found here:
>> <http://www.cideas.us/cgi-bin/gitweb.cgi?p=u-boot/u-boot-mpc83xx;a=blob;f=common/cmd_fdt.c;h=8cce35b137f4214a2c6cbab026460b54d72bb6e0;hb=HEAD>
>> (see line 777 ff. to see the subcommand list).  Please critique my 
>> subcommands - it will hurt my feelings, but I'll get over it.
> 
> Looks fine to me, but I cannot understand this part:
> 
>  786         "fdt rm     <path> <prop>           - Delete <property>\n"
>  787         "fdt rm     <path> <node>           - Delete the node *NOTE THE SPACE*\n"
> 
> NOTE THE SPACE? Which one? And where is the difference?

The space between <path> and <node>... everywhere else, <path> includes 
the last node and a space delimits the <property>.  I propose this to 
make parsing easier: I would not have to find the last "/" to find the 
node that was intended to be deleted.  The alternative is:
"fdt rm     <path> <prop>     - Delete <property>\n"
"fdt rm     <path>            - Delete the last node in <path>\n"

I have not implemented the rm command yet, so I'm flexible.  It also 
means I have not tried it in real life... I wouldn't be surprised if I 
find the extra space between <path> and <node> is so annoying that it is 
worth finding the last '/' (which really isn't that difficult to parse).

The advantage of specifying "<path> <node>" as I see it is that it is 
harder to screw up and delete major parts of the tree inadvertently
   rm /cpus      # poof, all gone!
when you really meant to do
   rm /cpus PowerPC,8560 at 0
Either way, I would not allow the deletion of the root node.  For the 
<path>-only version
   rm /
is valid syntax but would be a problem - would have to test for this as 
a special case.  For the <path> <node>, this becomes invalid syntax and 
would not be permitted.  (Note that, either way, you can delete all the 
subnodes of the root '/' individually.  Deleting the subnodes makes 
sense, deleting the root node itself does not.)

>> My proposal to Wolfgang is that denx.de create a repository for my 
>> changes so I can submit them and ultimately he can pull the changes into 
>> the master repo.  The changes to add David Gibson's libfdt to the source 
> 
> Is the name u-boot-fdt ok? Can you please send me your public SSH key?

u-boot-fdt is great.  I'll send you my key.

> Best regards,
> 
> Wolfgang Denk

Thanks,
gvb




More information about the U-Boot mailing list