[openwrt/openwrt] realtek: pcs: rtl931x: quit setup_serdes early on USXGMII mode

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 19 14:50:30 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8bdc3d1b56e72edeb00b70cdd35fc2aed95c8a45

commit 8bdc3d1b56e72edeb00b70cdd35fc2aed95c8a45
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Wed Oct 8 19:44:31 2025 +0000

    realtek: pcs: rtl931x: quit setup_serdes early on USXGMII mode
    
    In rtpcs_931x_setup_serdes, quit early on USXGMII mode. This restores
    the behaviour introduced in c18476d0c5 to prevent the current buggy
    procedure to destroy a working configuration established by U-Boot
    before.
    
    Also include the valuable comment from the code to keep the information.
    
    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/pcs/pcs-rtl-otto.c  | 12 ++++++++++++
 1 file changed, 12 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 dea6e20eae..8cb0c03e64 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
@@ -555,6 +555,18 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
 	if (sds < 0 || sds > 13)
 		return -EINVAL;
 
+	/*
+	 * TODO: USXGMII is currently the swiss army knife to declare 10G
+	 * multi port PHYs. Real devices use other modes instead. Especially
+	 *
+	 * - 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.
+	 */
+	if (mode == PHY_INTERFACE_MODE_USXGMII)
+		return -ENOTSUPP;
+
 	pr_info("%s: set sds %d to mode %d\n", __func__, sds, mode);
 	val = rtpcs_sds_read_bits(ctrl, sds, 0x1F, 0x9, 11, 6);
 




More information about the lede-commits mailing list