Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1151295rdb; Sat, 18 Nov 2023 05:15:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiRwE2s51vLZEI2J1H+4+++JVPWxPMPDNjA5t73/N4gbwSnbOiYNwDvbD0I3NnNIwZyTGY X-Received: by 2002:a05:6a00:1d8a:b0:6bd:a8a3:cc59 with SMTP id z10-20020a056a001d8a00b006bda8a3cc59mr2797657pfw.24.1700313350823; Sat, 18 Nov 2023 05:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700313350; cv=none; d=google.com; s=arc-20160816; b=ccZPVJ1xYwQ8gPgO8ApLyguf/8pluiqYuiXrvq1C9LrWuldfvWCvWix7t4B0yBOhiN 8AQlgZ3U2FiJYTuv2vIYJFo4Jn7Xu0bvEzUqTUAnGua76Gio0XfDKQaDLuaUDIomraPU 85M54A0Ovk6mkP9Nx5TDVK9FIgMUuX4ObtPPUxHLzdyhy0OU0WKy25eTjnyH0DVoyV83 ka45NqL+MKfvUbNU3p/4nt3eivhDC+nZ+KpbhZxefRm9mpliDf5bps5+m49gEIA110Px h9m+aFaOyiVK+MBXpNn8E3GQjCRBo0Lwo1HOJ8HbmxgYcGAZ0HedEI3/sqvmAAhQKkp6 7rdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S3MEYC7gqOMpfZ2Sz1eq2IzjVR1wvtK+PgC+zCdTF1s=; fh=pxvM+Wf6tCsucgcJlpaT+KtPH3mT2/1sv0nByOcyBzY=; b=fs7kbac35USNmXVlx5yNdn+NXnFXy9eAbnbQLBAsKA8dHTg8/09gCpNK/vdQFKoD/r N3eKjE9SXgNi7XGb73Bec6L8INhU4ODyHlvUgwZJQ25JTMCdVeYGN64zP1cp4pGXkbJN XY11Rdq2z3kjBrdktc4C3YDSkNgqlfJ+F47izlxIZwrxkFZf/6DSiJAYG4+AFEkMWzok 0JeL44Houh18Vjhiz+Pok+FkQ4T68azvAhkP04CTpu5gO1JNKlM25QagDddVc3sClDFf rbJDRdNA6a8XllvqWmAwgCDJX/fxalYwA/piNdvAJzIHuB52QcJUolwuO2P4/GLF+Rlb xQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=SD0WaCM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id t13-20020a65608d000000b005be1ee5beb7si3919321pgu.534.2023.11.18.05.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 05:15:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=SD0WaCM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 12D20807C85F; Sat, 18 Nov 2023 05:15:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229449AbjKRNOs (ORCPT + 99 others); Sat, 18 Nov 2023 08:14:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbjKRNOs (ORCPT ); Sat, 18 Nov 2023 08:14:48 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A920D47; Sat, 18 Nov 2023 05:14:43 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1474B20002; Sat, 18 Nov 2023 13:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1700313282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S3MEYC7gqOMpfZ2Sz1eq2IzjVR1wvtK+PgC+zCdTF1s=; b=SD0WaCM256ys8s8rdqlsCKTRgDW5r4oP7kAF4v8vnFA7OdoXbe+ebcUTtnIGkvJ3Tzqy9H CCP6zlQu7MHZGBJ0EFgOyRPnlJswtwj2ripKseEEzOIzuVi6VBVxzcGz0nh9AhpjBXlUtn V3ZtU4KMuWfSnkPUIUq5AsySqo+rBJPR7lNlk9y4wPvF/sZ8yyGaDXWQ6M/zkyUO4+OdSe 6MPcz3us6drJ6mARadUTrdW2dmHz2VJ3xb79ozZf8MZ3eUrKlXeCMbtg9iNG6gTj25jtFs TtYqOt0VmA2OSj0uVyzOCCGeOjNlBkOCGE8gPb2W2ZCyzZNPJRyONjYArsMeJg== From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= To: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com Subject: [PATCH net-next 12/15] net: dsa: mt7530: move enabling port 6 to mt7530_setup_port6() Date: Sat, 18 Nov 2023 16:13:14 +0300 Message-Id: <20231118131317.295591-2-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231118123205.266819-1-arinc.unal@arinc9.com> References: <20231118123205.266819-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 18 Nov 2023 05:15:08 -0800 (PST) Enable port 6 only when port 6 is being used. Update the comment on mt7530_setup() with a better explanation. Do not set MHWTRAP_MANUAL on mt7530_setup_port5() as it's already done on mt7530_setup() beforehand. Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 167b340350b3..2608b09d3295 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -420,6 +420,8 @@ mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface) struct mt7530_priv *priv = ds->priv; u32 ncpo1, ssc_delta, trgint, xtal; + mt7530_clear(priv, MT7530_MHWTRAP, MHWTRAP_P6_DIS); + xtal = mt7530_read(priv, MT7530_MHWTRAP) & HWTRAP_XTAL_MASK; switch (interface) { @@ -910,7 +912,7 @@ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface) val = mt7530_read(priv, MT7530_MHWTRAP); - val |= MHWTRAP_MANUAL | MHWTRAP_P5_MAC_SEL | MHWTRAP_P5_DIS; + val |= MHWTRAP_P5_MAC_SEL | MHWTRAP_P5_DIS; val &= ~MHWTRAP_P5_RGMII_MODE & ~MHWTRAP_PHY0_SEL; switch (priv->p5_intf_sel) { @@ -2250,9 +2252,11 @@ mt7530_setup(struct dsa_switch *ds) mt7530_rmw(priv, MT7530_TRGMII_RD(i), RD_TAP_MASK, RD_TAP(16)); - /* Enable port 6 */ + /* Directly access the PHY registers via C_MDC/C_MDIO. The bit that + * enables modifying the hardware trap must be set for this. + */ val = mt7530_read(priv, MT7530_MHWTRAP); - val &= ~MHWTRAP_P6_DIS & ~MHWTRAP_PHY_ACCESS; + val &= ~MHWTRAP_PHY_ACCESS; val |= MHWTRAP_MANUAL; mt7530_write(priv, MT7530_MHWTRAP, val); -- 2.40.1