realtek: pcs: rtl930x: handle QSGMII config early

Handle QSGMII config earlier within the configuration function as a
preparation for subsequent patches in this area. Those will target
splitting up the config sequences and 5G-QSGMII is special there.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22582
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Jonas Jelonek 2026-03-22 00:52:09 +01:00 committed by Robert Marko
parent f213e88576
commit f0665cb06b

View File

@ -2962,6 +2962,14 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd
#define APPLY_EO(sds, is_even, e, o) \
apply_fn(sds, (is_even) ? (e) : (o), (is_even) ? ARRAY_SIZE(e) : ARRAY_SIZE(o))
if (hw_mode == RTPCS_SDS_MODE_QSGMII) {
if (sds->id >= 2)
return -ENOTSUPP;
return rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_5g_qsgmii,
ARRAY_SIZE(rtpcs_930x_sds_cfg_5g_qsgmii));
}
switch (hw_mode) {
case RTPCS_SDS_MODE_1000BASEX:
case RTPCS_SDS_MODE_SGMII:
@ -2975,12 +2983,6 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd
rtpcs_930x_sds_cfg_10g_2500bx_odd);
break;
case RTPCS_SDS_MODE_QSGMII:
/* only QSGMII on 5G SerDes (0 + 1) for now */
rtpcs_sds_apply_config(sds, rtpcs_930x_sds_cfg_5g_qsgmii,
ARRAY_SIZE(rtpcs_930x_sds_cfg_5g_qsgmii));
break;
case RTPCS_SDS_MODE_XSGMII:
APPLY_EO(sds, is_even_sds, rtpcs_930x_sds_cfg_xsgmii_even,
rtpcs_930x_sds_cfg_xsgmii_odd);