[U-Boot-Users] Testing todays u-boot-fdt

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Thu Apr 19 14:08:34 CEST 2007


Wolfgang Grandegger wrote:
> Hi Jerry,
> 
> I gave the fdtlib of your git://cideas.us/pub/scm/u-boot/u-boot-fdt.git
> a try on my Icecube board. I got it built with the attached patch. 
> libfdt was actually not made and the second hunk fixes a warning 
> (=bug?). Then I was able to read and list a blob in memory:
> 
> => fdt addr 20000
> => fdt print /
> ...
> 
> A few other things didn't work, especially updating the FDT:
> 
> => fdt addr 20000 10000
> libfdt: FDT_ERR_BADVERSION
> 
> => fdt env
> libfdt: FDT_ERR_BADVERSION
> => fdt bd_t
> libfdt: FDT_ERR_BADVERSION
> => fdt chosen
> libfdt: FDT_ERR_BADVERSION
> 
> => fdt set /memory reg "<00000000 08000000>"
> Usage:
> fdt     - flattened device tree utility commands
> 
> And "fdt mknode" seems not to be implemented.
> 
> Am I doing something wrong?
> 
> Wolfgang.

Hi Wolfgang,

Ouch, that was a bad bug and very embarrassing.  Just when you think you 
are perfect, a stupid pointer error jumps up and bits you.  :-(  I'll 
apply your patch.  Thanks & sorry.

The bad version error is because you are running a version 16 blob and 
you need a version 17 blob to allow modifications.  David Gibson has an 
intention of upconverting a v16 to v17 as part of libfdt, but neither of 
us has gotten around to doing it yet.

If you pick up the latest dtc, it compiles v17 by default now.  The 
latest dtc also implements a -S <minsize> parameter so you can make 
extra space in the blob and not need to specify the length parameter 
with the "fdt addr" command (the length parameter for addr makes the 
blob longer - unnecessary with -S blobs).  If you really want to be at 
the bleeding edge, you can apply this patch as well, but it is *not* 
necessary (the patch pads out the blob rather than leaving the extra 
space undefined):
   <http://article.gmane.org/gmane.linux.ports.ppc64.devel/18741>

See also:
<http://www.denx.de/wiki/UBoot/UBootFdtInfo>
(linked off the Custodian page).

On a related note, you will probably want a fdt_find_compatible_node() 
function added to libfdt.  I looked at the kernel one and it looks like 
it would be pretty simple to adapt it to libfdt, but I have not gotten 
to it yet.

<http://www.denx.de/wiki/view/UBoot/UBootFdtInfo#ToDo_libfdt>
    2. fdt_find_compatible_node() Ref: arch/powerpc/kernel/prom.c
           * Needed if we use fdt blobs to configure u-boot drivers

Best regards,
gvb




More information about the U-Boot mailing list