summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Jelonek2026-02-02 12:06:49 +0000
committerHauke Mehrtens2026-02-07 23:35:19 +0000
commit31732b678e4624a1c17679671e868f52e334812e (patch)
tree140cfc5c212a2d6f978b7488e6a39e5d7c1c5850
parentadec06293ccb5f12d5248b6805bbaa7918d2e509 (diff)
downloadopenwrt-31732b678e4624a1c17679671e868f52e334812e.tar.gz
realtek: pcs: rtl931x: match function name with content
The function 'rtpcs_931x_sds_init_leq_dfe' was taken over mostly as-is from the SDK. After looking at what it actually does (by seeing which register are written and how they are used elsewhere), it becomes clear that 'init' isn't the correct term to describe what it does. It sets the LEQ and DFE parameters to baseline values (mostly 0) and turns off auto mode, switching to manual LEQ/DFE and forcing those baseline values. This is rather a reset to a known state instead of an initialization. Name the function accordingly. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21858 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index dfa86af2d3..6f6e740e51 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -3018,7 +3018,21 @@ static void rtpcs_931x_sds_clear_symerr(struct rtpcs_serdes *sds,
}
}
-static int rtpcs_931x_sds_init_leq_dfe(struct rtpcs_serdes *sds)
+/**
+ * rtpcs_931x_sds_reset_leq_dfe() - Reset LEQ + DFE to a baseline.
+ *
+ * @sds: Reference to SerDes instance
+ *
+ * Reset both LEQ and DFE in the RX path to baseline configuration. I.e.
+ * sets LEQ and DFE to manual mode and sets certain values (mostly 0) for
+ * LEQ and DFE coefficients/parameters.
+ *
+ * LEQ and DFE can run in two modes:
+ * * manual: specific values are set and used
+ * * auto: both adapt their parameters automatically
+ *
+ */
+static int rtpcs_931x_sds_reset_leq_dfe(struct rtpcs_serdes *sds)
{
rtpcs_sds_write_bits(sds, 0x2e, 0xd, 6, 0, 0x0); /* [6:2] LEQ gain */
rtpcs_sds_write_bits(sds, 0x2e, 0xd, 7, 7, 0x1); /* LEQ manual 1=true,0=false */
@@ -3421,7 +3435,7 @@ static int rtpcs_931x_sds_set_port_media(struct rtpcs_serdes *sds,
/* from _phy_rtl9310_sds_init, DMS1250 SDK */
rtpcs_sds_write_bits(sds, 0x2e, 0xe, 13, 11, 0x0);
rtpcs_931x_sds_rx_reset(sds);
- rtpcs_931x_sds_init_leq_dfe(sds);
+ rtpcs_931x_sds_reset_leq_dfe(sds);
is_dac = (port_media == RTPCS_PORT_MEDIA_DAC_50CM ||
port_media == RTPCS_PORT_MEDIA_DAC_100CM ||
@@ -3549,7 +3563,7 @@ static int rtpcs_931x_sds_config_hw_mode(struct rtpcs_serdes *sds,
case RTPCS_SDS_MODE_USXGMII_2_5GSXGMII:
u32 op_code = 0x6003;
- rtpcs_931x_sds_init_leq_dfe(sds);
+ rtpcs_931x_sds_reset_leq_dfe(sds);
rtpcs_931x_sds_rx_reset(sds);
rtpcs_sds_write(sds, 0x7, 0x10, op_code);