[openwrt/openwrt] realtek: pcs: rtl930x: use SerDes hw mode in TX config

LEDE Commits lede-commits at lists.infradead.org
Sun Jan 18 02:19:14 PST 2026


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d48e7bbacdda3c39b219fb24b4db98cf76e4fdd6

commit d48e7bbacdda3c39b219fb24b4db98cf76e4fdd6
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Thu Jan 8 12:33:26 2026 +0000

    realtek: pcs: rtl930x: use SerDes hw mode in TX config
    
    Use SerDes hardware mode in RTL930x SerDes TX config instead of
    PHY_INTERFACE_MODE_* modes.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21565
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c      | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 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 00aab6fd2c..ba16ccc534 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
@@ -1291,7 +1291,7 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_serdes *sds,
 }
 
 static void rtpcs_930x_sds_tx_config(struct rtpcs_serdes *sds,
-				     phy_interface_t phy_if)
+				     enum rtpcs_sds_mode hw_mode)
 {
 	/* parameters: rtl9303_80G_txParam_s2 */
 	int impedance = 0x8;
@@ -1302,24 +1302,24 @@ static void rtpcs_930x_sds_tx_config(struct rtpcs_serdes *sds,
 	int post_en = 0x1;
 	int page;
 
-	switch (phy_if) {
-	case PHY_INTERFACE_MODE_1000BASEX:
-	case PHY_INTERFACE_MODE_SGMII:
+	switch (hw_mode) {
+	case RTPCS_SDS_MODE_1000BASEX:
+	case RTPCS_SDS_MODE_SGMII:
 		pre_amp = 0x1;
 		main_amp = 0x9;
 		post_amp = 0x1;
 		page = 0x25;
 		break;
-	case PHY_INTERFACE_MODE_2500BASEX:
+	case RTPCS_SDS_MODE_2500BASEX:
 		pre_amp = 0;
 		post_amp = 0x8;
 		pre_en = 0;
 		page = 0x29;
 		break;
-	case PHY_INTERFACE_MODE_10GBASER:
-	case PHY_INTERFACE_MODE_USXGMII:
-	case PHY_INTERFACE_MODE_10G_QXGMII:
-	case PHY_INTERFACE_MODE_XGMII:
+	case RTPCS_SDS_MODE_10GBASER:
+	case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
+	case RTPCS_SDS_MODE_USXGMII_10GQXGMII:
+	case RTPCS_SDS_MODE_XSGMII:
 		pre_en = 0;
 		pre_amp = 0;
 		main_amp = 0x10;
@@ -1328,7 +1328,7 @@ static void rtpcs_930x_sds_tx_config(struct rtpcs_serdes *sds,
 		page = 0x2f;
 		break;
 	default:
-		pr_err("%s: unsupported PHY mode\n", __func__);
+		pr_err("%s: unsupported SerDes hw mode\n", __func__);
 		return;
 	}
 
@@ -2576,7 +2576,7 @@ static int rtpcs_930x_setup_serdes(struct rtpcs_serdes *sds,
 		pr_warn("%s: SerDes RX calibration failed\n", __func__);
 
 	/* Leave loopback mode */
-	rtpcs_930x_sds_tx_config(sds, if_mode);
+	rtpcs_930x_sds_tx_config(sds, hw_mode);
 
 	return 0;
 }




More information about the lede-commits mailing list