21ca0b1c08ca78a2a66f2be98432d38eda2bb82e
[openwrt/staging/stintel.git] /
1 From a4c2233b1e4359b6c64b6f9ba98c8718a11fffee Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Sat, 22 Jul 2023 21:32:54 +0100
4 Subject: [PATCH 097/250] net: ethernet: mtk_eth_soc: remove mac_pcs_get_state
5 and modernise
6
7 Remove the .mac_pcs_get_state function, since as far as I can tell is
8 never called - no DT appears to specify an in-band-status management
9 nor SFP support for this driver.
10
11 Removal of this, along with the previous patch to remove the incorrect
12 clocking configuration, means that the driver becomes non-legacy, so
13 we can remove the "legacy_pre_march2020" status from this driver.
14
15 Reviewed-by: Daniel Golle <daniel@makrotopia.org>
16 Tested-by: Daniel Golle <daniel@makrotopia.org>
17 Tested-by: Frank Wunderlich <frank-w@public-files.de>
18 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
19 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
20 ---
21 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 35 ---------------------
22 1 file changed, 35 deletions(-)
23
24 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
25 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
26 @@ -512,38 +512,6 @@ static int mtk_mac_finish(struct phylink
27 return 0;
28 }
29
30 -static void mtk_mac_pcs_get_state(struct phylink_config *config,
31 - struct phylink_link_state *state)
32 -{
33 - struct mtk_mac *mac = container_of(config, struct mtk_mac,
34 - phylink_config);
35 - u32 pmsr = mtk_r32(mac->hw, MTK_MAC_MSR(mac->id));
36 -
37 - state->link = (pmsr & MAC_MSR_LINK);
38 - state->duplex = (pmsr & MAC_MSR_DPX) >> 1;
39 -
40 - switch (pmsr & (MAC_MSR_SPEED_1000 | MAC_MSR_SPEED_100)) {
41 - case 0:
42 - state->speed = SPEED_10;
43 - break;
44 - case MAC_MSR_SPEED_100:
45 - state->speed = SPEED_100;
46 - break;
47 - case MAC_MSR_SPEED_1000:
48 - state->speed = SPEED_1000;
49 - break;
50 - default:
51 - state->speed = SPEED_UNKNOWN;
52 - break;
53 - }
54 -
55 - state->pause &= (MLO_PAUSE_RX | MLO_PAUSE_TX);
56 - if (pmsr & MAC_MSR_RX_FC)
57 - state->pause |= MLO_PAUSE_RX;
58 - if (pmsr & MAC_MSR_TX_FC)
59 - state->pause |= MLO_PAUSE_TX;
60 -}
61 -
62 static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
63 phy_interface_t interface)
64 {
65 @@ -666,7 +634,6 @@ static void mtk_mac_link_up(struct phyli
66 static const struct phylink_mac_ops mtk_phylink_ops = {
67 .validate = phylink_generic_validate,
68 .mac_select_pcs = mtk_mac_select_pcs,
69 - .mac_pcs_get_state = mtk_mac_pcs_get_state,
70 .mac_config = mtk_mac_config,
71 .mac_finish = mtk_mac_finish,
72 .mac_link_down = mtk_mac_link_down,
73 @@ -4256,8 +4223,6 @@ static int mtk_add_mac(struct mtk_eth *e
74
75 mac->phylink_config.dev = &eth->netdev[id]->dev;
76 mac->phylink_config.type = PHYLINK_NETDEV;
77 - /* This driver makes use of state->speed in mac_config */
78 - mac->phylink_config.legacy_pre_march2020 = true;
79 mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
80 MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD;
81