From patchwork Fri Dec 9 22:47:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 31943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1028888wrr; Fri, 9 Dec 2022 14:50:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5FtD4stmkkgfweSR4vRozOLMCldBhggTOZUiP9e+/0w3SolPNFvay2xMOo+R/DBpAdKEQ1 X-Received: by 2002:a17:907:8999:b0:7b9:9417:274e with SMTP id rr25-20020a170907899900b007b99417274emr8473927ejc.4.1670626246089; Fri, 09 Dec 2022 14:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670626246; cv=none; d=google.com; s=arc-20160816; b=TKdzAfw4xDQkU4Cd1X4fhSCXJ7P6sCB7TXkGRp6lX5vIZngbG0KzBGDE3cdgFrcPeP DsdYMYsN7OfyacAnFRI4jaR9Si9IIau1tpehy2R3mSk7wh6zK11PvmgSUS8iiod3K9Ek 3b/xwvGwLW0u0gHrq2L4u/2h+AiaRpdXSZhuyDJT+zumM0eyiPIA36VAVdn5LK1rcfwM qrGRe09dx9ODlMeUCQnkUApKntkfziYIea4IVm3yR13IbAcTKjQ+/b0EwY5g0DR2VVoT DpMZuk6rkgVQnJfF9xFeWbM6huU2x7xqV3jp6Fx+NPj5eKYDDvJyxtS0A7IFrDW9UQe7 F0Jg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm10-20020a170907948a00b007809c50fd78si778209ejc.262.2022.12.09.14.50.23; Fri, 09 Dec 2022 14:50:46 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751778586673737251?= X-GMAIL-MSGID: =?utf-8?q?1751778586673737251?= 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,