In RTL930x setup, tx config was called at then end of the procedure
after configuration and calibration ran. This is still a leftover from
the old code located in DSA/PHY. However, applying TX configuration like
amplification factors, etc. doesn't make sense after calibration, it
should run before. Moreover the call was commented with "leave loopback
mode" which is just wrong and doesn't describe what the function does.
Fix this misery.
Testing on device with different interface modes shows no difference so
far, especially no negative effects.
Link: https://github.com/openwrt/openwrt/pull/23759
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
*/
rtpcs_sds_write_bits(sds, 0x1f, 11, 1, 1, 1);
+ rtpcs_930x_sds_tx_config(sds, hw_mode);
+
/* Enable SDS in desired mode */
ret = rtpcs_930x_sds_set_mode(sds, hw_mode);
if (ret < 0)
rtpcs_930x_sds_activate(sds);
if (hw_mode == RTPCS_SDS_MODE_QSGMII)
- goto skip_cali;
+ return 0;
/* Calibrate SerDes receiver in loopback mode */
rtpcs_930x_sds_10g_idle(sds);
if (calib_tries >= 3)
pr_warn("%s: SerDes RX calibration failed\n", __func__);
-skip_cali:
- /* Leave loopback mode */
- rtpcs_930x_sds_tx_config(sds, hw_mode);
-
return 0;
}