realtek: pcs: rtl931x: set SerDes to off early

Set the SerDes mode to OFF early in the setup process to have a clear
starting point. This was part of the media handling before as a leftover
from the SDK code import. In the SDK, this function didn't only care
about applying some media settings but was also some kind of mode
setting for fiber modes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22786
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Jonas Jelonek 2026-02-04 22:02:00 +00:00 committed by Robert Marko
parent be10ea16ac
commit 0f5015fc5e

View File

@ -3519,8 +3519,6 @@ static int rtpcs_931x_sds_set_media(struct rtpcs_serdes *sds, enum rtpcs_sds_med
rtpcs_sds_write_bits(sds, 0x2e, 0xf, 5, 0, 0x4);
rtpcs_sds_write_bits(sds, 0x2a, 0x12, 7, 6, 0x1);
/* TODO: can we drop this in favor of turning off SerDes ealier? */
rtpcs_931x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF);
if (sds_media == RTPCS_SDS_MEDIA_NONE)
return 0;
@ -3724,6 +3722,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
pr_info("%s: 2.5gbit %08X", __func__, rtpcs_sds_read(sds, 0x41, 0x14));
rtpcs_931x_sds_power(sds, false);
rtpcs_931x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF);
ret = rtpcs_931x_sds_config_hw_mode(sds, hw_mode);
if (ret < 0)