From: David Daney <david.daney@cavium.com>
To: devicetree-discuss@lists.ozlabs.org, grant.likely@secretlab.ca,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net
Cc: David Daney <david.daney@cavium.com>
Subject: [RFD PATCH] netdev/phy/of: Augment device tree bindings for PHYs to specify IEEE802.3-2005 Section 45 addressing.
Date: Fri, 30 Sep 2011 16:09:42 -0700 [thread overview]
Message-ID: <1317424182-29252-1-git-send-email-david.daney@cavium.com> (raw)
Many 10 gigabit Ethernet PHY devices are interfaced to the MDIO bus
using a protocol called IEEE802.3-2005 Section 45. Where as PHYS for
1G, 100M and 10M usually use IEEE802.3-2005 Section 22. These two
protocols can be present on the same MDIO bus.
If we look at the Linux PHY probing code in drivers/of/of_mdio.c and
drivers/net/phy/phy_device.c, we have the situation where we need to
read the PHY registers to get the PHY ID out so that we can use this
to bind to a compatible driver. However we can only read these
registers if we know the proper MDIO bus protocol to use.
My idea is as follows:
o Add an optional property "mdio-clause-45" to the PHY's device tree
node to indicate that clause 45 addressing is used.
o When calling get_phy_id() we will set MII_ADDR_C45 in the address
if we know that clause 45 addressing is required for the PHY.
get_phy_id() will then use the proper bus protocol and register
numbers to read PHY ID based on MII_ADDR_C45.
o of_mdiobus_register() will signal MII_ADDR_C45 for PHYs tagged with
"mdio-clause-45"
o Existing PHYs without "mdio-clause-45" are unaffected.
o If no specific driver for the probed PHY ID is present, we can still
communicate with the PHY and perhaps use a generic 10G phy driver.
If the MDIO bus protocol were just to depend on the "compatible"
property, then we could not use generic drivers for unknown PHY IDs
Comments/other ideas welcome.
Thanks,
Signed-off-by: David Daney <david.daney@cavium.com>
---
Documentation/devicetree/bindings/net/phy.txt | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/phy.txt b/Documentation/devicetree/bindings/net/phy.txt
index bb8c742..69fd948 100644
--- a/Documentation/devicetree/bindings/net/phy.txt
+++ b/Documentation/devicetree/bindings/net/phy.txt
@@ -14,6 +14,11 @@ Required properties:
- linux,phandle : phandle for this node; likely referenced by an
ethernet controller node.
+Optional properties:
+
+ - mdio-clause-45 : Optional. If present, IEEE802.3-2005 Section 45
+ protocol is used for register access (usually for 10G PHYs).
+
Example:
ethernet-phy@0 {
--
1.7.2.3
next reply other threads:[~2011-09-30 23:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 23:09 David Daney [this message]
[not found] ` <1317424182-29252-1-git-send-email-david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2011-10-02 2:59 ` [RFD PATCH] netdev/phy/of: Augment device tree bindings for PHYs to specify IEEE802.3-2005 Section 45 addressing Andy Fleming
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=1317424182-29252-1-git-send-email-david.daney@cavium.com \
--to=david.daney@cavium.com \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).