From 6425d0f0c6629a5abb5ccc0a5b96746ea03657b8 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 23 Mar 2026 21:48:50 +0100 Subject: [PATCH] realtek: pcs: rtl930x: decommission temporary helper Decommission a helper for applying config/patch sequences for even/odd SerDes. Most of these sequences were squashed due to marginal difference, sharing a lot of common parts. For the marginal differences, testing showed that the different values were already present on even/odd. Since those are no reset/trigger bits but just configuration values, writing them for both should do no harm. Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/22582 Signed-off-by: Robert Marko --- .../realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 2bdc18a6a1..d1bbaa2ea0 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 @@ -2818,9 +2818,6 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd apply_fn = is_xsgmii ? rtpcs_sds_apply_config_xsg : rtpcs_sds_apply_config; -#define APPLY_EO(sds, is_even, e, o) \ - apply_fn(sds, (is_even) ? (e) : (o), (is_even) ? ARRAY_SIZE(e) : ARRAY_SIZE(o)) - /* USXGMII-QX broken, rely on bootloader setup */ if (hw_mode == RTPCS_SDS_MODE_USXGMII_10GQXGMII) return 0; @@ -2895,12 +2892,16 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd return 0; } - APPLY_EO(sds, is_even_sds, rtpcs_930x_sds_cfg_final_even, rtpcs_930x_sds_cfg_final_odd); + if (is_even_sds) + apply_fn(sds, rtpcs_930x_sds_cfg_final_even, + ARRAY_SIZE(rtpcs_930x_sds_cfg_final_even)); + else + apply_fn(sds, rtpcs_930x_sds_cfg_final_odd, + ARRAY_SIZE(rtpcs_930x_sds_cfg_final_odd)); if (hw_mode == RTPCS_SDS_MODE_10GBASER && is_even_sds) rtpcs_sds_write(sds, 0x2F, 0x1D, 0x76E1); -#undef APPLY_EO return 0; }