All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: Linux PPC Development <linuxppc-dev@ozlabs.org>
Subject: OF device mappings
Date: Sat, 28 Feb 2009 10:46:32 -0700	[thread overview]
Message-ID: <49A97878.6060308@mlbassoc.com> (raw)

Still looking for some help...  I need to be able to locate
the kernel platform_device which corresponds to an instance
from my OF tree.  Basically, I have a [somewhat] unrelated
driver which needs to know these things, so the drivers in
question should not have to be affected.

In particular, I'm working with the net/dsa drivers (Distributed
Switch Architecture) which need access to the network driver as
well as the MII/MDIO bus driver.  It doesn't make sense to tie
those drivers back to DSA, but rather let the DSA driver find
its way to them.

I've defined this in by DTS tree:
	lan1 {
		cell-index = <0x01>;
		compatible = "marvell,m88e609x";
		net_dev = "fsl-gianfar.0";
		mii_bus = "fsl-gianfar_mdio.14";
		net_devX = <&eth0>;
		mii_busX = <&mii_bus>;
	};
... two ways to find the same node.

Using 'net_dev' (which I admit is pretty hokey), I can look
up the corresponding platform device, which does work for
the DSA layer.  What I want is to be able to get to this
from the 'net_devX' pointer, but I don't seem to be able
to get out of the OF tree and into the actual platform
device tree to find the appropriate instance.

Any pointers?

Thanks

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

             reply	other threads:[~2009-02-28 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28 17:46 Gary Thomas [this message]
2009-02-28 18:04 ` OF device mappings Grant Likely
2009-02-28 18:21   ` Gary Thomas
2009-02-28 18:44     ` Grant Likely
2009-02-28 19:18       ` Gary Thomas
2009-02-28 20:19         ` Grant Likely
2009-02-28 20:25           ` Gary Thomas
2009-02-28 21:05         ` Benjamin Herrenschmidt

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=49A97878.6060308@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.