From: Jonas Jelonek Date: Fri, 17 Jul 2026 08:45:41 +0000 (+0000) Subject: realtek: pcs: rtl930x: apply only needed patching X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1a6d77124dffa1e5dbf52d4fc6101181e36cf2f;p=thirdparty%2Fopenwrt.git realtek: pcs: rtl930x: apply only needed patching For 10GBase-R and 2500Base-X, the patching sequences for the slower modes are also applied. This mirrors the SDK which uses some automatic detection and only does a one-time initialization. However, Linux works different. The PCS is configured to a specific mode on demand. Thus, there is no need to apply the other patching when it isn't really needed. Those patching sequences seem to initialize AFE blocks within the SerDes, thus a 1G AFE shouldn't be needed for 10GBase-R. Testing confirms this so far, no difference in any link characteristics when e.g. 1G and 2.5G sequences aren't applied for a 10GBase-R link. Link: https://github.com/openwrt/openwrt/pull/24310 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index 0e4122f3d5b..5b3643364ba 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -2920,21 +2920,6 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd rtpcs_sds_write(sds, PAGE_TGR_PRO_0, 0x0D, 0x0F00); rtpcs_sds_write(sds, PAGE_TGR_PRO_0, 0x00, 0x0000); rtpcs_sds_write(sds, PAGE_TGR_PRO_0, 0x01, 0xC800); - /* - * TODO: Do the 1G and 3G sequences need to be applied? The SDK usually - * uses a 10GR-1000BX automatic mode covering all speeds. But in Linux, - * we switch the mode on demand so might only need to apply one sequence - * at a time. - */ - ret = rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_ana_1g, - ARRAY_SIZE(rtpcs_930x_sds_cfg_ana_1g)); - if (ret < 0) - return ret; - - ret = rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_ana_3g, - ARRAY_SIZE(rtpcs_930x_sds_cfg_ana_3g)); - if (ret < 0) - return ret; ret = rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_ana_10g, ARRAY_SIZE(rtpcs_930x_sds_cfg_ana_10g)); @@ -2945,11 +2930,6 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd break; case RTPCS_SDS_MODE_2500BASEX: - ret = rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_ana_1g, - ARRAY_SIZE(rtpcs_930x_sds_cfg_ana_1g)); - if (ret < 0) - return ret; - ret = rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_ana_3g, ARRAY_SIZE(rtpcs_930x_sds_cfg_ana_3g)); if (ret < 0)