[openwrt/openwrt] realtek: pcs: rtl931x: soften early exit for USXGMII
LEDE Commits
lede-commits at lists.infradead.org
Sat Jan 3 08:00:46 PST 2026
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2055a4df785dcce2d3a9cd58be1e1346e51a1721
commit 2055a4df785dcce2d3a9cd58be1e1346e51a1721
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Jan 2 17:49:02 2026 +0000
realtek: pcs: rtl931x: soften early exit for USXGMII
Now that the PCS driver keeps track of how many links are registered per
SerDes, we can also decide which real hardware mode to use when USXGMII
is set. While there is still no proper setup for 10G-QXGMII or XSGMII,
the existing USXGMII 10G-SXGMII setup seems to work properly.
Soften the condition when to exit early so that single 10G port USXGMII
can be setup properly.
Fixes: c18476d0c581 ("realtek: RTL931x: disable USXGMII SerDes setup")
Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
.../files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
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 06647938d2..efa5287f18 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
@@ -2906,6 +2906,13 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
u32 sds_id = sds->id;
int ret, chiptype = 0;
+ ret = rtpcs_sds_determine_hw_mode(sds, mode, &hw_mode);
+ if (ret < 0) {
+ dev_err(ctrl->dev, "SerDes %u doesn't support %s mode\n", sds_id,
+ phy_modes(mode));
+ return -ENOTSUPP;
+ }
+
/*
* TODO: USXGMII is currently the swiss army knife to declare 10G
* multi port PHYs. Real devices use other modes instead. Especially
@@ -2913,9 +2920,12 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
* - RTL8224 is driven in 10G_QXGMII
* - RTL8218D/E are driven in (Realtek proprietary) XSGMII (10G SGMII)
*
- * For now disable all USXGMII SerDes handling and rely on U-Boot setup.
+ * For now, disable "USXGMII" modes we cannot configure properly. Only
+ * USXGMII_10GSXGMII is configured properly for now.
*/
- if (mode == PHY_INTERFACE_MODE_USXGMII)
+ if (hw_mode == RTPCS_SDS_MODE_USXGMII_10GDXGMII ||
+ hw_mode == RTPCS_SDS_MODE_USXGMII_10GQXGMII ||
+ hw_mode == RTPCS_SDS_MODE_XSGMII)
return 0;
pr_info("%s: set sds %d to mode %d\n", __func__, sds_id, mode);
@@ -2949,13 +2959,6 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
/* this was in rtl931x_phylink_mac_config in dsa/rtl83xx/dsa.c before */
band = rtpcs_931x_sds_cmu_band_get(sds, mode);
- ret = rtpcs_sds_determine_hw_mode(sds, mode, &hw_mode);
- if (ret < 0) {
- dev_err(ctrl->dev, "SerDes %u doesn't support %s mode\n", sds_id,
- phy_modes(mode));
- return -ENOTSUPP;
- }
-
ret = rtpcs_931x_sds_config_hw_mode(sds, hw_mode, chiptype);
if (ret < 0)
return ret;
More information about the lede-commits
mailing list