Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbeACSFh (ORCPT + 1 other); Wed, 3 Jan 2018 13:05:37 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:46358 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbeACSFg (ORCPT ); Wed, 3 Jan 2018 13:05:36 -0500 Date: Wed, 3 Jan 2018 18:05:14 +0000 From: Russell King - ARM Linux To: Andrew Lunn Cc: Antoine Tenart , davem@davemloft.net, kishon@ti.com, gregory.clement@free-electrons.com, mw@semihalf.com, stefanc@marvell.com, ymarkman@marvell.com, thomas.petazzoni@free-electrons.com, miquel.raynal@free-electrons.com, nadavh@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 4/4] net: mvpp2: 2500baseX support Message-ID: <20180103180514.GK28752@n2100.armlinux.org.uk> References: <20180103150750.12974-1-antoine.tenart@free-electrons.com> <20180103150750.12974-5-antoine.tenart@free-electrons.com> <20180103152036.GC3401@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180103152036.GC3401@lunn.ch> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 03, 2018 at 04:20:36PM +0100, Andrew Lunn wrote: > > @@ -4612,6 +4616,9 @@ static int mvpp22_comphy_init(struct mvpp2_port *port) > > case PHY_INTERFACE_MODE_1000BASEX: > > mode = PHY_MODE_SGMII; > > break; > > + case PHY_INTERFACE_MODE_2500BASEX: > > + mode = PHY_MODE_2500SGMII; > > + break; > > I think this is the source of confusion with linux/phy.h and > linux/phy/phy.h. > > What would PHY_INTERFACE_MODE_2500SGMII use? > > Where is this all getting confused? Should the caller to > mvpp22_comphy_init() actually be passing PHY_INTERFACE_MODE_2500SGMII? > What is the MAC actually doing at this point? 2500BASEX or 2500SGMII? > > At minimum there needs to be a comment that this is not a typ0, > otherwise you are going to get patches submitted to 'fix' this. Andrew, I think the confusion comes from Marvell using "SGMII" as a generic name for the serial gigabit ethernet interface, which includes both Cisco SGMII and 802.3z BASE-X. Remember, the only difference between these two modes is the contents of the 16-bit control word and how that 16-bit control word is handled - there's differences at the PCS level, but that's a level up from the Serdes USB/PCIe/Ethernet PHY. So, PHY_MODE_SGMII gets used to describe both Cisco SGMII and 1000BASE-X modes, and PHY_MODE_2500SGMII is used to describe 2500BASE-X, and possibly a fixed-speed 2.5G SGMII (the 2.5G SGMII information I've found say that the speed bits not unused.) It's confusing, but I'd say that the use of the "SGMII" is generally confusing throughout this space, and I'd suggest people use "Cisco SGMII" when they mean Cisco SGMII configuration word format and 802.3z BASE-X when they mean the ethernet standard version, leaving "SGMII" available as meaning the serdes stream of either. Not ideal, but it seems that's the way everyone else uses the "SGMII" term. :( -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up