realtek: pcs: introduce per-variant SerDes activate helpers
Mirror of the previous sds_deactivate commit: add rtpcs_{838x,931x}_sds_activate()
helpers that each wrap the variant-specific "bring the SerDes back to operational"
block-power call at the end of setup_serdes, and replace the inline call.
- 838x: wraps rtpcs_838x_sds_power(sds, true)
- 931x: wraps rtpcs_931x_sds_power(sds, true)
RTL839x and RTL930x are intentionally not given an activate helper in this
commit:
- RTL839x calls rtpcs_839x_sds_reset() at the end of setup_serdes. That is
a reset pulse whose internals (per-type 10G/5G analog sequences, internal
REG3 0x7146 -> 0x7106 dance) are not yet fully characterized. Aliasing
it as _activate would misrepresent the function.
- RTL930x has no separate activation step: rtpcs_930x_sds_set_mode(sds,
hw_mode) is what commits the new mode and is intended to be surfaced
as its own "set mode" phase in a later commit rather than hidden inside
a variant-specific _activate wrapper.
Both variants will be revisited when their respective phases are clarified.
This commit is a pure refactor, no behavioural change.
Link: https://github.com/openwrt/openwrt/pull/23513
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This commit is contained in:
parent
c484f93a0b
commit
c2f129599e
@ -826,6 +826,11 @@ static int rtpcs_838x_sds_deactivate(struct rtpcs_serdes *sds)
|
|||||||
return rtpcs_838x_sds_power(sds, false);
|
return rtpcs_838x_sds_power(sds, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rtpcs_838x_sds_activate(struct rtpcs_serdes *sds)
|
||||||
|
{
|
||||||
|
return rtpcs_838x_sds_power(sds, true);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RTL838X wrapper: after setting the MAC mode, SerDes 4-5 also need the
|
* RTL838X wrapper: after setting the MAC mode, SerDes 4-5 also need the
|
||||||
* companion INT_MODE_CTRL field written.
|
* companion INT_MODE_CTRL field written.
|
||||||
@ -953,7 +958,7 @@ static int rtpcs_838x_setup_serdes(struct rtpcs_serdes *sds,
|
|||||||
/* release reset */
|
/* release reset */
|
||||||
rtpcs_sds_write(sds, 0, 3, 0x7106);
|
rtpcs_sds_write(sds, 0, 3, 0x7106);
|
||||||
|
|
||||||
rtpcs_838x_sds_power(sds, true);
|
rtpcs_838x_sds_activate(sds);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Run a switch queue reset after the first start of a SerDes. This recovers ports that
|
* Run a switch queue reset after the first start of a SerDes. This recovers ports that
|
||||||
@ -3258,6 +3263,11 @@ static int rtpcs_931x_sds_deactivate(struct rtpcs_serdes *sds)
|
|||||||
return rtpcs_931x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF);
|
return rtpcs_931x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rtpcs_931x_sds_activate(struct rtpcs_serdes *sds)
|
||||||
|
{
|
||||||
|
return rtpcs_931x_sds_power(sds, true);
|
||||||
|
}
|
||||||
|
|
||||||
static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
|
static void rtpcs_931x_sds_reset(struct rtpcs_serdes *sds)
|
||||||
{
|
{
|
||||||
u32 o_mode, f_bit;
|
u32 o_mode, f_bit;
|
||||||
@ -3832,7 +3842,7 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_serdes *sds,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtpcs_931x_sds_power(sds, true);
|
rtpcs_931x_sds_activate(sds);
|
||||||
|
|
||||||
ret = rtpcs_931x_sds_set_mode(sds, hw_mode);
|
ret = rtpcs_931x_sds_set_mode(sds, hw_mode);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user