Received: by 10.213.65.68 with SMTP id h4csp300998imn; Fri, 16 Mar 2018 03:40:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELssdrjAWBFEWZPfkmdaHGaz/RY0GE/SR2X5m2Lwfwpt9S8AGsUSW5PoQXLyVYEPfm1x+V+T X-Received: by 2002:a17:902:3a3:: with SMTP id d32-v6mr1608844pld.219.1521196813891; Fri, 16 Mar 2018 03:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521196813; cv=none; d=google.com; s=arc-20160816; b=HkB8BeQqtnxqzb/9h7iMpY0P4DK7XD/Lcth3hIG8tKTrrFOkFec/tIo68PTvGqP6Hh 4Q2kqpwvL+NtHkdG3/s1fHh0nnB3FHZK/Qmsqxi9IBmXjGlkf2ryWbOETeDyA1J7mnAm 3WXCEremt9apaOTN9Aw4Xy8CdqEE0GpzmuFRRuFsTKl6tXIEfIFSSJ5zpauEyPR2OsEb lYO1tw0itc4fusRQIirtycODmIkL2qQTrjzi5uW4sO8naJ9aaAvns0DKcf3LKqgCxAUs N6jbJ6y6cUELu2uyEGa5ZBuEDAPnCmidBGWlaiU3TYT61ir00IQzXuQrCej7rq1LgSea cMCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=12K/e+X3OgIGM9jWSLgGFCh5/8b6c/bGPsOPNrUJdFI=; b=wiEAPkWxsBby7kUWaR1Y5pCpOnJNwG+qZIBV2piu0MYEQm9CaRy8RodBCO878Sd3T1 JNGTm4P1w+1KpRNnhYvSmvtah1MTkppP1UL8xXSQv96crTtZdSj/eshGH76nTjA64HT4 wXlBL60csxobKpAdZbm82kFNE2Vx9tGdtFxpMVRKaj5YTPKPPXgRx5UZ6FP5HH/62lUv JCBvreKuUUIyEMrcod49o+zythKVQn/oNCDsDoubrrNXX21LUNYVoBzWXt3Y0ocwVb5k 8cMFaCnpI+ymAOu40c/C5WBNee+SBZ1uYHGnkYkWvRvVWG/NMaFaVltCKvCkSVFpS5kF 8psA== 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 v187si5449742pfv.25.2018.03.16.03.39.59; Fri, 16 Mar 2018 03:40:13 -0700 (PDT) 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 S1753730AbeCPKiW (ORCPT + 99 others); Fri, 16 Mar 2018 06:38:22 -0400 Received: from mail.bootlin.com ([62.4.15.54]:35022 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbeCPKfn (ORCPT ); Fri, 16 Mar 2018 06:35:43 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 5B5892083D; Fri, 16 Mar 2018 11:35:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 9243D208B3; Fri, 16 Mar 2018 11:35:03 +0100 (CET) From: Antoine Tenart To: davem@davemloft.net, kishon@ti.com, linux@armlinux.org.uk, gregory.clement@bootlin.com, andrew@lunn.ch, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com Cc: Antoine Tenart , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 05/10] phy: cp110-comphy: 2.5G SGMII mode Date: Fri, 16 Mar 2018 11:33:46 +0100 Message-Id: <20180316103351.16616-6-antoine.tenart@bootlin.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180316103351.16616-1-antoine.tenart@bootlin.com> References: <20180316103351.16616-1-antoine.tenart@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch allow the CP100 comphy to configure some lanes in the 2.5G SGMII mode. This mode is quite close to SGMII and uses nearly the same code path. Signed-off-by: Antoine Tenart --- drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c index a0d522154cdf..4ef429250d7b 100644 --- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c @@ -135,19 +135,25 @@ struct mvebu_comhy_conf { static const struct mvebu_comhy_conf mvebu_comphy_cp110_modes[] = { /* lane 0 */ MVEBU_COMPHY_CONF(0, 1, PHY_MODE_SGMII, 0x1), + MVEBU_COMPHY_CONF(0, 1, PHY_MODE_2500SGMII, 0x1), /* lane 1 */ MVEBU_COMPHY_CONF(1, 2, PHY_MODE_SGMII, 0x1), + MVEBU_COMPHY_CONF(1, 2, PHY_MODE_2500SGMII, 0x1), /* lane 2 */ MVEBU_COMPHY_CONF(2, 0, PHY_MODE_SGMII, 0x1), + MVEBU_COMPHY_CONF(2, 0, PHY_MODE_2500SGMII, 0x1), MVEBU_COMPHY_CONF(2, 0, PHY_MODE_10GKR, 0x1), /* lane 3 */ MVEBU_COMPHY_CONF(3, 1, PHY_MODE_SGMII, 0x2), + MVEBU_COMPHY_CONF(3, 1, PHY_MODE_2500SGMII, 0x2), /* lane 4 */ MVEBU_COMPHY_CONF(4, 0, PHY_MODE_SGMII, 0x2), + MVEBU_COMPHY_CONF(4, 0, PHY_MODE_2500SGMII, 0x2), MVEBU_COMPHY_CONF(4, 0, PHY_MODE_10GKR, 0x2), MVEBU_COMPHY_CONF(4, 1, PHY_MODE_SGMII, 0x1), /* lane 5 */ MVEBU_COMPHY_CONF(5, 2, PHY_MODE_SGMII, 0x1), + MVEBU_COMPHY_CONF(5, 2, PHY_MODE_2500SGMII, 0x1), }; struct mvebu_comphy_priv { @@ -206,6 +212,10 @@ static void mvebu_comphy_ethernet_init_reset(struct mvebu_comphy_lane *lane, if (mode == PHY_MODE_10GKR) val |= MVEBU_COMPHY_SERDES_CFG0_GEN_RX(0xe) | MVEBU_COMPHY_SERDES_CFG0_GEN_TX(0xe); + else if (mode == PHY_MODE_2500SGMII) + val |= MVEBU_COMPHY_SERDES_CFG0_GEN_RX(0x8) | + MVEBU_COMPHY_SERDES_CFG0_GEN_TX(0x8) | + MVEBU_COMPHY_SERDES_CFG0_HALF_BUS; else if (mode == PHY_MODE_SGMII) val |= MVEBU_COMPHY_SERDES_CFG0_GEN_RX(0x6) | MVEBU_COMPHY_SERDES_CFG0_GEN_TX(0x6) | @@ -296,13 +306,13 @@ static int mvebu_comphy_init_plls(struct mvebu_comphy_lane *lane, return 0; } -static int mvebu_comphy_set_mode_sgmii(struct phy *phy) +static int mvebu_comphy_set_mode_sgmii(struct phy *phy, enum phy_mode mode) { struct mvebu_comphy_lane *lane = phy_get_drvdata(phy); struct mvebu_comphy_priv *priv = lane->priv; u32 val; - mvebu_comphy_ethernet_init_reset(lane, PHY_MODE_SGMII); + mvebu_comphy_ethernet_init_reset(lane, mode); val = readl(priv->base + MVEBU_COMPHY_RX_CTRL1(lane->id)); val &= ~MVEBU_COMPHY_RX_CTRL1_CLK8T_EN; @@ -487,7 +497,8 @@ static int mvebu_comphy_power_on(struct phy *phy) switch (lane->mode) { case PHY_MODE_SGMII: - ret = mvebu_comphy_set_mode_sgmii(phy); + case PHY_MODE_2500SGMII: + ret = mvebu_comphy_set_mode_sgmii(phy, lane->mode); break; case PHY_MODE_10GKR: ret = mvebu_comphy_set_mode_10gkr(phy); -- 2.14.3