Subject: Re: [PATCH 06/17] Document the linux,network-index property.

From: David Gibson <[email-masked]>
Date: Sat, 24 Mar 2007 10:59:00 +1100

On Fri, Mar 23, 2007 at 12:36:58PM +0100, Segher Boessenkool wrote:
> [...flat device tree labels...]
> 
> > They're of no use at present if you compile direct to dtb.  They're
> > potentially useful, however, if you compile to asm output, because the
> > labels are transcribed into symbols within the asm.
> >
> > The idea is intended to be useful for systems where the bootloader has
> > to do some poking of the device tree, but doesn't need to change the
> > size of any properties.
> 
> Nor needs to change any device tree structure (add/remove
> properties / nodes).

Of course.

> > In that case the bootloader can do all the
> > necessary fixups on the tree without *any* understanding of the flat
> > tree structure.
> 
> Well it still needs to know property encoding...

Well, yes, but in the most likely fixup cases that's trivial:
clock-frequency properties are u32, memory address/size are u32 or
u64, mac addresses are char[6].

> > It simply links in the device tree structure, and
> > symbols within it reference all the necessary points for adjustment.
> 
> Yeah.  That would be useful if you really only need to change
> the contents of a few fixed-size properties.
> 
> It would be interesting to see if anyone actually uses this
> feature ;-)

Yes, it will.

Oh, I have been planning for ages to make it possible (if less
convenient) to use this with dtb as well as asm output, by
(optionally) generating a "map file" (possibly in the form of a .h
with #defines) alongside the dtb, giving the offsets of all the
labels.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson