From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:59230 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932274AbeCLRKh (ORCPT ); Mon, 12 Mar 2018 13:10:37 -0400 From: Brad Mouring To: Nicolas Ferre , Rob Herring , "David S . Miller" , "Michael Grzeschik" , Andrew Lunn CC: Mark Rutland , , "Julia Cartwright" , Subject: [PATCH v3 net-next 0/4] macb: Introduce phy-handle DT functionality Date: Mon, 12 Mar 2018 12:09:57 -0500 Message-ID: <20180312171001.129209-1-brad.mouring@ni.com> In-Reply-To: <20180310161718.GC29174@lunn.ch> References: <20180310161718.GC29174@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org List-ID: Consider the situation where a macb netdev is connected through a phydev that sits on a mii bus other than the one provided to this particular netdev. This situation is what this patchset aims to accomplish through the existing phy-handle optional binding. This optional binding (as described in the ethernet DT bindings doc) directs the netdev to the phydev to use. This is precisely the situation this patchset aims to solve, so it makes sense to introduce the functionality to this driver (where the physical layout discussed was encountered). 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). v2: Reorganization of mii probe/init functions, suggested by Andrew Lunn v3: Moved some of the bus init code back into init (erroneously moved to probe) some style issues, and an unintialized variable warning addressed.