1
0
Fork 0
forked from mirror/openwrt

realtek: pcs: rtl930x: fix calibration check

Comparing our calibration check with the one in the SDK ([1]), one can
see some discrepancies for which there are no apparent reasons. SGMII
and 1000Base-X are handled equal to XSGMII although they aren't in the
SDK and have different symbol error registers. USXGMII and 10GBase-R are
fine, but other modes are explicitly handled with failure then.

Restructure this by keeping XSGMII alone with its dedicated check (as
the SDK does) and handle all other modes differently. Though the SDK
just skips symbol error check for modes like SGMII, 1000Base-X,
2500Base-X, it was found to be ok to perform a simple check for them
too. Since we have also a default case in the symbol error read
implementation now, we can cover all other modes with default case here
too. As a side-effect, this removes the confusing and probably wrong
failure stating calibration has failed although just the checks were
insufficient.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22450
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Jonas Jelonek 2026-03-16 15:22:55 +00:00 committed by Robert Marko
parent e625e7e650
commit 02f1d73192

View file

@ -2610,8 +2610,6 @@ static int rtpcs_930x_sds_check_calibration(struct rtpcs_serdes *sds,
errors2 = rtpcs_930x_sds_sym_err_get(sds, hw_mode);
switch (hw_mode) {
case RTPCS_SDS_MODE_1000BASEX:
case RTPCS_SDS_MODE_SGMII:
case RTPCS_SDS_MODE_XSGMII:
if ((errors2 - errors1 > 100) ||
(errors1 >= 0xffff00) || (errors2 >= 0xffff00)) {
@ -2619,16 +2617,12 @@ static int rtpcs_930x_sds_check_calibration(struct rtpcs_serdes *sds,
return 1;
}
break;
case RTPCS_SDS_MODE_10GBASER:
case RTPCS_SDS_MODE_USXGMII_10GSXGMII:
case RTPCS_SDS_MODE_USXGMII_10GQXGMII:
default:
if (errors2 > 0) {
pr_info("%s: 10G error rate too high\n", __func__);
pr_info("%s: symbol error rate too high\n", __func__);
return 1;
}
break;
default:
return 1;
}
return 0;