mediatek: fixes for Ethernet on MT7988 SoC
[openwrt/staging/dangole.git] / target / linux / generic / pending-5.15 / 796-net-dsa-mt7530-fix-10M-100M-speed-on-MT7988-switch.patch
1 From a444877c10a665cd8a869e6d37facdb89fd95f79 Mon Sep 17 00:00:00 2001
2 Message-ID: <a444877c10a665cd8a869e6d37facdb89fd95f79.1706070008.git.daniel@makrotopia.org>
3 From: Daniel Golle <daniel@makrotopia.org>
4 Date: Wed, 24 Jan 2024 04:17:11 +0000
5 Subject: [PATCH net] net: dsa: mt7530: fix 10M/100M speed on MT7988 switch
6 To: Arınç ÜNAL <arinc.unal@arinc9.com>,
7 Daniel Golle <daniel@makrotopia.org>,
8 DENG Qingfang <dqfext@gmail.com>,
9 Sean Wang <sean.wang@mediatek.com>,
10 Andrew Lunn <andrew@lunn.ch>,
11 Florian Fainelli <f.fainelli@gmail.com>,
12 Vladimir Oltean <olteanv@gmail.com>,
13 David S. Miller <davem@davemloft.net>,
14 Eric Dumazet <edumazet@google.com>,
15 Jakub Kicinski <kuba@kernel.org>,
16 Paolo Abeni <pabeni@redhat.com>,
17 Matthias Brugger <matthias.bgg@gmail.com>,
18 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
19 netdev@vger.kernel.org,
20 linux-kernel@vger.kernel.org,
21 linux-arm-kernel@lists.infradead.org,
22 linux-mediatek@lists.infradead.org
23
24 Setup PMCR port register for actual speed and duplex on internally
25 connected PHYs of the MT7988 built-in switch. This fixes links with
26 speeds other than 1000M.
27
28 Fixes: ("110c18bfed414 net: dsa: mt7530: introduce driver for MT7988 built-in switch")
29 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
30 ---
31 drivers/net/dsa/mt7530.c | 3 +--
32 1 file changed, 1 insertion(+), 2 deletions(-)
33
34 --- a/drivers/net/dsa/mt7530.c
35 +++ b/drivers/net/dsa/mt7530.c
36 @@ -2832,8 +2832,7 @@ static void mt753x_phylink_mac_link_up(s
37 /* MT753x MAC works in 1G full duplex mode for all up-clocked
38 * variants.
39 */
40 - if (interface == PHY_INTERFACE_MODE_INTERNAL ||
41 - interface == PHY_INTERFACE_MODE_TRGMII ||
42 + if (interface == PHY_INTERFACE_MODE_TRGMII ||
43 (phy_interface_mode_is_8023z(interface))) {
44 speed = SPEED_1000;
45 duplex = DUPLEX_FULL;