Re: [PATCH] Open Firmware device tree virtual filesystem

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Benjamin Herrenschmidt
Date: Monday, January 1, 2007 - 9:02 pm

On Sun, 2006-12-31 at 19:37 -0800, David Kahn wrote:

The main problem with the current powerpc interface to the device-tree
(though as I said earlier, it's very handy for drivers) is that
get_property() doesn't take a buffer pointer. Thus, it's not very
suitable for an interface that involves calling into OF to retreive the
properties. It's really an interface designed around the idea that the
tree is in kernel memory, and the lifetime of the properties is tied to
the lifetime of the node.
 

They should be. The problem is buggy OF implementations. For example,
both IBM and Apple OFs have the nasty habit of having under the CPU
nodes an "l2-cache" node with no unit-address -and- a property with the
same name (which contains just a phandle to that l2-cache node btw). 
There are other examples too (some pmacs have a duplicate i2c bus with
some one of the copies containing only a subset of the devices)

In general, we don't fabricate the @unit-address part, we use OF's own
package-to-path (unlike sparc which I think doesn't always have that
method), and thus we have to deal with implementations that return no
unit-address or duplicate names.


Well, it happens to be the case though. The code is to work around that.
A normal bug-free tree should never trigger the workarounds.

Ben.


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Open Firmware device tree virtual filesystem, Benjamin Herrenschmidt, (Mon Jan 1, 9:02 pm)
Re: [PATCH] Open Firmware device tree virtual filesystem, Segher Boessenkool, (Tue Jan 2, 5:28 am)