]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl931x: fix media config for XSGMII
authorJonas Jelonek <jelonek.jonas@gmail.com>
Fri, 5 Jun 2026 22:09:07 +0000 (22:09 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 6 Jun 2026 07:54:58 +0000 (09:54 +0200)
While this doesn't claim to be a standalone setup for XSGMII, at least
it doesn't break the working XSGMII setup from U-boot on Linksys
LGS352C, the currently only supported device using this mode. Later
during further refactoring, this should be improved to make sure
everything is properly set.

Link: https://github.com/openwrt/openwrt/pull/23674
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c

index 2e80c1ba01950cad432e2fac62d7bb769f39a445..2a72117cbfb0310b680cd3407d316188b05c56c4 100644 (file)
@@ -3727,14 +3727,15 @@ static int rtpcs_931x_sds_set_media(struct rtpcs_serdes *sds, enum rtpcs_sds_med
 
        /*
         * SDK identifies this as some kind of gating. It's enabled
-        * here and later deactivated for non-10G.
+        * here and later deactivated for non-10G and XSGMII.
         * (from DMS1250 SDK)
         */
        rtpcs_sds_write_bits(sds, 0x5f, 0x1, 0, 0, 0x1);
 
        /* from _phy_rtl9310_sds_init */
        rtpcs_sds_write_bits(sds, 0x2e, 0xe, 13, 11, 0x0);
-       rtpcs_931x_sds_reset_leq_dfe(sds);
+       if (hw_mode != RTPCS_SDS_MODE_XSGMII)
+               rtpcs_931x_sds_reset_leq_dfe(sds);
 
        /*
         * SDK says: media none behavior
@@ -3813,8 +3814,8 @@ static int rtpcs_931x_sds_set_media(struct rtpcs_serdes *sds, enum rtpcs_sds_med
        regmap_write_bits(sds->ctrl->map, RTPCS_931X_ISR_SERDES_RXIDLE,
                          BIT(sds->id - 2), BIT(sds->id - 2));
 
-       /* Gating as mentioned above, deactivated here for non-10G */
-       if (!is_10g)
+       /* Gating as mentioned above, deactivated here for non-10G and XSGMII */
+       if (!is_10g || hw_mode == RTPCS_SDS_MODE_XSGMII)
                rtpcs_sds_write_bits(sds, 0x5f, 0x1, 0, 0, 0x0);
 
        return 0;