From patchwork Wed Mar 7 22:42:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Mouring X-Patchwork-Id: 882850 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ni.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zxTH94bngz9sgm for ; Thu, 8 Mar 2018 09:44:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934334AbeCGWng (ORCPT ); Wed, 7 Mar 2018 17:43:36 -0500 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:41582 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754498AbeCGWnf (ORCPT ); Wed, 7 Mar 2018 17:43:35 -0500 Received: from pps.filterd (m0098780.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w27MfLkP004464; Wed, 7 Mar 2018 16:43:25 -0600 Received: from ni.com (skprod2.natinst.com [130.164.80.23]) by mx0a-00010702.pphosted.com with ESMTP id 2gjac12yt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Mar 2018 16:43:25 -0600 Received: from us-aus-exhub2.ni.corp.natinst.com (us-aus-exhub2.ni.corp.natinst.com [130.164.68.32]) by us-aus-skprod2.natinst.com (8.16.0.22/8.16.0.22) with ESMTPS id w27MhOMK001972 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 7 Mar 2018 16:43:24 -0600 Received: from us-aus-exch5.ni.corp.natinst.com (130.164.68.15) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Wed, 7 Mar 2018 16:43:24 -0600 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exch5.ni.corp.natinst.com (130.164.68.15) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Wed, 7 Mar 2018 16:43:22 -0600 Received: from ni.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Wed, 7 Mar 2018 16:43:22 -0600 Received: by ni.com (sSMTP sendmail emulation); Wed, 07 Mar 2018 16:43:23 -0600 From: Brad Mouring To: Nicolas Ferre , Rob Herring , "David S . Miller" , "Michael Grzeschik" CC: Mark Rutland , , "Julia Cartwright" , , , Brad Mouring Subject: [PATCH 1/2] net: macb: Add phy-handle DT support Date: Wed, 7 Mar 2018 16:42:56 -0600 Message-ID: <20180307224257.1959-1-brad.mouring@ni.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-07_10:, , signatures=0 X-Proofpoint-Spam-Reason: safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This optional binding (as described in the ethernet DT bindings doc) directs the netdev to the phydev to use. This is useful for a phy chip that has >1 phy in it, and two netdevs are using the same phy chip (i.e. the second mac's phy lives on the first mac's MDIO bus) The devicetree snippet would look something like this: ethernet@feedf00d { ... phy-handle = <&phy0> // the first netdev is physically wired to phy0 ... phy0: phy@0 { ... reg = <0x0> // MDIO address 0 ... } phy1: phy@1 { ... reg = <0x1> // MDIO address 1 ... } ... } ethernet@deadbeef { ... phy-handle = <&phy1> // tells the driver to use phy1 on the // first mac's mdio bus (it's wired thusly) ... } The work done to add the phy_node in the first place (dacdbb4dfc1a1: "net: macb: add fixed-link node support") will consume the device_node (if found). Signed-off-by: Brad Mouring --- drivers/net/ethernet/cadence/macb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index e84afcf1ecb5..cc5b9e6e3526 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -567,6 +567,9 @@ static int macb_mii_init(struct macb *bp) err = mdiobus_register(bp->mii_bus); } else { + /* attempt to find a phy-handle */ + bp->phy_node = of_parse_phandle(np, "phy-handle", 0); + /* try dt phy registration */ err = of_mdiobus_register(bp->mii_bus, np); From patchwork Wed Mar 7 22:42:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Mouring X-Patchwork-Id: 882845 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ni.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zxTG60jBcz9sgm for ; Thu, 8 Mar 2018 09:43:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934448AbeCGWns (ORCPT ); Wed, 7 Mar 2018 17:43:48 -0500 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:41142 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934399AbeCGWnq (ORCPT ); Wed, 7 Mar 2018 17:43:46 -0500 Received: from pps.filterd (m0098781.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w27Mf534017075; Wed, 7 Mar 2018 16:43:29 -0600 Received: from ni.com (skprod2.natinst.com [130.164.80.23]) by mx0a-00010702.pphosted.com with ESMTP id 2gjac2ayqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Mar 2018 16:43:29 -0600 Received: from us-aus-exhub1.ni.corp.natinst.com (us-aus-exhub1.ni.corp.natinst.com [130.164.68.41]) by us-aus-skprod2.natinst.com (8.16.0.22/8.16.0.22) with ESMTPS id w27MhS3n001983 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 7 Mar 2018 16:43:28 -0600 Received: from us-aus-exch7.ni.corp.natinst.com (130.164.68.17) by us-aus-exhub1.ni.corp.natinst.com (130.164.68.41) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Wed, 7 Mar 2018 16:43:28 -0600 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exch7.ni.corp.natinst.com (130.164.68.17) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Wed, 7 Mar 2018 16:43:27 -0600 Received: from ni.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Wed, 7 Mar 2018 16:43:27 -0600 Received: by ni.com (sSMTP sendmail emulation); Wed, 07 Mar 2018 16:43:27 -0600 From: Brad Mouring To: Nicolas Ferre , Rob Herring , "David S . Miller" , "Michael Grzeschik" CC: Mark Rutland , , "Julia Cartwright" , , , Brad Mouring Subject: [PATCH 2/2] Documentation: macb: Document phy-handle optional binding Date: Wed, 7 Mar 2018 16:42:57 -0600 Message-ID: <20180307224257.1959-2-brad.mouring@ni.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307224257.1959-1-brad.mouring@ni.com> References: <20180307224257.1959-1-brad.mouring@ni.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-07_10:, , signatures=0 X-Proofpoint-Spam-Reason: safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Brad Mouring --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 27966ae741e0..457d5ae16f23 100644 --- a/Documentation/devicetree/bindings/net/macb.txt +++ b/Documentation/devicetree/bindings/net/macb.txt @@ -29,6 +29,7 @@ Optional properties for PHY child node: - reset-gpios : Should specify the gpio for phy reset - magic-packet : If present, indicates that the hardware supports waking up via magic packet. +- phy-handle : see ethernet.txt file in the same directory Examples: