]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl930x: handle QSGMII config early
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 21 Mar 2026 23:52:09 +0000 (00:52 +0100)
committerRobert Marko <robimarko@gmail.com>
Thu, 26 Mar 2026 09:53:46 +0000 (10:53 +0100)
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>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index 0992c25e1b9492c0c8260086c38e485a36c5746a..2599976de5b75bf538af062901945c8a61fa4489 100644 (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);