From: Jonas Jelonek Date: Sun, 5 Jul 2026 13:17:35 +0000 (+0000) Subject: realtek: pcs: rtl930x: use VTH/TAP helpers in calibration init X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb857ca10ef027098389043de277090a7047bc88;p=thirdparty%2Fopenwrt.git realtek: pcs: rtl930x: use VTH/TAP helpers in calibration init Replace the raw register writes in rxcal_init with the previously cleaned-up VTH and TAP helpers. Beyond readability, this also fixes two latent bugs in the original tap4 initialisation: tap4_even was written twice (both to PAGE_ANA_10G_EXT 0x01[5:0]) and tap4_odd was never written at all (PAGE_ANA_10G 0x06[11:6]). Using tap_set_value(sds, 4, 0, 0) writes both fields correctly. Also apply stage-then-latch ordering to the VTH init: write the value registers before asserting the manual bit, consistent with the rest of the calibration lock path. Link: https://github.com/openwrt/openwrt/pull/24091 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index 11546cde0ed..ca1173b10d2 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -2364,20 +2364,15 @@ static void rtpcs_930x_sds_rxcal_init(struct rtpcs_serdes *sds, enum rtpcs_sds_m /* LEQ (Long Term Equivalent signal level) */ rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x16, 14, 8, 0x00); - /* DFE (Decision Fed Equalizer) */ - rtpcs_sds_write_bits(sds, PAGE_ANA_10G_EXT, 0x03, 5, 0, tap0_init_val); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x09, 11, 6, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x09, 5, 0, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x0a, 5, 0, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G_EXT, 0x01, 5, 0, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G_EXT, 0x12, 5, 0, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x0a, 11, 6, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x06, 5, 0, 0x00); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G_EXT, 0x01, 5, 0, 0x00); - - /* Vth */ - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x13, 5, 3, 0x07); - rtpcs_sds_write_bits(sds, PAGE_ANA_10G, 0x13, 2, 0, 0x07); + /* DFE (Decision Feedback Equalizer) TAPs */ + rtpcs_930x_sds_rxcal_tap_set_value(sds, 0, tap0_init_val, 0); + rtpcs_930x_sds_rxcal_tap_set_value(sds, 1, 0, 0); + rtpcs_930x_sds_rxcal_tap_set_value(sds, 2, 0, 0); + rtpcs_930x_sds_rxcal_tap_set_value(sds, 3, 0, 0); + rtpcs_930x_sds_rxcal_tap_set_value(sds, 4, 0, 0); + + /* VTH (Voltage Threshold) */ + rtpcs_930x_sds_rxcal_vth_set_value(sds, 0x07, 0x07); rtpcs_sds_write_bits(sds, PAGE_ANA_10G_EXT, 0x0b, 5, 3, vth_min); /* --- 1.1.1 */