From patchwork Wed Mar 24 16:50:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161707 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44471C433C1 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 164FF61A0E for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236610AbhCXQvW (ORCPT ); Wed, 24 Mar 2021 12:51:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:43588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236616AbhCXQu7 (ORCPT ); Wed, 24 Mar 2021 12:50:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6ABFA61A06; Wed, 24 Mar 2021 16:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604658; bh=Nk/SfS4eM984ElTZInSbY5F2MeODu/172v5in/niB1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9ZXpMk075uMsU58j2VYKDos4hVv1sKiE2WWXQ1KJEIWSwwmy6/iKEKAleO+BUNkF RcOs+JC1lpZIIHPf8xKJQILdJ297AKVPE0nn8jmYZWmeVrDWOmx7kYR5oxnjW6ywnZ pnFHLIx1LkwbZpF+990deFxydORcUPHXt4PSH/K9VEOXQR0kClhfvbLaWT5zfDYHfg Bynsc30XKFUbt3Wxe8fFeHdtsKOgwuUxcWmgK/akOSl0fL2rM8/OJBokib3kvIQXfw Dd90R/kI3QYmRYn9dt0b+qcUUhbOeL0ZrTLyLJdNP3z71YMsBb3c27i7oytbLbXVnq Q2xRw7wIh/Rlg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 1/7] net: phy: marvell10g: rename register Date: Wed, 24 Mar 2021 17:50:17 +0100 Message-Id: <20210324165023.32352-2-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The MV_V2_PORT_MAC_TYPE_* is part of the CTRL register. Rename to MV_V2_PORT_CTRL_MACTYPE_*. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index b1bb9b8e1e4e..96c081a7ec54 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -80,8 +80,8 @@ enum { MV_V2_PORT_CTRL = 0xf001, MV_V2_PORT_CTRL_SWRST = BIT(15), MV_V2_PORT_CTRL_PWRDOWN = BIT(11), - MV_V2_PORT_MAC_TYPE_MASK = 0x7, - MV_V2_PORT_MAC_TYPE_RATE_MATCH = 0x6, + MV_V2_PORT_CTRL_MACTYPE_MASK = 0x7, + MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH = 0x6, /* Temperature control/read registers (88X3310 only) */ MV_V2_TEMP_CTRL = 0xf08a, MV_V2_TEMP_CTRL_MASK = 0xc000, @@ -477,8 +477,8 @@ static int mv3310_config_init(struct phy_device *phydev) val = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL); if (val < 0) return val; - priv->rate_match = ((val & MV_V2_PORT_MAC_TYPE_MASK) == - MV_V2_PORT_MAC_TYPE_RATE_MATCH); + priv->rate_match = ((val & MV_V2_PORT_CTRL_MACTYPE_MASK) == + MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH); /* Enable EDPD mode - saving 600mW */ return mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS); From patchwork Wed Mar 24 16:50:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161711 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68B67C433E0 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AF9761A16 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236727AbhCXQvX (ORCPT ); Wed, 24 Mar 2021 12:51:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236628AbhCXQvB (ORCPT ); Wed, 24 Mar 2021 12:51:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4476E61A0E; Wed, 24 Mar 2021 16:50:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604660; bh=Bacl9JJMzatk4KzdOmXEDzAyI95dA+SMwbfhEruxhew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LEDSLapH3cUR365tktMnbXDhzLbI2zQ80dwILu1/b4Q50ZrlWfmMpYESN+jlESSKt OAE5iZQnePar1fBBDnQQX0MF28KPcqxqUVe0AYkC1wQ9+bI49xkznzgKpjc6fTer9E 5Cc5gRBlG9qzZG440glgbVCq13vPqzyqZh5EXY8VAAfTjSQDKLsIuDfEgle6Q1CGHd NGdey2otW0OHuoxZl03KkE3SeSXrTlJHy7pDyK7wX6rY2F1REXw8IkwKNXU7vNL5ml iy+Ti2suo+FZ68NLRGcEiAJu39r0l8XoDevE1tQMzEihtxHWQoilgE6o3Ul2gBD463 jbVVJXZR2kowg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 2/7] net: phy: marvell10g: fix typo Date: Wed, 24 Mar 2021 17:50:18 +0100 Message-Id: <20210324165023.32352-3-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This space should be a tab instead. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 96c081a7ec54..567e7900e5b8 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -79,7 +79,7 @@ enum { /* Vendor2 MMD registers */ MV_V2_PORT_CTRL = 0xf001, MV_V2_PORT_CTRL_SWRST = BIT(15), - MV_V2_PORT_CTRL_PWRDOWN = BIT(11), + MV_V2_PORT_CTRL_PWRDOWN = BIT(11), MV_V2_PORT_CTRL_MACTYPE_MASK = 0x7, MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH = 0x6, /* Temperature control/read registers (88X3310 only) */ From patchwork Wed Mar 24 16:50:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161713 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A01D8C433E2 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DE0661A11 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236961AbhCXQvY (ORCPT ); Wed, 24 Mar 2021 12:51:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:43626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236672AbhCXQvC (ORCPT ); Wed, 24 Mar 2021 12:51:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2774F61A11; Wed, 24 Mar 2021 16:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604662; bh=mBCES6V7e2/rkmOdt6W+gbb9VKDXIRD8GND4pLe8IkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YqeLHA3CCxGlKenLSEcsBXiFOZiNtE3eASxo22YxsB5QJj9iQiVlwPF38fBZzyOg9 uxP/1vLgtazf8RYdqKZl4nKjW1WSMbSU/YnOiD9USu25wPjly2SwhCnsQCBcl/F+fL XjTEKupVU4WrSsUbwZOXCU/RjIOtU2FcvOnkwhcxVzqc/CAPo1jAr8NPC7jpBEVCbr Y10pI57JftfmuVPW0GzqWb5ytHgwP/rufSeVmFW/CyrxAa7vtWx3DUccqY5qA+bSwY NfzKFZevGzXSFh0X2dNP8rufRHK9+LX9N6qLwrosHuYZQgdKeLJcDTcaLEmK1bDBL8 zUDguTigJxwNA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 3/7] net: phy: marvell10g: allow 5gabse-r and usxgmii Date: Wed, 24 Mar 2021 17:50:19 +0100 Message-Id: <20210324165023.32352-4-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This modes are also supported by this PHYs. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 567e7900e5b8..70639b9393f3 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -462,9 +462,11 @@ 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_5GBASER && phydev->interface != PHY_INTERFACE_MODE_XAUI && phydev->interface != PHY_INTERFACE_MODE_RXAUI && - phydev->interface != PHY_INTERFACE_MODE_10GBASER) + phydev->interface != PHY_INTERFACE_MODE_10GBASER && + phydev->interface != PHY_INTERFACE_MODE_USXGMII) return -ENODEV; phydev->mdix_ctrl = ETH_TP_MDI_AUTO; @@ -611,6 +613,9 @@ static void mv3310_update_interface(struct phy_device *phydev) case SPEED_10000: phydev->interface = PHY_INTERFACE_MODE_10GBASER; break; + case SPEED_5000: + phydev->interface = PHY_INTERFACE_MODE_5GBASER; + break; case SPEED_2500: phydev->interface = PHY_INTERFACE_MODE_2500BASEX; break; From patchwork Wed Mar 24 16:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161715 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7030C433E5 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CA6C61A13 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236940AbhCXQv3 (ORCPT ); Wed, 24 Mar 2021 12:51:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:43650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236686AbhCXQvE (ORCPT ); Wed, 24 Mar 2021 12:51:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0097E61A0E; Wed, 24 Mar 2021 16:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604664; bh=u+fGSu2A9+2ehYSGNcYHL+VcnOBUky0cZ0Q2ZPH0Ags=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HyNjo8vXMyipAA81F2t0MTFwtu9DQpF/NCfJsbAsjxm83OuYrCV9z+41F+ZT3nJx6 v+tOf5LdLnfIqL28xuURTNJQuzVoXZ8zoR66HzB9RYSmVIgHRQo9syftZzDje44W1N 65ESl7NBRiM8txJ9AsC9daXe6CyyOfPCEd2DYzLBUT7ULRG2obETMbTzRGSlaDYkc3 Jv7gjopvFyZTeE5M/RSjfwgxWe/+MO9gdnFu6eaXOJjPMR8eCTyAj/gPsxOc0kniri pT9yRRSAYnXKSKfDDRHu5tpyuS35RV/zNZY42A3zmuHlCmjR+WwCfD75VUKarusSSH o3vjPFwmrC+Wg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 4/7] net: phy: marvell10g: add MACTYPE definitions for 88X3310/88X3310P Date: Wed, 24 Mar 2021 17:50:20 +0100 Message-Id: <20210324165023.32352-5-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add all MACTYPE definitions for 88X3310/88X3310P. In order to have consistent naming, rename MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH to MV_V2_PORT_CTRL_MACTYPE_10GR_RATE_MATCH. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 70639b9393f3..46e853f2d41b 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -80,8 +80,15 @@ enum { MV_V2_PORT_CTRL = 0xf001, MV_V2_PORT_CTRL_SWRST = BIT(15), MV_V2_PORT_CTRL_PWRDOWN = BIT(11), - MV_V2_PORT_CTRL_MACTYPE_MASK = 0x7, - MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH = 0x6, + MV_V2_PORT_CTRL_MACTYPE_MASK = 0x7, + MV_V2_PORT_CTRL_MACTYPE_RXAUI = 0x0, + MV_V2_PORT_CTRL_MACTYPE_XAUI_RATE_MATCH = 0x1, + MV_V2_PORT_CTRL_MACTYPE_RXAUI_RATE_MATCH = 0x2, + MV_V2_PORT_CTRL_MACTYPE_XAUI = 0x3, + MV_V2_PORT_CTRL_MACTYPE_10GBASER = 0x4, + MV_V2_PORT_CTRL_MACTYPE_10GBASER_NO_SGMII_AN = 0x5, + MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH = 0x6, + MV_V2_PORT_CTRL_MACTYPE_USXGMII = 0x7, /* Temperature control/read registers (88X3310 only) */ MV_V2_TEMP_CTRL = 0xf08a, MV_V2_TEMP_CTRL_MASK = 0xc000, @@ -480,7 +487,7 @@ static int mv3310_config_init(struct phy_device *phydev) if (val < 0) return val; priv->rate_match = ((val & MV_V2_PORT_CTRL_MACTYPE_MASK) == - MV_V2_PORT_CTRL_MACTYPE_RATE_MATCH); + MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH); /* Enable EDPD mode - saving 600mW */ return mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS); From patchwork Wed Mar 24 16:50:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161719 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB5B7C433E4 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACFCD61A11 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236990AbhCXQva (ORCPT ); Wed, 24 Mar 2021 12:51:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:43680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236778AbhCXQvG (ORCPT ); Wed, 24 Mar 2021 12:51:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDD2D61A11; Wed, 24 Mar 2021 16:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604666; bh=Bqrd7a8qdQzviEJ9iRpTvmEogpJ7AAzj+1nv4IO8P1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KXCE2CxP5Ytm4ecAXvRPu6tuN9H5gDfGu9ewrkU70g+AlMBnZ19rMpDgBZf1383pw RIVvBMqGJ5is6oFAwqpHlxDLf9LNxAS+yra4lm7HYZ77hM3mkyRFl/0+/xUAu0kYsL Km3z8mCWSJwBmugg6TH333q4SsIZMVq60SAwBFVG+HhLBmlUn62gYBs/Dg6cbP8/ol BbgUHx/HL/0VQqFGDYXLzeGFqyYvgh1ZslW5NCOU0CvlEIBz3m9IzFpoYbTIKhYWV1 5pMFqinzlIQ2o2VRn3dpv3EGxOKdAd4nZ9yakezt3Mf+MIh6y3K3uW//nCiHguCSWn 7CV7kIxNS+wNw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean Date: Wed, 24 Mar 2021 17:50:21 +0100 Message-Id: <20210324165023.32352-6-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Save MACTYPE instead of rate_matching boolean. We will need this for other configurations. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 46e853f2d41b..b4f9831b4db6 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -100,7 +100,7 @@ enum { struct mv3310_priv { u32 firmware_ver; - bool rate_match; + u8 mactype; struct device *hwmon_dev; char *hwmon_name; @@ -486,8 +486,7 @@ static int mv3310_config_init(struct phy_device *phydev) val = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL); if (val < 0) return val; - priv->rate_match = ((val & MV_V2_PORT_CTRL_MACTYPE_MASK) == - MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH); + priv->mactype = val & MV_V2_PORT_CTRL_MACTYPE_MASK; /* Enable EDPD mode - saving 600mW */ return mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS); @@ -601,7 +600,7 @@ static void mv3310_update_interface(struct phy_device *phydev) * 10Gb. The PHY adapts the rate to actual wire speed with help of * internal 16KB buffer. */ - if (priv->rate_match) { + if (priv->mactype == MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH) { phydev->interface = PHY_INTERFACE_MODE_10GBASER; return; } From patchwork Wed Mar 24 16:50:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161717 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0F1DC433E8 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBDB761A2F for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236998AbhCXQvb (ORCPT ); Wed, 24 Mar 2021 12:51:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:43700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236794AbhCXQvI (ORCPT ); Wed, 24 Mar 2021 12:51:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7042619F3; Wed, 24 Mar 2021 16:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604668; bh=nO0rdJOckCx5r3n49T0yn9+navnCZWJe3TcAr5ewsx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GFEZYcYjTbErnKIOijV3EJOa2JyT5lxtZkexCyPfWfw+eGza8M07XBm9TCr/gRwvF bjTJy0EmHOvUwd3BAlMZ8o6elzLfiYkLbOBY8xdE3lXpc0d2kpb3a5OCYe1/wW3OUE rWejyhshlOI8zmDJ7j82km5In/rWQoEtI6z3o0VOQ76TAFQbP28sbJdEkJdvJ7sT4W ZAZs5Z9ZiVxi7tPfvXVBoYtVDrgcRlyTDKkLh+sZSHWRkqqCMO2tfuEsCr5/JQTSL9 njSZeOCIitGpJdkTiLhB1dR2Ibu4dLGELdCTcBin60NMVJ4XUhccixKvfeAqfYNuyS Ix++2cv0psmLw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 6/7] net: phy: marvell10g: support more rate matching modes Date: Wed, 24 Mar 2021 17:50:22 +0100 Message-Id: <20210324165023.32352-7-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The 88X3310P supports rate matching mode also for XAUI and RXAUI. Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index b4f9831b4db6..c764795a142a 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -596,13 +596,22 @@ static void mv3310_update_interface(struct phy_device *phydev) { struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev); - /* In "XFI with Rate Matching" mode the PHY interface is fixed at - * 10Gb. The PHY adapts the rate to actual wire speed with help of + /* In all of the "* with Rate Matching" modes the PHY interface is fixed + * at 10Gb. The PHY adapts the rate to actual wire speed with help of * internal 16KB buffer. */ - if (priv->mactype == MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH) { + switch (priv->mactype) { + case MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH: phydev->interface = PHY_INTERFACE_MODE_10GBASER; return; + case MV_V2_PORT_CTRL_MACTYPE_XAUI_RATE_MATCH: + phydev->interface = PHY_INTERFACE_MODE_XAUI; + return; + case MV_V2_PORT_CTRL_MACTYPE_RXAUI_RATE_MATCH: + phydev->interface = PHY_INTERFACE_MODE_RXAUI; + return; + default: + break; } if ((phydev->interface == PHY_INTERFACE_MODE_SGMII || From patchwork Wed Mar 24 16:50:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161721 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B82C433E6 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE16C61A0F for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237006AbhCXQve (ORCPT ); Wed, 24 Mar 2021 12:51:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:43718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236829AbhCXQvK (ORCPT ); Wed, 24 Mar 2021 12:51:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8082F61A06; Wed, 24 Mar 2021 16:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604670; bh=NwIaq81F8keD9a2lUJdtmdYwyazBdQn4CsmtxA+wGas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K2rKG/gLZ1zJrO7mb1isfLpooOWzAmpHKVYawVsBurVNykempcTbMuFgbuA5V2RJ9 /3Xl8GvtOsjDV97JZZO0APaa6HXbJpsU7iRdYnVKSBt2iAstujO5QJT8aS6hrHATLe 2NNXb84+RiX1l4wShqJnn3nXYuQ3R7BjU3Mh35SbAVTfs+DAQ8ZonlTQrR9E4Q4XgY +UHN3KD1mOGYED8Cejn7STlTboH6Z5OjK2Nw2quqQWM3K92iWWzTMcu2T+bfhn6SqQ 9NutxRCa47ILjiCch4eBIJivzkZh5Wqx5+U+r0dcfyzdiQ+3uofSHnJa6RhjF6KPsN ZnOMAjipSLzfA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 7/7] net: phy: marvell10g: support other MACTYPEs Date: Wed, 24 Mar 2021 17:50:23 +0100 Message-Id: <20210324165023.32352-8-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently the only "changing" MACTYPE we support is when the PHY changes between 10gbase-r / 5gbase-r / 2500base-x / sgmii Add support for xaui / 5gbase-r / 2500base-x / sgmii rxaui / 5gbase-r / 2500base-x / sgmii Signed-off-by: Marek Behún --- drivers/net/phy/marvell10g.c | 70 +++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index c764795a142a..a0fc74456d32 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -595,6 +595,10 @@ static int mv3310_aneg_done(struct phy_device *phydev) static void mv3310_update_interface(struct phy_device *phydev) { struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev); + phy_interface_t interface10g; + + if (!phydev->link) + return; /* In all of the "* with Rate Matching" modes the PHY interface is fixed * at 10Gb. The PHY adapts the rate to actual wire speed with help of @@ -610,38 +614,46 @@ static void mv3310_update_interface(struct phy_device *phydev) case MV_V2_PORT_CTRL_MACTYPE_RXAUI_RATE_MATCH: phydev->interface = PHY_INTERFACE_MODE_RXAUI; return; - default: + case MV_V2_PORT_CTRL_MACTYPE_USXGMII: + phydev->interface = PHY_INTERFACE_MODE_USXGMII; + return; + case MV_V2_PORT_CTRL_MACTYPE_10GBASER: + case MV_V2_PORT_CTRL_MACTYPE_10GBASER_NO_SGMII_AN: + interface10g = PHY_INTERFACE_MODE_10GBASER; break; + case MV_V2_PORT_CTRL_MACTYPE_XAUI: + interface10g = PHY_INTERFACE_MODE_XAUI; + break; + case MV_V2_PORT_CTRL_MACTYPE_RXAUI: + interface10g = PHY_INTERFACE_MODE_RXAUI; + break; + default: + unreachable(); } - if ((phydev->interface == PHY_INTERFACE_MODE_SGMII || - phydev->interface == PHY_INTERFACE_MODE_2500BASEX || - phydev->interface == PHY_INTERFACE_MODE_10GBASER) && - phydev->link) { - /* The PHY automatically switches its serdes interface (and - * active PHYXS instance) between Cisco SGMII, 10GBase-R 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. - */ - switch (phydev->speed) { - case SPEED_10000: - phydev->interface = PHY_INTERFACE_MODE_10GBASER; - break; - case SPEED_5000: - phydev->interface = PHY_INTERFACE_MODE_5GBASER; - 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; - } + /* The PHY automatically switches its serdes interface (and active PHYXS + * instance) between Cisco SGMII, 2500BaseX, 5GBase-R and 10GBase-R / + * xaui / rxaui 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. + */ + switch (phydev->speed) { + case SPEED_10000: + phydev->interface = interface10g; + break; + case SPEED_5000: + phydev->interface = PHY_INTERFACE_MODE_5GBASER; + 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; } }