[PATCH 03/17] bootwrapper: Add xlate_reg(), and use it to find serial registers.

Scott Wood scottwood at freescale.com
Wed Mar 21 03:34:22 EST 2007


On Tue, Mar 20, 2007 at 02:50:05PM +1100, David Gibson wrote:
> On Fri, Mar 16, 2007 at 12:27:57PM -0500, Scott Wood wrote:
> > xlate_reg() uses the ranges properties of a node's parentage to find the
> > absolute physical address of the node's registers.
> > 
> > The ns16550 driver uses this when no virtual-reg property is found.
> 
> This is a pretty large chunk of code for use on just some platforms.

It'd be useful on most flatdevicetree platforms that don't have
physical addresses larger than virtual addresses...

> Remind me why we can't just insist on the presence of virtual-reg?

We can, if that's what the general consensus is... but I'd prefer not to.

For one thing, it impairs mobility of the SOC register block -- the
knowledge of where the SOC is mapped would be contained both in the SOC
node and in the serial nodes (and have to be updated both places).  This
could be a bit of a pain if macros and/or overlays are implemented.

And I don't really understand complaining about the wastage for platforms
that don't need it in this specific case, when it happens in many others:
flatdevtree code with true OF, command line editing when it can be edited
just fine in the bootloader, simple_alloc with true OF, gzip code when
not compressing vmlinux, etc.  Not to mention the duplication of device
tree manipulation code that could have been shared with the kernel if
this stuff weren't forced into the wrapper (why is OF allowed to have a
special prom_init, but nothing else?).

If we really want to optimize for size, the approach of including
everything except small bits of code for specific other platforms
probably isn't the best one.  Does anyone actually do the
wrap-kernels-separate-from-building thing?

-Scott



More information about the Linuxppc-dev mailing list