From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: C45 support and mdiobus_scan Date: Thu, 9 Aug 2018 17:03:09 +0200 Message-ID: <20180809150309.GA20006@lunn.ch> References: <3bbd1d78-b896-2a81-83cf-7dad2f73bae9@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "netdev@vger.kernel.org" To: Jose Abreu Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:59939 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732524AbeHIR2a (ORCPT ); Thu, 9 Aug 2018 13:28:30 -0400 Content-Disposition: inline In-Reply-To: <3bbd1d78-b896-2a81-83cf-7dad2f73bae9@synopsys.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Aug 09, 2018 at 02:54:11PM +0100, Jose Abreu wrote: > Hi All, > > I'm preparing to add support for 10G in stmmac and I noticed that > Generic 10G PHY needs C45 support. Digging through the > registration callbacks for phy that are used in stmmac I reached > to mdiobus_scan() and the following call: > > phydev = get_phy_device(bus, addr, false); > > The last parameter is "is_c45", and is always being set to false ... > > Does this mean that I can't use the Generic 10G PHY in stmmac? I > don't mind link being fixed for 10G for now. Hi Jose So far, all MACs which support 10G have used phy-handle to point to a PHY on am MDIO bus, and that PHY uses .compatible = "ethernet-phy-ieee802.3-c45". of_mdiobus_register() will then find the PHY and register it. You really should try to follow this, if you can. > (Notice I'm using a PCI based setup so no DT bindings can help me > for this). That is not necessarily true. Take a look at: arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi &pcie { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pcie>; reset-gpio = <&gpio7 12 GPIO_ACTIVE_LOW>; status = "okay"; host@0 { reg = <0 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; i210: i210@0 { reg = <0 0 0 0 0>; }; }; }; The PCIe core will look in the device tree and when it creates the platform device for the i210 on the pcie bus, it points pdev->dev.of_node at this node. So long as you are using a platform with DT, you can do this. I hope you are not using x86.. Andrew