[openwrt/openwrt] realtek: pcs: rtl931x: add 2500Base-X mode
LEDE Commits
lede-commits at lists.infradead.org
Sat Feb 14 11:42:12 PST 2026
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cf1f06817ce2c2f518a11ca3d0a89aa1cf2bcb91
commit cf1f06817ce2c2f518a11ca3d0a89aa1cf2bcb91
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Tue Feb 10 13:52:20 2026 +0000
realtek: pcs: rtl931x: add 2500Base-X mode
Add 2500Base-X handling to mode setting which was rejected with
-ENOTSUPP before. SDK code available to us doesn't have the proper mode
value. Though by brute-forcing different mode values, 0x2d was found to
make a 2500Base-X link work.
This was tested with an otherwise correctly configured RTL8221B PHY
which is automatically switched between 2500Base-X and SGMII in the
upstream driver. Though, since there was a previous U-Boot setup for the
PHY in HISGMII mode, it may not be standalone yet.
Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22014
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 713abf68b9..d72477ab0b 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -3148,6 +3148,13 @@ static int rtpcs_931x_sds_set_ip_mode(struct rtpcs_serdes *sds,
mode_val = 0x9;
break;
+ case RTPCS_SDS_MODE_2500BASEX:
+ /* available SDK code doesn't have this value. based on brute-forcing
+ * the SerDes mode register field until the link is working
+ */
+ mode_val = 0x2d;
+ break;
+
case RTPCS_SDS_MODE_10GBASER:
mode_val = 0x35;
break;
More information about the lede-commits
mailing list