mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-13 22:22:10 +00:00
This patch contains some performance and stability improvements for MT7620: 1. Always calibrate MT7620 when switching channel. 2. Rework link tuner for MT7620. 3. Correct MT7620 SDM mode register value. 4. Fix register operation on RXIQ calibration. 5. Fix TX_PIN_CFG and TX_ALC_VGA3 init values. Signed-off-by: Shiji Yang <yangshiji66@qq.com> Link: https://github.com/openwrt/openwrt/pull/16845 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit 5d583901657bdfbbf9fad77d9247872427aa5c99)
78 lines
2.6 KiB
Diff
78 lines
2.6 KiB
Diff
From 2c5aad0f9990724cce48e0a53b66bc0438e4603d Mon Sep 17 00:00:00 2001
|
|
From: Shiji Yang <yangshiji66@outlook.com>
|
|
Date: Sun, 22 Dec 2024 17:06:59 +0800
|
|
Subject: [PATCH 1/4] rt2x00: always calibrate MT7620 when switching channel
|
|
|
|
Perform calibration work after each channel switching operation.
|
|
This should help improve the rx/tx signal strength for MT7620.
|
|
|
|
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
|
---
|
|
.../net/wireless/ralink/rt2x00/rt2800lib.c | 24 ++++++++++++++-----
|
|
1 file changed, 18 insertions(+), 6 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
|
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
|
@@ -5704,6 +5704,9 @@ static void rt2800_config_ps(struct rt2x
|
|
}
|
|
}
|
|
|
|
+static void rt2800_calibration_rt6352_stage1(struct rt2x00_dev *rt2x00dev);
|
|
+static void rt2800_calibration_rt6352_stage2(struct rt2x00_dev *rt2x00dev);
|
|
+
|
|
void rt2800_config(struct rt2x00_dev *rt2x00dev,
|
|
struct rt2x00lib_conf *libconf,
|
|
const unsigned int flags)
|
|
@@ -5718,10 +5721,18 @@ void rt2800_config(struct rt2x00_dev *rt
|
|
*/
|
|
rt2800_update_survey(rt2x00dev);
|
|
|
|
+ if (rt2x00_rt(rt2x00dev, RT6352) &&
|
|
+ !test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags))
|
|
+ rt2800_calibration_rt6352_stage1(rt2x00dev);
|
|
+
|
|
rt2800_config_channel(rt2x00dev, libconf->conf,
|
|
&libconf->rf, &libconf->channel);
|
|
rt2800_config_txpower(rt2x00dev, libconf->conf->chandef.chan,
|
|
libconf->conf->power_level);
|
|
+
|
|
+ if (rt2x00_rt(rt2x00dev, RT6352) &&
|
|
+ !test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags))
|
|
+ rt2800_calibration_rt6352_stage2(rt2x00dev);
|
|
}
|
|
if (flags & IEEE80211_CONF_CHANGE_POWER)
|
|
rt2800_config_txpower(rt2x00dev, libconf->conf->chandef.chan,
|
|
@@ -10427,15 +10438,19 @@ static void rt2800_restore_rf_bbp_rt6352
|
|
}
|
|
}
|
|
|
|
-static void rt2800_calibration_rt6352(struct rt2x00_dev *rt2x00dev)
|
|
+static void rt2800_calibration_rt6352_stage1(struct rt2x00_dev *rt2x00dev)
|
|
{
|
|
- u32 reg;
|
|
-
|
|
if (rt2x00_has_cap_external_pa(rt2x00dev) ||
|
|
rt2x00_has_cap_external_lna_bg(rt2x00dev))
|
|
rt2800_restore_rf_bbp_rt6352(rt2x00dev);
|
|
|
|
rt2800_r_calibration(rt2x00dev);
|
|
+}
|
|
+
|
|
+static void rt2800_calibration_rt6352_stage2(struct rt2x00_dev *rt2x00dev)
|
|
+{
|
|
+ u32 reg;
|
|
+
|
|
rt2800_rf_self_txdc_cal(rt2x00dev);
|
|
rt2800_rxdcoc_calibration(rt2x00dev);
|
|
rt2800_bw_filter_calibration(rt2x00dev, true);
|
|
@@ -10766,9 +10781,6 @@ static void rt2800_init_rfcsr_6352(struc
|
|
|
|
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
|
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
|
-
|
|
- /* Do calibration and init PA/LNA */
|
|
- rt2800_calibration_rt6352(rt2x00dev);
|
|
}
|
|
|
|
static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
|