Message ID | 89ef48606fdbe896705a57a65a85c22cae01936e.1680180959.git.daniel@makrotopia.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1247530vqo; Thu, 30 Mar 2023 09:18:58 -0700 (PDT) X-Google-Smtp-Source: AKy350YcPGftMc6fitIAvz9Mb+RyKAaLkCsolYyBolD+HnKjpA46VCDtFfjp86yBlOGJByyczGJu X-Received: by 2002:a17:90b:1b4d:b0:23f:9196:c038 with SMTP id nv13-20020a17090b1b4d00b0023f9196c038mr27785516pjb.37.1680193137977; Thu, 30 Mar 2023 09:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680193137; cv=none; d=google.com; s=arc-20160816; b=RDhcY68HkIIQF/DmB+o3Ei5j2D3W7fsjdz4W6Vw/sIy/N+9moyFuu8oJsA+t1IZaaU F5hw8w7hxc+y9QzzwBV0XPJxPHNddteWlpTwNO+4uuxmoAgJqLJ1oa5FIJjaU6dc4g/x nDOOtaV33dvaGD3BCXOHhaWyLo1qIenVHwBRKHWK6wsegt5chJay7OCOclFOp/vn3Qsc 0+L3IO30Zj5Wi/MSLQsLNlXi+rhq2/Z/C/46144nFHRWKDR3OQzJ6e17BYczX9wceTTi K5RcDILQL/GcacA6JgIePfitTS5AYPAaDj4mBIwE/y1GI/X78gDsJT9ehM5XOF5O2Iao goWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=H1PiqDahVMuQBWSb8tvhlNIh1R4yNy8SiAjmiSdiPc8=; b=kr9yogpDIeAMirb97R4LWE7OYi2BOgYsKzVlb2oe0Z+c+xy+ZP1yTn8y5KF5/ZJmjB fMwUhirWFtd5yAr/TsrC+Y+UlG9yu9YqzJKlveTknI5tDeLxmDTg3hioR56PzKhwkj6O yWQ/V5c/KkRjB/8tepms1Uqg3mx+rsSv9lUicYf1xzPjdRcV+RDjM14K7G6KJb7+dbJu F82V4af2eYqYWG0faGMMKcs+uL+glUjGBYEK9EWd663RR9VGhxPYkg3Waq7OAecPPFUA irwGXbilje6LtkhKaNFWR2qh1JNua0V8ovJUvC85rLPR3ewWT3w4Wu6eqea6Cxi8UYQa JZqQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q29-20020a635c1d000000b0050beb3fe627si4385pgb.459.2023.03.30.09.18.43; Thu, 30 Mar 2023 09:18:57 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233025AbjC3PZO (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Thu, 30 Mar 2023 11:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232999AbjC3PYr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 30 Mar 2023 11:24:47 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CFA0D50B; Thu, 30 Mar 2023 08:24:17 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from <daniel@makrotopia.org>) id 1phu7e-0006kn-1H; Thu, 30 Mar 2023 17:23:30 +0200 Date: Thu, 30 Mar 2023 16:23:26 +0100 From: Daniel Golle <daniel@makrotopia.org> To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>, =?utf-8?b?QXI=?= =?utf-8?b?xLFuw6cgw5xuYWw=?= <arinc.unal@arinc9.com>, 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>, Sean Wang <sean.wang@mediatek.com>, Landen Chao <Landen.Chao@mediatek.com>, DENG Qingfang <dqfext@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de> Cc: Sam Shih <Sam.Shih@mediatek.com>, Lorenzo Bianconi <lorenzo@kernel.org>, John Crispin <john@phrozen.org>, Felix Fietkau <nbd@nbd.name> Subject: [PATCH net-next 13/15] net: dsa: mt7530: add support for 10G link modes for CPU port Message-ID: <89ef48606fdbe896705a57a65a85c22cae01936e.1680180959.git.daniel@makrotopia.org> References: <cover.1680180959.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <cover.1680180959.git.daniel@makrotopia.org> X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761810199988824210?= X-GMAIL-MSGID: =?utf-8?q?1761810199988824210?= |
Series |
net: dsa: add support for MT7988
|
|
Commit Message
Daniel Golle
March 30, 2023, 3:23 p.m. UTC
The built-in switch of the MT7988 SoC is internally connected using a stateless 10G link. Add support for 10G interface modes to silence a warning otherwise occurring when the switch driver is setup. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Daniel Golle <daniel@makrotopia.org> --- drivers/net/dsa/mt7530.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Comments
On 30.03.2023 18:23, Daniel Golle wrote: > The built-in switch of the MT7988 SoC is internally connected using > a stateless 10G link. Add support for 10G interface modes to silence > a warning otherwise occurring when the switch driver is setup. > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > Signed-off-by: Daniel Golle <daniel@makrotopia.org> > --- > drivers/net/dsa/mt7530.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > index 3a4682e71e746..ac666da2d10dc 100644 > --- a/drivers/net/dsa/mt7530.c > +++ b/drivers/net/dsa/mt7530.c > @@ -2618,6 +2618,9 @@ mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, > case PHY_INTERFACE_MODE_1000BASEX: > case PHY_INTERFACE_MODE_2500BASEX: > /* handled in SGMII PCS driver */ > + case PHY_INTERFACE_MODE_USXGMII: > + case PHY_INTERFACE_MODE_10GKR: > + /* internal stateless 10G link */ > return 0; > default: > return -EINVAL; I think it'd be better to make this explicitly for the switch in the MT7988 SoC. diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index e5347dd2521b..f7542c7f60e4 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2666,10 +2665,13 @@ mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_2500BASEX: /* handled in SGMII PCS driver */ + return 0; case PHY_INTERFACE_MODE_USXGMII: case PHY_INTERFACE_MODE_10GKR: - /* internal stateless 10G link */ - return 0; + if (priv->id == ID_MT7988) + /* internal stateless 10G link */ + return 0; + default: return -EINVAL; } Arınç
On Sat, Apr 01, 2023 at 11:56:43AM +0300, Arınç ÜNAL wrote: > On 30.03.2023 18:23, Daniel Golle wrote: > > The built-in switch of the MT7988 SoC is internally connected using > > a stateless 10G link. Add support for 10G interface modes to silence > > a warning otherwise occurring when the switch driver is setup. > > > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > > Signed-off-by: Daniel Golle <daniel@makrotopia.org> > > --- > > drivers/net/dsa/mt7530.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > > index 3a4682e71e746..ac666da2d10dc 100644 > > --- a/drivers/net/dsa/mt7530.c > > +++ b/drivers/net/dsa/mt7530.c > > @@ -2618,6 +2618,9 @@ mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, > > case PHY_INTERFACE_MODE_1000BASEX: > > case PHY_INTERFACE_MODE_2500BASEX: > > /* handled in SGMII PCS driver */ > > + case PHY_INTERFACE_MODE_USXGMII: > > + case PHY_INTERFACE_MODE_10GKR: > > + /* internal stateless 10G link */ > > return 0; > > default: > > return -EINVAL; > > I think it'd be better to make this explicitly for the switch in the > MT7988 SoC. I decided to rather introduce mt7988_mac_config (a noop returning either 0 or -EINVAL), mt7988_mac_port_get_caps (allowing only USXGMII and 10000FD) and mt7988_cpu_port_config (setting CPU port bit in registers but not caring about interface mode and speed other than USXGMII/10000FD). The updated commit adding MT7988 is here: https://github.com/dangowrt/linux/commit/595c940cbee90b5dbdc8173974a007fefe641550 So then I dropped "net: dsa: mt7530: add support for 10G link modes for CPU port" because it is no longer needed if all this is done explicitely for MT7988. > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > index e5347dd2521b..f7542c7f60e4 100644 > --- a/drivers/net/dsa/mt7530.c > +++ b/drivers/net/dsa/mt7530.c > @@ -2666,10 +2665,13 @@ mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, > case PHY_INTERFACE_MODE_1000BASEX: > case PHY_INTERFACE_MODE_2500BASEX: > /* handled in SGMII PCS driver */ > + return 0; > case PHY_INTERFACE_MODE_USXGMII: > case PHY_INTERFACE_MODE_10GKR: > - /* internal stateless 10G link */ > - return 0; > + if (priv->id == ID_MT7988) > + /* internal stateless 10G link */ > + return 0; > + > default: > return -EINVAL; > } > > Arınç
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 3a4682e71e746..ac666da2d10dc 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2618,6 +2618,9 @@ mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_2500BASEX: /* handled in SGMII PCS driver */ + case PHY_INTERFACE_MODE_USXGMII: + case PHY_INTERFACE_MODE_10GKR: + /* internal stateless 10G link */ return 0; default: return -EINVAL; @@ -2741,7 +2744,9 @@ static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port, * variants. */ if (interface == PHY_INTERFACE_MODE_TRGMII || - (phy_interface_mode_is_8023z(interface))) { + interface == PHY_INTERFACE_MODE_USXGMII || + interface == PHY_INTERFACE_MODE_10GKR || + phy_interface_mode_is_8023z(interface)) { speed = SPEED_1000; duplex = DUPLEX_FULL; }