[PATCH] powerpc: make the padding for the device tree a configurable option

Scott Wood scottwood at freescale.com
Fri May 21 02:04:29 EST 2010


On 05/19/2010 08:18 PM, David Gibson wrote:
> On Wed, May 19, 2010 at 07:03:17PM -0500, Timur Tabi wrote:
>> On Wed, May 19, 2010 at 5:44 PM, Benjamin Herrenschmidt
>>> The padding in the kernel built is intended to
>>> make space for DT changes done by the zImage wrapper.
>>
>> Well, okay.  I think it would be nice if we expanded that to handle
>> general usage.

Don't we have dynamic expansion in the zImage wrapper?

>>> Maybe we could add to libfdt a way to provide a realloc() callback to it
>>> when it hits the max size, and uboot can then move things around (or
>>> fail).
>>
>> The problem is that the code which allocates a block for the fdt is
>> completely distinct from the code that manipulates the fdt.  We'd need
>> to put in either some kind of funky callback mechanism, or insist that
>> every fdt exist in a block of memory allocated by some specific method
>> (e.g. lmb).
>>
>> I'm stuck between a rock and a hard place, it seems.  No one is
>> willing to compromise on any of my ideas.  It's hard to convince our
>> BSP developers that they should be pushing more code upstream when I
>> get so much resistance for a such a mundane change.
>
> Couldn't you use the configurable padding, but put the stuff to do it
> into u-boot.  i.e. repad the dtb at u-boot build time, rather than
> u-boot runtime.

Currently generating a dtb is not done as part of the u-boot build 
process -- and apparently some people are using the Linux makefile 
target to do it.

I think the right thing is to do whatever we need to do in u-boot to get 
dynamic expansion fully working (it already does it in some 
circumstances, just not always, or necessarily safely).  Static padding 
is too fragile.

-Scott


More information about the devicetree-discuss mailing list