Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3474376rwb; Fri, 9 Dec 2022 15:15:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf4JX5ojX6Qamu4QxylYnAQvNBpDebrX9eQqPyOWQyAdOhMfhcqxoH5a8mDEgPCx2xjwHvrE X-Received: by 2002:a17:902:b493:b0:188:760f:d811 with SMTP id y19-20020a170902b49300b00188760fd811mr7182659plr.4.1670627740197; Fri, 09 Dec 2022 15:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670627740; cv=none; d=google.com; s=arc-20160816; b=FdyAWZfXlZZkRWTpkTH2sfhva6Wyj22XvhnBtHGW8EK+NSmxKQxqnC3BvLQ9zaYYUR fUYtS30Pz3i72oUaGODM2hpfkISVCcVUCDhntVlElz2N6+hu9lRjEJuHIkbg8CYdjb7J 2ANKCljNmYwA9mlNghNzCqgq/wUACtaKzbh9+vhleopGwbKtKNactiNarR9MiNs3UwDY uiybobkk9/f5CvOPc7yo1+eg0H55WW9Te/2aVweKTupKgXk4YJbJ0p11/GpsJFxulOBE mSm/LkcqG+A6lZ0dLl5MMlyttmg0Qupcai9BSIIS/IUqaxPyEoRDC4Nm13IAnODhi5jK jM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=eHNZg5/s7ulxsRXkIVG1c/XWvgftct4YyliIS52fQ/s=; b=YFwoOi9QKUz/DSn22F1W0gM0oCbpfCy/NhJwDsOV/cLbqosqCoIdqgdMmzyegeku+K sB1Z/3rlswZkvFxwSvHk2g7k9oPZh6VL3XUEu8efdaOhHzvnXG22jD60jPA1AoanJMMT yDQaoG0K2c0wwlBU3Iuf3hwTv+sT9RqDDYDdV+EG6pCmhJNARi2DRGReU5OM5u7MgJS6 K6qb6TfQokXNC6qQGPRS2J4COMqdzRSwke/RfLvcmEBmqVROscFWsfsoPkrSmfPHoyYI xN/iDJa/JmP0gwm9snfZgu4tRgAoTISWec++VAB/HrE+Vt13axqBmlDNO7N8cSSnnlsM TO3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=HurkNQeA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k17-20020a170902c41100b001890fdf32c1si3100089plk.180.2022.12.09.15.15.30; Fri, 09 Dec 2022 15:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=HurkNQeA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbiLIWrd (ORCPT + 74 others); Fri, 9 Dec 2022 17:47:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiLIWrU (ORCPT ); Fri, 9 Dec 2022 17:47:20 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC50121830; Fri, 9 Dec 2022 14:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670626038; x=1702162038; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=NxICK9YEAX5kiUZz9Kaz68Sx6I6kNikV7yxiKfqD0gQ=; b=HurkNQeA64dxssepArH1PUj4sRDrclHXbCxB0zWxyv4mZxIzDwwRDw9H 0h8rqMFLm0oDH3A69YRoRLAwVSi7eQ9u6P2ziT+e1x/a+bSAsun959PCw hgj+0cRtEfAzdAX8d56tXHqxt6NFwD5ya/SEM+NCVE5gyqVPbsYznkTbq LM+tl8jTUJhjpk3SevNVVvRw22r873CjxuLVy7aLkjsAY/i2ZBVjAzQSe VqrutDNVP8Fq1vMGgn0TwWdUGZNw3XJBhco0tmrry41wsUEKP9wlb2xSa UCAaV4zg0FgMavbk7aQ92FW1VqHtpB7DrZJGYGasPVgxxo0/Gk6nKf1yt A==; X-IronPort-AV: E=Sophos;i="5.96,232,1665471600"; d="scan'208";a="203381000" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Dec 2022 15:47:18 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 9 Dec 2022 15:47:17 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 9 Dec 2022 15:47:16 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , , , , , Jerry Ray Subject: [PATCH net-next v5 2/6] dsa: lan9303: move Turbo Mode bit initialization Date: Fri, 9 Dec 2022 16:47:09 -0600 Message-ID: <20221209224713.19980-3-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209224713.19980-1-jerry.ray@microchip.com> References: <20221209224713.19980-1-jerry.ray@microchip.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparing to remove the .adjust_link api, I am moving the one-time initialization of the device's Turbo Mode bit into a different execution path. This code clears (disables) the Turbo Mode bit which is never used by this driver. Turbo Mode is a non-standard mode that would allow the 100Mbps RMII interface to run at 200Mbps. Signed-off-by: Jerry Ray --- drivers/net/dsa/lan9303-core.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 5a21fc96d479..20fc2af62531 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -886,6 +886,12 @@ static int lan9303_check_device(struct lan9303 *chip) return ret; } + /* Virtual Phy: Remove Turbo 200Mbit mode */ + lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ®); + + reg &= ~LAN9303_VIRT_SPECIAL_TURBO; + regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg); + return 0; } @@ -1073,14 +1079,6 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port, ctl &= ~BMCR_FULLDPLX; lan9303_phy_write(ds, port, MII_BMCR, ctl); - - if (port == chip->phy_addr_base) { - /* Virtual Phy: Remove Turbo 200Mbit mode */ - lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, &ctl); - - ctl &= ~LAN9303_VIRT_SPECIAL_TURBO; - regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ctl); - } } static int lan9303_port_enable(struct dsa_switch *ds, int port, -- 2.17.1