Message ID | 20240204-for-netnext-mt7530-improvements-2-v4-4-02bf0abaadb8@arinc9.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-51795-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp433205dyb; Sun, 4 Feb 2024 08:37:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFW2ouYx6UVunU56cCXluKKNB7GG8k0SiIRDtDXBnj3riwjN5+s0JEASEESlf+UrIQbTI6y X-Received: by 2002:aa7:c6da:0:b0:55e:f640:125a with SMTP id b26-20020aa7c6da000000b0055ef640125amr3066014eds.11.1707064653765; Sun, 04 Feb 2024 08:37:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707064653; cv=pass; d=google.com; s=arc-20160816; b=uT2ZnsLAmAWL0JkS1sJYofyzTU9xHkw/ciu8Nb8e8nBH8zM3f5X2vfjkksHKxXwvOc CR4+5SmwvVYEuM+kFDQc3omSYtQE9k2ToAzei7aU1GtQJxT4NNFOr3d1rM+iwS81cLLX bpZzGYBifWaWVSeKgKk7g+STbb/xZUHISoFezEx6lTB0nkSpdPCSJkIcr09VO1qChTsQ HX+2su4jXgs9U6LSAl7dorCicS6vxYRv7NLSwIZZ0Z2lW6oKecinqko7o3Kx1sTSoPe3 +Pi4k5mAJVP+f0lFIQX832yYAHyUjePEMGB+iDIf9CRjrHhcSzJcuHewJhaYlfzk3GuZ sTrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=T8oY/U0wrHSNvX0qINFM5g1kvQbP1cs/QHS1aVPw9b8=; fh=GbbWjMLM2VKRpMjUjasyMld4vvNMeIZfYzsFEFLAHWU=; b=YYRYghnxVr3CmXp0RXXuAoTbUrWqFG53OigsbsC7maQukE+wZbWH+9lfEMPr4js+jt oPnvNqlMsyz+vldVhrCWPVtQkb1aERM8GY9su3CUtmROhR2cRuP3UWjzAuPAN/1QrvjQ S54dBsn89ofRrSvrl++LSLst1R0b2txJSpZ6pxwv2BFFhXblhEwrE28Dxc2FlMWT8WO+ 4Gi9FJ+jHEuqg6xAASq2PpgKLU10dBr+zHm2XDc0jTvG6Cep3MbgYzGuF3HGluU32WLe 7r/B1nNFDcU3aOcJ0eagxlhTA/HKmDYAnr7Ld+oGydQ6yK7H3+JsXqU60ZmBQFk2j5EJ c67g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="AtsrW/ic"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51795-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51795-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWqRc1XA6DCeqPevsdL1Ke3FGjwTAh1gEDsaqXKVAP6eHu1JvLx+1H+BGXpM9WfykAOrWBUChK/w7TUlffq/88V7HDgqg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y17-20020a056402359100b0055f92d02d14si3156273edc.598.2024.02.04.08.37.33 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:37:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51795-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="AtsrW/ic"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51795-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51795-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 602811F21BF7 for <ouuuleilei@gmail.com>; Sun, 4 Feb 2024 16:37:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A01D53FE5D; Sun, 4 Feb 2024 16:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AtsrW/ic" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 650FF2374C; Sun, 4 Feb 2024 16:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707064492; cv=none; b=iAPYlvKElwIeCoHGxdfmT7Grw4zLpcw8GwSkTqFeQqzSXHXgew0Q8rxdOmGhBPpRoTJiX4Nt9b6f/O1RgWqVfibYNLaFZOlB648K6RH7P/KjlUsw8lh6QzPQyWQv9nDo19SbIQJnb14an7lDaxoSq1tZVlcPy1EGtGWpfUkeQw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707064492; c=relaxed/simple; bh=d1jd+Fl7RNj7Psg5rAt5zL7BjJf3BEMUc++o5vPBRxo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SBXedU8YKAmLnoeiJ1ltfgwhFdSe26KqTRdSMy+j+Qi6js2KP2xf3Cjyq+AvYiBPCdl4uY1xYgX60A0xerPbUni6cnd44SVgifpzfKlZgHpEPfb+XDfkb4oqBViSCmdizjt6+OBTkB2Uo4uEiYAZCDu+IaYYVbakkuWEYgC5Pog= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AtsrW/ic; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id EFD9DC433B2; Sun, 4 Feb 2024 16:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707064492; bh=d1jd+Fl7RNj7Psg5rAt5zL7BjJf3BEMUc++o5vPBRxo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AtsrW/icKD1jGN0Bnk+CzGhj4mZmVA26M3/AXSWIIRHBtQjuw/ycYdaplmLMWApjC COMkEQ2bAlTBJRFMgpUj8g7p7VeSseGZmx7ZMX+ajV3MvaoaRQ4U9y9w51ZEhrUA4b pq7zwx4zBY70POd8kvCf8lYhhx+QvdutBqf2OyPZWKaH3d/2xevyDGdYqgpqHtMG5d 9Ek2aTPgnI5fHb7MpiFzvTcbC9w1bvixMPfuoqZmvHh4c/rILx9sl2RAE0Xp8Bz1TV nGmF5oeu5i4QRRBX6xR7xPMQkCQoiAhnBjHrlggqNITzfXT/tWWayXFMCiY0AdQOvb NN9nGpqwqxeUw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D221CC48298; Sun, 4 Feb 2024 16:34:51 +0000 (UTC) From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= via B4 Relay <devnull+arinc.unal.arinc9.com@kernel.org> Date: Sun, 04 Feb 2024 19:34:22 +0300 Subject: [PATCH net-next v4 4/7] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240204-for-netnext-mt7530-improvements-2-v4-4-02bf0abaadb8@arinc9.com> References: <20240204-for-netnext-mt7530-improvements-2-v4-0-02bf0abaadb8@arinc9.com> In-Reply-To: <20240204-for-netnext-mt7530-improvements-2-v4-0-02bf0abaadb8@arinc9.com> To: Daniel Golle <daniel@makrotopia.org>, DENG Qingfang <dqfext@gmail.com>, Sean Wang <sean.wang@mediatek.com>, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Russell King <linux@armlinux.org.uk> Cc: mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Bartel Eerdekens <bartel.eerdekens@constell8.be>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= <arinc.unal@arinc9.com>, "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707064489; l=2654; i=arinc.unal@arinc9.com; s=arinc9-patatt; h=from:subject:message-id; bh=1hpZjAIapmRbOQsfxIUO58Y9kVJXnb7j8qJPy2E+m/0=; b=KHb2QUE4Hhz8YMEq0xZjyf+Oc+A45D3UsjybeXA537nc0jvbGMe2d2naSMjf3XoFDdD/1LQKB KAkJWugqAk1AMvSlKBf834UtyfBGuN0XIWeTtnQNLbG57lpcTOGRfHs X-Developer-Key: i=arinc.unal@arinc9.com; a=ed25519; pk=VmvgMWwm73yVIrlyJYvGtnXkQJy9CvbaeEqPQO9Z4kA= X-Endpoint-Received: by B4 Relay for arinc.unal@arinc9.com/arinc9-patatt with auth_id=115 X-Original-From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= <arinc.unal@arinc9.com> Reply-To: <arinc.unal@arinc9.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789987026312124129 X-GMAIL-MSGID: 1789987026312124129 |
Series |
MT7530 DSA Subdriver Improvements Act II
|
|
Commit Message
Arınç ÜNAL via B4 Relay
Feb. 4, 2024, 4:34 p.m. UTC
From: Arınç ÜNAL <arinc.unal@arinc9.com> mt7530_pad_clk_setup() is called if port 6 is enabled. It used to do more things than setting up port 6. That part was moved to more appropriate locations, mt7530_setup() and mt7530_pll_setup(). Now that all it does is set up port 6, rename it to mt7530_setup_port6(), and move it to a more appropriate location, under mt7530_mac_config(). Change mt7530_setup_port6() to void as there're no error cases. Leave an empty mt7530_pad_clk_setup() to satisfy the pad_setup function pointer. This is the code path for setting up the ports before: dsa_switch_ops :: phylink_mac_config() -> mt753x_phylink_mac_config() -> mt753x_mac_config() -> mt753x_info :: mac_port_config() -> mt7530_mac_config() -> mt7530_setup_port5() -> mt753x_pad_setup() -> mt753x_info :: pad_setup() -> mt7530_pad_clk_setup() This is after: dsa_switch_ops :: phylink_mac_config() -> mt753x_phylink_mac_config() -> mt753x_mac_config() -> mt753x_info :: mac_port_config() -> mt7530_mac_config() -> mt7530_setup_port5() -> mt7530_setup_port6() Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com> --- drivers/net/dsa/mt7530.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
Comments
On 4.02.2024 19:34, Arınç ÜNAL via B4 Relay wrote: > From: Arınç ÜNAL <arinc.unal@arinc9.com> > > mt7530_pad_clk_setup() is called if port 6 is enabled. It used to do more > things than setting up port 6. That part was moved to more appropriate > locations, mt7530_setup() and mt7530_pll_setup(). > > Now that all it does is set up port 6, rename it to mt7530_setup_port6(), > and move it to a more appropriate location, under mt7530_mac_config(). > > Change mt7530_setup_port6() to void as there're no error cases. > > Leave an empty mt7530_pad_clk_setup() to satisfy the pad_setup function > pointer. > > This is the code path for setting up the ports before: > > dsa_switch_ops :: phylink_mac_config() -> mt753x_phylink_mac_config() > -> mt753x_mac_config() > -> mt753x_info :: mac_port_config() -> mt7530_mac_config() > -> mt7530_setup_port5() > -> mt753x_pad_setup() > -> mt753x_info :: pad_setup() -> mt7530_pad_clk_setup() > > This is after: > > dsa_switch_ops :: phylink_mac_config() -> mt753x_phylink_mac_config() > -> mt753x_mac_config() > -> mt753x_info :: mac_port_config() -> mt7530_mac_config() > -> mt7530_setup_port5() > -> mt7530_setup_port6() > > Reviewed-by: Vladimir Oltean <olteanv@gmail.com> > Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> > Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com> > --- > drivers/net/dsa/mt7530.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > index 82e90da1e52b..18842c759b63 100644 > --- a/drivers/net/dsa/mt7530.c > +++ b/drivers/net/dsa/mt7530.c > @@ -414,8 +414,8 @@ mt753x_preferred_default_local_cpu_port(struct dsa_switch *ds) > } > > /* Setup port 6 interface mode and TRGMII TX circuit */ > -static int > -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) > +static void > +mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface) > { > struct mt7530_priv *priv = ds->priv; > u32 ncpo1, ssc_delta, xtal; > @@ -465,7 +465,11 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) > > /* Enable the MT7530 TRGMII clocks */ > core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN); > +} > > +static int > +mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) > +{ > return 0; > } > > @@ -2613,11 +2617,10 @@ mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode, > { > struct mt7530_priv *priv = ds->priv; > > - /* Only need to setup port5. */ > - if (port != 5) > - return 0; > - > - mt7530_setup_port5(priv->ds, interface); > + if (port == 5) { Stray brace, will remove. Arınç
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 82e90da1e52b..18842c759b63 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -414,8 +414,8 @@ mt753x_preferred_default_local_cpu_port(struct dsa_switch *ds) } /* Setup port 6 interface mode and TRGMII TX circuit */ -static int -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) +static void +mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface) { struct mt7530_priv *priv = ds->priv; u32 ncpo1, ssc_delta, xtal; @@ -465,7 +465,11 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) /* Enable the MT7530 TRGMII clocks */ core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN); +} +static int +mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) +{ return 0; } @@ -2613,11 +2617,10 @@ mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode, { struct mt7530_priv *priv = ds->priv; - /* Only need to setup port5. */ - if (port != 5) - return 0; - - mt7530_setup_port5(priv->ds, interface); + if (port == 5) { + mt7530_setup_port5(priv->ds, interface); + else if (port == 6) + mt7530_setup_port6(priv->ds, interface); return 0; }