[RFC] Flat Device Tree Spec

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Aug 16 17:49:00 EST 2005


On Tue, 2005-08-16 at 17:44 +1000, Michael Ellerman wrote:
> Hi guys,
> 
> The latest device tree spec (1) says that the header, reserve map, flat tree 
> and strings should be contiguous in memory (2), although it does mention that 
> the order is not important.
> 
> From looking at the unflattening code though, the requirements are actually 
> not so strict. AFAICT there's no reason the pieces (3) need to be contiguous 
> at all, as long as the header is first and the offsets to the pieces fit in a 
> u32.
> 
> Is there any reason why the spec needs to be so strict?

I wanted to be able to move the entire blob around... though I don't
have a strict real life case of needing to do that, it made sense to
keep the whole thing nicely self contained.

> If we added a size_reserve_map and size_dt_struct, to match size_dt_strings, 
> we'd have enough information to not care whether the pieces were contiguous 
> or not.
> 
> The reason I'm interested is that I've changed the iSeries code to put all 
> property strings in a special linker section. We then simply copy that 
> section into the flat device tree. If the pieces didn't have to be contiguous 
> then we could just point the off_dt_strings at the actual linker section, and 
> not need to do a copy at all.

Well, the offset is 32 bits, so how do you manage if you strings block
is below your blob or too far away ?

Ben.





More information about the Linuxppc64-dev mailing list