From patchwork Tue May 23 15:55:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13252601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FA5AC7EE2D for ; Tue, 23 May 2023 15:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f5sDyG/TKkarVyHhDOmZuMPEu/aa4HJm0j+lWFmvegk=; b=LNsAIU9CzWdBu0 0rguz9emAGbiSs6nYoyn/aoA/nKgh7MpmIALEJbWFFNqqAFZoDpqVyAHCErj08BMFGmHIXZtozZ4q 5hSma+Lo2DakMXYmFbrg1bloBe240LZECTayRwsWgWfWR+/r+SiHNb7n6pMad6YotJfmxH8GdZ2WU w6FGLLhY59v3/WGMGxZ43rGCRfN5cnUVSN7K+D9FVer7fmasnajXkzLHBjR7+rtGnbXtPUC9fAU3K CBZkaEYisGBhq/YV21gvC/ZVy2TPeSEXh/aJJKkcmXjmSonCdLeKB2+WhcVpQxjrr5kiFZDxdRYnL 4a87N8ObkJSFc6c66yjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1UMj-00AiCU-0O; Tue, 23 May 2023 15:56:01 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1UMS-00Ai3K-2j for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 15:55:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nAKHJkTbZDzNX1B/hzv5a6k8k/EBeltxSBdWV5zZtJk=; b=j1NEbFSBxJKiqxyUzC2eun3Bo3 xzoKeuaiWYvvd8CDzPnhunoNYdhmyNCHfsRzbvkIgL1/LaxlSm1ZmrNNRBJsBdK2p0kAEDcqEE9nh 9xqGPIQPlQlcOI5o/pQyrpU5UD1X/qZGRJ8e6SyieSzgrlXhcl4xO+sRHZJ7tUw5ozGpw1AC528H1 CAm8pUbPwKTQlGuP/eZ+/k9u9Fq+rMIsWk9JEm+ENU5t8uMHr90fwGwIy5afz4JNVFNUK1omGSjLY QI/I1A92Zgcmk3SGY/nQRoulSrr0pJAR/BZgmBHpAeFRx+lbl+/iUFRW0zw2UoBPfe4KG2w4iXEep xCI9z3ag==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46878 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q1UMP-0000ky-9E; Tue, 23 May 2023 16:55:41 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q1UMO-007FTD-Kv; Tue, 23 May 2023 16:55:40 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Daniel Machon , "David S. Miller" , Eric Dumazet , Florian Fainelli , Horatiu Vultur , Ioana Ciornei , Jakub Kicinski , Lars Povlsen , linux-arm-kernel@lists.infradead.org, Madalin Bucur , Marcin Wojtas , Michal Simek , netdev@vger.kernel.org, Paolo Abeni , Radhey Shyam Pandey , Sean Anderson , Steen Hegelund , Taras Chornyi , Thomas Petazzoni , UNGLinuxDriver@microchip.com, Vladimir Oltean Subject: [PATCH RFC net-next 7/9] net: prestera: switch PCS driver to use phylink_pcs_neg_mode() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 May 2023 16:55:40 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230523_085544_891846_0869AF16 X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the newly introduced phylink_pcs_neg_mode() to configure whether inband-AN should be used. Signed-off-by: Russell King (Oracle) Acked-by: Elad Nachman --- drivers/net/ethernet/marvell/prestera/prestera_main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index 9d504142e51a..2a26f96fbed2 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -308,38 +308,36 @@ static int prestera_pcs_config(struct phylink_pcs *pcs, { struct prestera_port *port = prestera_pcs_to_port(pcs); struct prestera_port_mac_config cfg_mac; + unsigned int neg_mode; int err; + neg_mode = phylink_pcs_neg_mode(mode, interface, advertising); + err = prestera_port_cfg_mac_read(port, &cfg_mac); if (err) return err; cfg_mac.admin = true; cfg_mac.fec = PRESTERA_PORT_FEC_OFF; + cfg_mac.inband = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED; switch (interface) { case PHY_INTERFACE_MODE_10GBASER: cfg_mac.speed = SPEED_10000; - cfg_mac.inband = 0; cfg_mac.mode = PRESTERA_MAC_MODE_SR_LR; break; case PHY_INTERFACE_MODE_2500BASEX: cfg_mac.speed = SPEED_2500; cfg_mac.duplex = DUPLEX_FULL; - cfg_mac.inband = test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, - advertising); cfg_mac.mode = PRESTERA_MAC_MODE_SGMII; break; case PHY_INTERFACE_MODE_SGMII: - cfg_mac.inband = 1; cfg_mac.mode = PRESTERA_MAC_MODE_SGMII; break; case PHY_INTERFACE_MODE_1000BASEX: default: cfg_mac.speed = SPEED_1000; cfg_mac.duplex = DUPLEX_FULL; - cfg_mac.inband = test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, - advertising); cfg_mac.mode = PRESTERA_MAC_MODE_1000BASE_X; break; }