From patchwork Wed Apr 6 10:48:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12803179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6958C433EF for ; Wed, 6 Apr 2022 10:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=orHi/z2w0gin3HpzmN+cayxwFD3vt51weiJ/EqU30Uc=; b=y25c5ik9eydLy2 oJ3Hh+Tys9nYEkjyudqHv7grNk8XW3ayKYhykWS2IvixHa8aT3XFxLe3AlvFZR9JUhyHYqi7qWCXK DLcsPNXH5xIg79GQiu66h/lxt8QQsfAW5IGcywGqnR7VrsADiGUyqb50Pi6PopxM7GFu/F33MbNrP XYTiq/X9Dq2NZCHHQfkLgKpvRmR/bX3Hyi1+EADVcqH9wAWMLveTRD90JCnDqqpOssRrtRPBBxPyb Obg5rVGjCdFK8wclFgjzvPx85k6IrPikjAqPceNuDnCA98et6J9kjREtERkNNzJpv++ei0SjirmGN 6RRYve6glaNtfqeX1KpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc3Hz-005ZDJ-Cj; Wed, 06 Apr 2022 10:53:28 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc3FQ-005WTB-SL; Wed, 06 Apr 2022 10:50:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nkQnlSkGVlHWJHHvGkGYpD1QVqaP/kEBKctr3Hx+sNI=; b=arVupQ/OYBbfMrwp78KsDwMDSR T3c966/emWqyqr5qNHfoYCGzdZZVkRr22ybJ7i3gkwKRzCS3KqrkEnakJtpsz8F3+oyeRNs2dh9Bi tCLijgRKtNEw8G3yu7EU1qXf3CNVbsn8ttHndnU2iECJTViDEVLexA7GfzSYX+fgS03oTgwOIimv2 YhTtNvEuMMWg1M0TYCp1sgHOhOrjr/y0F4VN8BTjceom+QaXxP0TnJz3a8mgjebNfSKcr87QLOysp UF8p6rY1GmtKgzwfkP+fAJrpZdMoiKQPjPw+DmENDrNROj1dcNHACtITEDNpra4x5OOhLcE1na86h vw/WsT+A==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59980 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nc3DJ-0002Yz-RR; Wed, 06 Apr 2022 11:48:37 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nc3DI-004hpj-UU; Wed, 06 Apr 2022 11:48:36 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Landen Chao , DENG Qingfang , Sean Wang Cc: Marek Beh__n , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Matthias Brugger , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next 1/9] net: dsa: mt7530: 1G can also support 1000BASE-X link mode MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Wed, 06 Apr 2022 11:48:36 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_035048_939584_4EB68114 X-CRM114-Status: GOOD ( 11.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When using an external PHY connected using RGMII to mt7531 port 5, the PHY can be used to used support 1000BASE-X connections. Moreover, if 1000BASE-T is supported, then we should allow 1000BASE-X as well, since which are supported is a property of the PHY. Therefore, it makes no sense to exclude this from the linkmodes when 1000BASE-T is supported. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Signed-off-by: Russell King (Oracle) --- drivers/net/dsa/mt7530.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 19f0035d4410..20cadee13361 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2539,13 +2539,8 @@ static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, /* Port5 supports ethier RGMII or SGMII. * Port6 supports SGMII only. */ - switch (port) { - case 5: - if (mt7531_is_rgmii_port(priv, port)) - break; - fallthrough; - case 6: - phylink_set(supported, 1000baseX_Full); + if (port == 6 || + (port == 5 && !mt7531_is_rgmii_port(priv, port))) { phylink_set(supported, 2500baseX_Full); phylink_set(supported, 2500baseT_Full); } @@ -2913,8 +2908,6 @@ static void mt7530_mac_port_validate(struct dsa_switch *ds, int port, unsigned long *supported) { - if (port == 5) - phylink_set(supported, 1000baseX_Full); } static void mt7531_mac_port_validate(struct dsa_switch *ds, int port, @@ -2951,8 +2944,10 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port, } /* This switch only supports 1G full-duplex. */ - if (state->interface != PHY_INTERFACE_MODE_MII) + if (state->interface != PHY_INTERFACE_MODE_MII) { phylink_set(mask, 1000baseT_Full); + phylink_set(mask, 1000baseX_Full); + } priv->info->mac_port_validate(ds, port, mask);