Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp311796imp; Thu, 21 Feb 2019 01:53:28 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibe7VgUzqz5u3dlMZHc0OZgyHk0O1INYzN3PsLgVOFlxI3EpDtTrHRPaF3Cc214UA/N2LYt X-Received: by 2002:a62:e11a:: with SMTP id q26mr14827751pfh.187.1550742808630; Thu, 21 Feb 2019 01:53:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550742808; cv=none; d=google.com; s=arc-20160816; b=EwXGLN5MDcaB4gRCQouXjofkd65kU2CBDMylGCeoblgi4oQL1GR328JnWH7/10e/yf UYyl/fOf6aK//+OGL10zbama/Fmo82i2YtTvjqLKBbU8mTuBufMoyTz3kR4hXG5KngV2 ViybuDpjnPBktN90MlNKPEk83f1gW00r6cO74woXhyUjSSwLKbzUkvzONoXGJpFpYOLY nGMxezGnntUnFsyirueIUxAB8H2hZYG626uxX1RY0AORrDh9xwDieJ5FwFr2+leVsSds WeViHcJnGMTST3mll5Yjhgkhf4Wxavc+WdyksOleX81uWxONtCq1Su59UrKBrrNa1ckV JIiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=efHUgCBzvIDRrKGUlB4GpI8oHOCwEAKnTjNax6itk20=; b=TQYOhXTDfwVsdhjkrSG8MpqkrArHSFpdKNenVBppiPXr89d7SQgcWBvIvNWK0COs1n Ysr49scgkUUQs0N5Gm1ytM/UgcWkFhOUnAPis9rAblGL8FZL0GOxSlsU/kA4sKN1Jxj2 +xEvUG3K5Ej4ZrmmsxWelbMJWXyM4GClGDT+egqXabieuMeLC7UG6bAmvbY3C1mA5jXm N+tS3pepzhFcWnRkjvHYTWrayNKl55ABqdTk02EkpFKt6twVBhF1wkQwrcfyi0oaD0o2 ps9ZmVqg42x/FGoX74QPKn+FGZl0sd3rWbWRGtK6G65LxFdJ32puHyoNOCkRMzhRMfza OQIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si12771044plt.179.2019.02.21.01.53.13; Thu, 21 Feb 2019 01:53:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727681AbfBUJvs (ORCPT + 99 others); Thu, 21 Feb 2019 04:51:48 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:48319 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbfBUJvo (ORCPT ); Thu, 21 Feb 2019 04:51:44 -0500 X-Originating-IP: 90.88.23.190 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-81-190.w90-88.abo.wanadoo.fr [90.88.23.190]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 3ECE4C0004; Thu, 21 Feb 2019 09:51:40 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com Subject: [PATCH net-next 3/7] net: phy: marvell10g: Use 2500BASEX when using 2.5GBASET Date: Thu, 21 Feb 2019 10:51:24 +0100 Message-Id: <20190221095128.28188-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190221095128.28188-1-maxime.chevallier@bootlin.com> References: <20190221095128.28188-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Marvell Alaska family of PHYs supports 2.5GBaseT and 5GBaseT modes, as defined in the 802.3bz specification. Upon establishing a 2.5GBASET link, the PHY will reconfigure it's MII interface to 2500BASEX. At 5G, the PHY will reconfigure it's interface to 5GBASE-R, but this mode isn't supported by any MAC for now. This was tested with : - The 88X3310, which is on the MacchiatoBin - The 88E2010, an Alaska PHY that has no fiber interfaces, and is limited to 5G maximum speed. Signed-off-by: Maxime Chevallier --- drivers/net/phy/marvell10g.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 8e2d6039b9b3..127200a8cf9b 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -235,6 +235,7 @@ static int mv3310_config_init(struct phy_device *phydev) { /* Check that the PHY interface type is compatible */ if (phydev->interface != PHY_INTERFACE_MODE_SGMII && + phydev->interface != PHY_INTERFACE_MODE_2500BASEX && phydev->interface != PHY_INTERFACE_MODE_XAUI && phydev->interface != PHY_INTERFACE_MODE_RXAUI && phydev->interface != PHY_INTERFACE_MODE_10GKR) @@ -325,18 +326,29 @@ static int mv3310_aneg_done(struct phy_device *phydev) static void mv3310_update_interface(struct phy_device *phydev) { if ((phydev->interface == PHY_INTERFACE_MODE_SGMII || + phydev->interface == PHY_INTERFACE_MODE_2500BASEX || phydev->interface == PHY_INTERFACE_MODE_10GKR) && phydev->link) { /* The PHY automatically switches its serdes interface (and - * active PHYXS instance) between Cisco SGMII and 10GBase-KR - * modes according to the speed. Florian suggests setting - * phydev->interface to communicate this to the MAC. Only do - * this if we are already in either SGMII or 10GBase-KR mode. + * active PHYXS instance) between Cisco SGMII, 10GBase-KR and + * 2500BaseX modes according to the speed. Florian suggests + * setting phydev->interface to communicate this to the MAC. + * Only do this if we are already in one of the above modes. */ - if (phydev->speed == SPEED_10000) + switch (phydev->speed) { + case SPEED_10000: phydev->interface = PHY_INTERFACE_MODE_10GKR; - else if (phydev->speed >= SPEED_10 && - phydev->speed < SPEED_10000) + break; + case SPEED_2500: + phydev->interface = PHY_INTERFACE_MODE_2500BASEX; + break; + case SPEED_1000: + case SPEED_100: + case SPEED_10: phydev->interface = PHY_INTERFACE_MODE_SGMII; + break; + default: + break; + } } } -- 2.19.2