From patchwork Fri Sep 30 23:09:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 117242 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BF4BEB6F6F for ; Sat, 1 Oct 2011 09:10:09 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754446Ab1I3XKF (ORCPT ); Fri, 30 Sep 2011 19:10:05 -0400 Received: from mail3.caviumnetworks.com ([12.108.191.235]:1702 "EHLO mail3.caviumnetworks.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131Ab1I3XKD (ORCPT ); Fri, 30 Sep 2011 19:10:03 -0400 Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by mail3.caviumnetworks.com with MailMarshal (v6, 7, 2, 8378) id ; Fri, 30 Sep 2011 16:11:17 -0700 Received: from caexch01.caveonetworks.com ([192.168.16.9]) by caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 30 Sep 2011 16:10:01 -0700 Received: from dd1.caveonetworks.com ([64.2.3.195]) by caexch01.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 30 Sep 2011 16:10:00 -0700 Received: from dd1.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dd1.caveonetworks.com (8.14.4/8.14.4) with ESMTP id p8UN9nwV029285; Fri, 30 Sep 2011 16:09:49 -0700 Received: (from ddaney@localhost) by dd1.caveonetworks.com (8.14.4/8.14.4/Submit) id p8UN9jEH029284; Fri, 30 Sep 2011 16:09:45 -0700 From: David Daney 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 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 Message-Id: <1317424182-29252-1-git-send-email-david.daney@cavium.com> X-Mailer: git-send-email 1.7.2.3 X-OriginalArrivalTime: 30 Sep 2011 23:10:00.0350 (UTC) FILETIME=[140C3BE0:01CC7FC6] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 {