From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings Date: Fri, 5 Apr 2013 12:04:43 -0600 Message-ID: <20130405180443.GE3598@obsidianresearch.com> References: <1365071235-11611-1-git-send-email-florian@openwrt.org> <1365071235-11611-2-git-send-email-florian@openwrt.org> <20130404212906.GA25904@schnuecks.de> <515E9FE0.8050402@openwrt.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Sebastian Hesselbarth Cc: thomas.petazzoni@free-electrons.com, moinejf@free.fr, Simon Baatz , andrew@lunn.ch, netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com, davem@davemloft.net, grant.likely@secretlab.ca, jogo@openwrt.org, buytenh@wantstofly.org, jm@lentin.co.uk, Florian Fainelli , linux-arm-kernel@lists.infradead.org, jason@lakedaemon.net List-Id: devicetree@vger.kernel.org On Fri, Apr 05, 2013 at 03:58:03PM +0200, Sebastian Hesselbarth wrote: > I don't think that the ethernet controller should probe the PHY's on mdio-bus > at all. At least not for DT enabled platforms. I had a look at DT and non-DT > mdio-bus sources, and realized that there is a bus scan for non-DT only. > of_mdiobus_register requires you to set (and know) the PHY address. DT platforms should have the option to use the standard phy-phandle connection: mdio@72004 { #address-cells = <1>; #size-cells = <0>; compatible = "marvell,orion-mdio"; reg = <0x72004 0x84>; status = "disabled"; + PHY1: ethernet-phy@1 { + reg = <1>; + device_type = "ethernet-phy"; + }; }; ethernet-group@72000 { #address-cells = <1>; #size-cells = <0>; compatible = "marvell,mv643xx-eth-block"; reg = <0x72000 0x4000>; tx-csum-limit = <1600>; status = "disabled"; egiga0: ethernet@0 { device_type = "network"; compatible = "marvell,mv643xx-eth"; reg = <0>; interrupts = <29>; clocks = <&gate_clk 2>; + phy-handle = <&PHY1>; }; }; When phy-handle is present the ethernet driver should not probe/scan for phys. There is standard code to handle all of this - an important gain is that the phy driver now has access to a DT node and can apply phy-specific properties. > We had a similar discussion whether to probe or not for DT nodes, > and I guess there also will be some discussion about the above > patch. OTOH we could just (again) ask users of every > kirkwood/orion5x/dove board to tell their phy addresses and fail to > probe the phy for new boards... Maybe print a warning and call the no-DT phy probe code if phy-handle is nor present? Not sure this should be in the common code, phy probing is sketchy, it shouldn't be encouraged, IMHO.. Jason