From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Graute Subject: Re: fec driver and two micrel phys Date: Wed, 29 Nov 2017 10:08:22 +0100 Message-ID: <20171129090822.GD32345@graute-opti> References: <20171128152815.GB32345@graute-opti> <20171128160906.GD14512@lunn.ch> <20171129072949.GC32345@graute-opti> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f54.google.com ([74.125.82.54]:40272 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753686AbdK2JJF (ORCPT ); Wed, 29 Nov 2017 04:09:05 -0500 Received: by mail-wm0-f54.google.com with SMTP id v19so4378325wmh.5 for ; Wed, 29 Nov 2017 01:09:04 -0800 (PST) Received: from localhost (x4e365d2d.dyn.telefonica.de. [78.54.93.45]) by smtp.gmail.com with ESMTPSA id k11sm1032783wmi.18.2017.11.29.01.09.02 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 29 Nov 2017 01:09:02 -0800 (PST) Content-Disposition: inline In-Reply-To: <20171129072949.GC32345@graute-opti> Sender: netdev-owner@vger.kernel.org List-ID: On 29/11/17, Oliver Graute wrote: > On 28/11/17, Andrew Lunn wrote: > > On Tue, Nov 28, 2017 at 04:28:15PM +0100, Oliver Graute wrote: > > > Hello list, > > > > > > I try to get two Micrel KSZ8041 Phys working with the fec driver from > > > Kernel 4.14. But it looks that something with the mii_bus probing is not > > > working here. I expect the Phys on address 01 and 03. Currently on eth1 > > > I see TX traffic but no RX. On eth0 there is neither nor. (ifconfig) > > > > > > [ 51.997034] Micrel KSZ8041 800f0000.ethernet-1:00: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=800f0000.ethernet-1:00, irq=POLL) > > > [ 52.036719] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready > > > [ 52.621138] Micrel KSZ8041 800f0000.ethernet-1:01: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=800f0000.ethernet-1:01, irq=POLL) > > > [ 52.649677] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready > > > [ 54.697479] fec 800f4000.ethernet eth1: Link is Up - 100Mbps/Full - flow control off > > > [ 54.721424] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready > > > [ 59.860693] Micrel KSZ8041 800f0000.ethernet-1:00: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=800f0000.ethernet-1:00, irq=POLL) > > > [ 59.874298] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready > > > [ 59.980688] Micrel KSZ8041 800f0000.ethernet-1:01: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=800f0000.ethernet-1:01, irq=POLL) > > > [ 59.994289] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready > > > [ 62.025331] fec 800f4000.ethernet eth1: Link is Up - 100Mbps/Full - flow control off > > > [ 62.044588] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready > > > > > > > > > On my old setup with an Kernel 4.2 the phys are working. But there I > > > patched the phy_mask into the old fec code. Because I didn't know how to > > > do it better by device tree. > > > > > > Can someone tell my how to do it right? > > > > Hi Oliver > > > > Can you show use your device tree? You should be using phy-handle to > > point to the PHYs on the MDIO bus. > > here is my device tree setting (derived from imx28-evk.dts): > > &mac0 { > phy-mode = "rmii"; > pinctrl-names = "default"; > pinctrl-0 = <&mac0_pins_a>; > phy-reset-gpios = <&gpio4 13 0>; > phy-reset-duration = <100>; > status = "okay"; > }; > > &mac1 { > phy-mode = "rmii"; > pinctrl-names = "default"; > pinctrl-0 = <&mac1_pins_a>; > status = "okay"; > }; > I got it working with the follwing device tree setup and after reading this http://lists.infradead.org/pipermail/linux-arm-kernel/2015-January/314706.html &mac0 { phy-mode = "rmii"; phy-handle = <ðphy0>; pinctrl-names = "default"; pinctrl-0 = <&mac0_pins_a>; phy-reset-gpios = <&gpio4 13 0>; phy-reset-duration = <100>; status = "okay"; mdio { #address-cells = <1>; #size-cells = <0>; ethphy0: ethernet-phy@1 { reg = <1>; }; ethphy1: ethernet-phy@3 { reg = <3>; }; }; }; &mac1 { phy-mode = "rmii"; phy-handle = <ðphy1>; pinctrl-names = "default"; pinctrl-0 = <&mac1_pins_a>; status = "okay"; }; Thx for stub me in right direction. Best regards, Oliver