[U-Boot-Users] [PATCH] Add a oftdump (open firmware flattened tree dump) command.

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Thu Nov 2 17:00:05 CET 2006

Grant Likely wrote:
> On 10/31/06, Jerry Van Baren <gerald.vanbaren at smiths-aerospace.com> wrote:
>> Add a oftdump (open firmware flattened tree dump) command.
>> Git repository:
>> <http://www.cideas.us/cgi-bin/gitweb.cgi?p=u-boot/u-boot-of-cmd.git;a=summary> 
>> Branch: of-cmd
>> <http://www.cideas.us/cgi-bin/gitweb.cgi?p=u-boot/u-boot-of-cmd.git;a=shortlog;h=of-cmd> 
>> Signed-off-by: Jerry Van Baren <vanbaren at cideas.com>
> Not that I have any authority on this, but I'm going to NAK it (for
> right now).  Others may disagree.
> The global statics really bother me, and I'll take a look myself if
> there is a better way.  Give me a few days.
> Cheers,
> g.

Hi Grant,

Global static is a oxymoron, they are "global" only in the ft_build.c 
file starting at ft_dump_blob() and going to the end of the file.  I 
suspect what you are concerned about is the shared aspect, which isn't a 
problem in u-boot since it is single threaded.

There are three choices:
1) "Global statics" - easiest and least memory use, but makes Good 
Engineers[tm] queasy.
2) "Duplicate" the arrays (currently 2x256, becomes 4x256) as statics 
inside the two functions - uses 2x the memory with no benefit (still 
makes Good Engineers[tm] queasy, just a different queasy).
3) More clever matching on the parameter string vs. the OF blob where 
the string is built up - I bailed out on this, but it is the best solution.

I know your type, you are just challenging me to actually do #3. ;-)

Best regards,

More information about the U-Boot mailing list