From: Jonas Jelonek Date: Thu, 8 Jan 2026 12:33:26 +0000 (+0000) Subject: realtek: pcs: rtl930x: use SerDes hw mode in TX config X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d48e7bbacdda3c39b219fb24b4db98cf76e4fdd6;p=thirdparty%2Fopenwrt.git 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 Link: https://github.com/openwrt/openwrt/pull/21565 Signed-off-by: Robert Marko --- 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 00aab6fd2cc..ba16ccc5343 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; }