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 ||