[openwrt/openwrt] realtek: dsa: rtl931x: remove enabling MAC from phylink_mac_config
LEDE Commits
lede-commits at lists.infradead.org
Sun Oct 19 14:50:32 PDT 2025
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/29cc0b6ccf4aeb9e3246d98ce67088847ff9b8a1
commit 29cc0b6ccf4aeb9e3246d98ce67088847ff9b8a1
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Wed Oct 8 19:07:06 2025 +0000
realtek: dsa: rtl931x: remove enabling MAC from phylink_mac_config
Originally, phylink_mac_config first disabled the MAC, then triggered
the SerDes setup and then re-enabled MAC. SerDes setup has been moved to
the PCS driver now but pcs_config is called AFTER phylink_mac_config by
phylink subsystem.
Thus, just disable the MAC in phylink_mac_config. After PCS has setup
the SerDes, the MAC should be properly brought up in a mac_link_up call
coming from the phylink subsystem.
Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20369
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
.../linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
index fa3ecd816f..fd82053261 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
@@ -700,18 +700,8 @@ static void rtl931x_phylink_mac_config(struct dsa_switch *ds, int port,
reg = sw_r32(priv->r->mac_force_mode_ctrl(port));
pr_info("%s reading FORCE_MODE_CTRL: %08x\n", __func__, reg);
- reg &= ~(RTL931X_DUPLEX_MODE | RTL931X_FORCE_EN | RTL931X_FORCE_LINK_EN);
-
- reg &= ~(0xf << 12);
- reg |= 0x2 << 12; /* Set SMI speed to 0x2 */
-
- reg |= RTL931X_TX_PAUSE_EN | RTL931X_RX_PAUSE_EN;
-
- if (priv->lagmembers & BIT_ULL(port))
- reg |= RTL931X_DUPLEX_MODE;
-
- if (state->duplex == DUPLEX_FULL)
- reg |= RTL931X_DUPLEX_MODE;
+ /* Disable MAC completely so PCS can setup the SerDes */
+ reg = 0;
sw_w32(reg, priv->r->mac_force_mode_ctrl(port));
}
More information about the lede-commits
mailing list