Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6818730rwl; Mon, 9 Jan 2023 13:32:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXsP2qT9yfTrsjKhQ1uzRvdhMeocIxofu8sQA7YBQ1ZTqy3Q6/PQFkfxK2JEzUpao0sVn02b X-Received: by 2002:a17:902:7288:b0:193:24bf:344d with SMTP id d8-20020a170902728800b0019324bf344dmr7373258pll.57.1673299960368; Mon, 09 Jan 2023 13:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673299960; cv=none; d=google.com; s=arc-20160816; b=pNlNKk/pFwsgPGIL3tUQLacQu4zmoYuuXaEJ+f8nLm0q8mOThozNV81Nan4IctrJSd 0rILavZp1Ljf9EW0l0jaBtjQu/u1Z3a4e/c3bVAtWeuFrbH4GS3LM7Drjdju/vBwq6AR oRSuuQXhFq6AgLKIj5Xnp2DIN86aHa/DiPlhtZI0AK0yjy8ixfjzEhn4QA65nvcXmaoI iSR9QdPPhrxKEsNzrkF5Oc4FdH5FdANvyhIpSuDRHgDWpGKEfg5B21tx8jWZfE+rGa7g 2+ZpKUSVjyZ6ceE0Xws3nTRB0nKFkGapZ4NZ4Nj9Jlz9TboZEO/Lno6KEOx26KMYblkh Rj+w== 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=q7WXaLfe+7ISb22qqcDWHtDOYRqLZQk14WTJBre13QA=; b=Hl0qNJ596IemnO5ZuBJqQ6jo7FtP7yIUt1MnW9rEOszN7qieUAIvmZ6wI6IVRZSsMZ HLz75xlBE19voGQ0X393K8vcjXencbgt7EyiQqHgW1TXBTcAUx4mEDj3for5tskAIOG3 L23FXzpGOctSipuWLoMH3xqC9U6MgwWi+yv04lFUEtfZXN5DOACgt2OgrK8++YhUdr6N UNCCFX1WjvcT8pUS76A696bMYgjZYQ9zcmxver/rQVGwDgo6q0635BYevqx/D0TWMTk5 zyYZXoTz9t3p2hQVRaOFaaiLbW0cheHhiCu5Jpyfjxdrt1iDa2ofJ5PCSE5T8KhiRhU2 8Irg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=hGefZ7Uv; 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 b3-20020a170902e94300b0019338acc12bsi1717100pll.343.2023.01.09.13.32.33; Mon, 09 Jan 2023 13:32: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=hGefZ7Uv; 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 S237880AbjAIVTw (ORCPT + 53 others); Mon, 9 Jan 2023 16:19:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237545AbjAIVTU (ORCPT ); Mon, 9 Jan 2023 16:19:20 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0D2C193; Mon, 9 Jan 2023 13:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673299143; x=1704835143; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=qk7EXgI2QvbLbQWUvseiawTbqOJcT8gGauJRmP837Hw=; b=hGefZ7UvoinO80K09A3YGXyk08JxrlsHvtmXbjd1trt4p5j+kGw2+rIE nWZz0HAANcclN4fZbC/XlxM8ZWQ3EOEM6bhMSUY1h72gbjKpPckw2Saj3 FrWAZXFltRs2nf+Huj6WKKto6/l0gXMRdKTrtYTUyod89lXxwVPQYieYN Xd7hI54iiEIXz7I4BwiDqIz4hN22hWzTIbrVIg+phZo9dZGE+wbQ1UgyT 3jrwQPKWzZG3BALOkE628JbplOy1gSWbVWUYe0G4dsio+Gsc/Fyehtmhc 7dNTZQLs+z1ARRBotmHkgEfSkt0+QTICN4tNJ26MajINmp9HfNVO6M/fe g==; X-IronPort-AV: E=Sophos;i="5.96,313,1665471600"; d="scan'208";a="131543894" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Jan 2023 14:19:02 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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.16; Mon, 9 Jan 2023 14:18:58 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 9 Jan 2023 14:18:56 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Russell King , , , , Jerry Ray Subject: [PATCH net-next v6 2/6] dsa: lan9303: move Turbo Mode bit init Date: Mon, 9 Jan 2023 15:18:45 -0600 Message-ID: <20230109211849.32530-3-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230109211849.32530-1-jerry.ray@microchip.com> References: <20230109211849.32530-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 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 5a21fc96d479..50470fb09cb4 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; } @@ -1050,7 +1056,6 @@ static int lan9303_phy_write(struct dsa_switch *ds, int phy, int regnum, static void lan9303_adjust_link(struct dsa_switch *ds, int port, struct phy_device *phydev) { - struct lan9303 *chip = ds->priv; int ctl; if (!phy_is_pseudo_fixed_link(phydev)) @@ -1073,14 +1078,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