olpc ofw question

Andres Salomon dilinger at queued.net
Wed Aug 11 10:40:10 EST 2010


Hi,

I've run a comparison between OLPC's old OFW code (which mounts the
device-tree at /ofw, and makes use of the sparc code) versus the code
which I'm planning to send upstream (which mounts the device-tree
at /proc/device-tree, and makes use of PROC_DEVTREE).  The results are
here:

http://dev.queued.net/~dilinger/dt.diff

That's from running:

find /proc/device-tree -type f | sort | while read f; do echo $f | sed 's#/proc/device-tree##'; sudo od -c $f; done > ~/dt-proc
find /ofw -type f | sort | while read f; do echo $f | sed 's#/ofw##'; sudo od -c $f; done > ~/dt-ofw
diff -u dt-ofw dt-proc > dt.diff

Note that this was run on two different OLPC XO-1 machines, hence the
difference in serial numbers, mfg-data, and other such things.

There are two things I'm concerned about; the first is that device names
are mangled.  For some things (ie, "/battery at 0/name" => "/battery/name"),
I don't particularly care; for others ("/pci/audio at f,3/device-id"
=> "/pci/audio/device-id"), it's kind of annoying to lose that extra
bit of information.  What's the purpose being the mangling that
happens w/ /proc/device-tree?  I the following comment in proc_devtree.c:

 * For a node with a name like "gc at 10", we make symlinks called "gc"
 * and "@10" to it.

However, I'm not seeing *any* symlinks at all in /proc/device-tree.

My second concern is the renaming of /pci/usb at f,4 (the ohci device)
to /pci/usb.  I'm not sure if that's due to a bug in the devtree code,
OFW, or my patch.  Note that the kernel spits out the following messages
while populating /proc/device-tree:


[    0.130869] device-tree: Duplicate name in /pci, renamed to "usb#1"
[    0.131589] device-tree: Duplicate name in /, renamed to "dropin-fs#1"

I'm assuming that the code first renamed the ohci device from
/pci/usb at f,4 to /pci/usb, attempted to then rename the
wireless chip from /pci/usb at f,5 to /pci/usb, and spit out
that error.  That seems.. odd.

Any insight into the reasoning for this mangling?





More information about the devicetree-discuss mailing list