[RFC] [PATCH] Device Tree on ARM platform

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri May 29 19:08:00 EST 2009


On Fri, 2009-05-29 at 09:52 +0200, Sascha Hauer wrote:
> 
> I don't mean bloated in terms of kbytes but bloated in terms of complex
> code used to parse the device tree. I more than once put information in
> the device tree and wondered where this information got lost on the way
> to the driver where I wanted to use it. Back on ARM I was very happy to
> just have a simple board file which is easier for me to understand and
> maintain.
> Of course this can be solved with /me learning more about the device
> tree, that's why I said 'for my taste'.

Well, the code to walk it is trivial since once 'expanded' we reproduce
the tree structure with pointers.

Now, the problem indeed is how do you get to your node from a driver,
and that's where we are making things easy on powerpc by sticking the
node pointer in the struct device itself.

Of course that needs to be populated properly. We have code in PCI to do
it that would need to be ported over for PCI stuff (but I recommend
waiting a bit as this code is currently different on ppc32 and ppc64, a
bit messy, and Kumar is currently working on cleaning that up and
unifying it), and when device are discovered and instanciated from the
DT in the first place, then this is naturally populated.

So I don't think this is a big issue, and the amount of code involved is
relatively small and self contained.

Cheers,
Ben.





More information about the devicetree-discuss mailing list