From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753133AbdDJHou convert rfc822-to-8bit (ORCPT ); Mon, 10 Apr 2017 03:44:50 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:40757 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752787AbdDJHos (ORCPT ); Mon, 10 Apr 2017 03:44:48 -0400 From: Juergen Borleis Organization: Pengutronix e.K. To: Andrew Lunn Subject: Re: [PATCH v2 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303 Date: Mon, 10 Apr 2017 09:44:12 +0200 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, f.fainelli@gmail.com, kernel@pengutronix.de, vivien.didelot@savoirfairelinux.com, davem@davemloft.net References: <20170407081502.30172-1-jbe@pengutronix.de> <20170407081502.30172-3-jbe@pengutronix.de> <20170407142943.GC23415@lunn.ch> In-Reply-To: <20170407142943.GC23415@lunn.ch> X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <201704100944.13165.jbe@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:5e26:aff:fe2b:7cc4 X-SA-Exim-Mail-From: jbe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Friday 07 April 2017 16:29:43 Andrew Lunn wrote: > > +static int lan9303_virt_phy_reg_read(struct lan9303 *chip, int regnum) > > +{ > > + int ret; > > + u32 val; > > + > > + if (regnum > MII_EXPANSION) { > > + if (regnum == MII_LAN911X_SPECIAL_CONTROL_STATUS) > > + regnum = 7; /* map to LAN9303_VIRT_SPECIAL_CTRL */ > > + else > > + return -EINVAL; > > + } > > What PHY ID does the virtual PHY use? The same as the LAN911X? Or > something different. Something different: 0x00000000 (instead of 0x0007c0d1 the real PHYs are using). > I'm just wondering if this should be in the PHY > driver. But that only works if you can differentiate the virtual PHY > from the real PHYs in the PHY driver. For the real PHYs the driver states: SMSC LAN911x Internal PHY dsa-0.0:01: attached PHY driver [SMSC LAN911x Internal PHY] (mii_bus:phy_addr=dsa-0.0:01, irq=-1) SMSC LAN911x Internal PHY dsa-0.0:02: attached PHY driver [SMSC LAN911x Internal PHY] (mii_bus:phy_addr=dsa-0.0:02, irq=-1) For the virtual PHY the driver states (MDIO emulation case): Generic PHY 63fec000.etherne:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=63fec000.etherne:00, irq=-1) And for the fixed-link case: Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=-1) Regards, Juergen -- Pengutronix e.K.                              | Juergen Borleis             | Industrial Linux Solutions                    | http://www.pengutronix.de/  |