From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Subject: [RFC] making phandle's mandatory for of_platform_device
Date: Tue, 21 Nov 2006 17:33:47 +1100 [thread overview]
Message-ID: <1164090827.5597.14.camel@localhost.localdomain> (raw)
Hi Folks !
I'd like to start a discussion about possibly making phandle's mandatory
to use the new facility to automatically create of_platform_device's
from the device-tree...
The problem I'm having is to makeup the "bus_id" name of the
of_platform_device's. sysfs forces us to use unique names for a given
bus type here since links in /sys/bus/<bus_type/ are all at the same
level.
Right now, I'm making something up based on the "reg" or "dcr-reg"
property and device name, though because of the risk of collision, I
also had to add a bogo counter for nodes with no "reg" nor "dcr-reg" and
I had to fully translate those addresses as well to make them as unique
as possible. It's fairly hairy and with 64 bits platforms, the address
is getting pretty big for the little space we have for bus-id thus
leaving not much room for the name...
When porting some of our OF stuff to sparc64, Dave Miller used a
different approach which is to use instead the phandle, which is
guaranteed to be at most 8 characters (32 bits hex number).
That would be a good option for us as well... if we didn't make
phandle's optional with the flat device-tree definition...
Thus I'm asking wether it would be ok with you guys to make it mandatory
again under some circumstances. There are several options there:
1 - Stick to my current hairy stuff and plaster on possible new
problems popping up with it, and live with the uglyness on 64 bits
platforms
2 - Make it mandatory for all nodes to have a phandle (all of them)
3 - Make it mandatory for nodes that can be declared as
of_platform_device to have a phandle
4 - Make it mandatory for nodes that can be declared as any child of
of_device to have a phandle (and use a consistent naming accross all
childs of of_device, like macio_device, of_platform_device, etc...)
5 - Make it mandatory for nodes using the new automatic generation of
of_platform_devices from the device-tree to have phandles.
Option 5 is the less invasive since nobody uses my new mecanism yet
except IBM Cell blades and they have a real OF, thus phandles for all
nodes.
Option 2 is the most invasive and would require current platforms to
change their trees
Option 4 sounds like the cleanest "in between" option to me though it
will need some changes to some code like the macio device stuff.
Comments ?
In any case, I can simply make the code refuse to register the
of_platform_device (ignore it) if the phandle is not there.
Cheers,
Ben.
next reply other threads:[~2006-11-21 6:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-21 6:33 Benjamin Herrenschmidt [this message]
2006-11-21 10:17 ` [RFC] making phandle's mandatory for of_platform_device Segher Boessenkool
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1164090827.5597.14.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).