mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-11 07:22:54 +00:00
mac80211: rt2x00: some improvements for MT7620
This patch contains some performance and stability improvements for MT7620: 1. Increase the watchdog sampling frequency. 2. Always calibrate MT7620 when switching channel. 3. Rework link tuner for MT7620. 4. Correct MT7620 clock cycle count. 5. Correct MT7620 SDM mode register value. 6. Fix register operation on RXIQ calibration. 7. Fix TX_PIN_CFG and TX_ALC_VGA3 init values. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
This commit is contained in:
parent
33e23e8922
commit
5f38f4827d
@ -0,0 +1,74 @@
|
||||
From 02d4059d0fd506d82a4f0736b63c06ecfc7fe6cb 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/6] rt2x00: increase the watchdog sampling frequency
|
||||
|
||||
Increase the sampling frequency of the watchdog when the hung
|
||||
counter reaches the threshold to avoid some unnecessary resets.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 45 +++++++++++++------
|
||||
1 file changed, 32 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -1311,26 +1311,45 @@ static bool rt2800_watchdog_hung(struct
|
||||
return true;
|
||||
}
|
||||
|
||||
+static inline bool check_dma_busy_rx(u32 reg_cfg, u32 reg_int)
|
||||
+{
|
||||
+ return (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_RX_DMA_BUSY) &&
|
||||
+ rt2x00_get_field32(reg_int, INT_SOURCE_CSR_RX_COHERENT));
|
||||
+}
|
||||
+
|
||||
+static inline bool check_dma_busy_tx(u32 reg_cfg, u32 reg_int)
|
||||
+{
|
||||
+ return (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_TX_DMA_BUSY) &&
|
||||
+ rt2x00_get_field32(reg_int, INT_SOURCE_CSR_TX_COHERENT));
|
||||
+}
|
||||
+
|
||||
static bool rt2800_watchdog_dma_busy(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
bool busy_rx, busy_tx;
|
||||
u32 reg_cfg = rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG);
|
||||
u32 reg_int = rt2800_register_read(rt2x00dev, INT_SOURCE_CSR);
|
||||
|
||||
- if (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_RX_DMA_BUSY) &&
|
||||
- rt2x00_get_field32(reg_int, INT_SOURCE_CSR_RX_COHERENT))
|
||||
- rt2x00dev->rxdma_busy++;
|
||||
- else
|
||||
- rt2x00dev->rxdma_busy = 0;
|
||||
-
|
||||
- if (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_TX_DMA_BUSY) &&
|
||||
- rt2x00_get_field32(reg_int, INT_SOURCE_CSR_TX_COHERENT))
|
||||
- rt2x00dev->txdma_busy++;
|
||||
- else
|
||||
- rt2x00dev->txdma_busy = 0;
|
||||
+ rt2x00dev->rxdma_busy = check_dma_busy_rx(reg_cfg, reg_int) ?
|
||||
+ rt2x00dev->rxdma_busy + 1 : 0;
|
||||
+ rt2x00dev->txdma_busy = check_dma_busy_tx(reg_cfg, reg_int) ?
|
||||
+ rt2x00dev->txdma_busy + 1 : 0;
|
||||
+
|
||||
+ if (rt2x00dev->rxdma_busy > 25 || rt2x00dev->txdma_busy > 25) {
|
||||
+ int cnt;
|
||||
+ for (cnt = 0; cnt < 10; cnt++) {
|
||||
+ msleep(5);
|
||||
+ reg_cfg = rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG);
|
||||
+ reg_int = rt2800_register_read(rt2x00dev, INT_SOURCE_CSR);
|
||||
+
|
||||
+ if (!check_dma_busy_rx(reg_cfg, reg_int))
|
||||
+ rt2x00dev->rxdma_busy = 0;
|
||||
+ if (!check_dma_busy_tx(reg_cfg, reg_int))
|
||||
+ rt2x00dev->txdma_busy = 0;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- busy_rx = rt2x00dev->rxdma_busy > 30;
|
||||
- busy_tx = rt2x00dev->txdma_busy > 30;
|
||||
+ busy_rx = rt2x00dev->rxdma_busy > 40;
|
||||
+ busy_tx = rt2x00dev->txdma_busy > 40;
|
||||
|
||||
if (!busy_rx && !busy_tx)
|
||||
return false;
|
@ -0,0 +1,77 @@
|
||||
From 3a8d8d50b7d4a81dcbff547c3a6b3119e0a7e8f1 Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Sun, 22 Dec 2024 17:06:59 +0800
|
||||
Subject: [PATCH 2/6] 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
|
||||
@@ -5695,6 +5695,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)
|
||||
@@ -5709,10 +5712,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,
|
||||
@@ -10418,15 +10429,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);
|
||||
@@ -10757,9 +10772,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)
|
@ -0,0 +1,48 @@
|
||||
From 2a04bd808748ea931288422667d2ceaf2c6f793c Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Sun, 22 Dec 2024 17:06:59 +0800
|
||||
Subject: [PATCH 3/6] rt2x00: rework link tuner for MT7620
|
||||
|
||||
Correct the VGC gain value for MT7620 and only do gain calibration
|
||||
for supported devices.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -5552,6 +5552,9 @@ static void rt2800_config_txpower(struct
|
||||
|
||||
void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352))
|
||||
+ return;
|
||||
+
|
||||
rt2800_config_txpower(rt2x00dev, rt2x00dev->hw->conf.chandef.chan,
|
||||
rt2x00dev->tx_power);
|
||||
}
|
||||
@@ -5764,9 +5767,10 @@ static u8 rt2800_get_default_vgc(struct
|
||||
rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
rt2x00_rt(rt2x00dev, RT5390) ||
|
||||
rt2x00_rt(rt2x00dev, RT5392) ||
|
||||
- rt2x00_rt(rt2x00dev, RT5592) ||
|
||||
- rt2x00_rt(rt2x00dev, RT6352))
|
||||
+ rt2x00_rt(rt2x00dev, RT5592))
|
||||
vgc = 0x1c + (2 * rt2x00dev->lna_gain);
|
||||
+ else if(rt2x00_rt(rt2x00dev, RT6352))
|
||||
+ vgc = 0x04 + (2 * rt2x00dev->lna_gain);
|
||||
else
|
||||
vgc = 0x2e + rt2x00dev->lna_gain;
|
||||
} else { /* 5GHZ band */
|
||||
@@ -5819,7 +5823,8 @@ void rt2800_link_tuner(struct rt2x00_dev
|
||||
{
|
||||
u8 vgc;
|
||||
|
||||
- if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C))
|
||||
+ if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C) ||
|
||||
+ rt2x00_rt(rt2x00dev, RT6352))
|
||||
return;
|
||||
|
||||
/* When RSSI is better than a certain threshold, increase VGC
|
@ -0,0 +1,24 @@
|
||||
From e78074e8821ebc8f036ff2f81305e951a6c5a140 Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Sun, 22 Dec 2024 17:06:59 +0800
|
||||
Subject: [PATCH 4/6] rt2x00: correct MT7620 clock cycle count
|
||||
|
||||
MT7620 uses a default fixed value 33 in mtk proprietary driver.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -6305,7 +6305,8 @@ static int rt2800_init_registers(struct
|
||||
reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, 125);
|
||||
rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
- } else if (rt2x00_is_soc(rt2x00dev)) {
|
||||
+ } else if (rt2x00_is_soc(rt2x00dev) &&
|
||||
+ !rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
struct clk *clk = clk_get_sys("bus", NULL);
|
||||
int rate;
|
||||
|
@ -0,0 +1,25 @@
|
||||
From 450528b7aa172762f278a4e33e5bd4c1b1e59374 Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Sun, 22 Dec 2024 17:06:59 +0800
|
||||
Subject: [PATCH 5/6] rt2x00: correct MT7620 SDM mode register value
|
||||
|
||||
rt2x00_set_field8() is a mask writing function. If we want to set
|
||||
the BIT(7) for the SDM mode register here, we only need to fill "4"
|
||||
in the mask.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3839,7 +3839,7 @@ static void rt2800_config_channel_rf7620
|
||||
|
||||
/* Default: XO=20MHz , SDM mode */
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
|
||||
- rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
|
||||
+ rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 4);
|
||||
rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
|
||||
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
|
@ -0,0 +1,60 @@
|
||||
From 762be77fe0a1c50247fb5872b63ccb929b8e1b0e Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Sun, 22 Dec 2024 17:06:59 +0800
|
||||
Subject: [PATCH 6/6] rt2x00: fix register operation on RXIQ calibration
|
||||
|
||||
In rt2800_rxiq_calibration(), some variables are overwritten
|
||||
before being used. Based on the values of the relevant registers
|
||||
in other functions, I believe the correct operation should be
|
||||
bit mask writing.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8838,7 +8838,7 @@ static void rt2800_rxiq_calibration(stru
|
||||
rt2x00_warn(rt2x00dev, "Timeout waiting for MAC status in RXIQ calibration\n");
|
||||
|
||||
bbpval = bbp4 & (~0x18);
|
||||
- bbpval = bbp4 | 0x00;
|
||||
+ bbpval = bbpval | 0x00;
|
||||
rt2800_bbp_write(rt2x00dev, 4, bbpval);
|
||||
|
||||
bbpval = rt2800_bbp_read(rt2x00dev, 21);
|
||||
@@ -8920,13 +8920,13 @@ static void rt2800_rxiq_calibration(stru
|
||||
for (ch_idx = 0; ch_idx < 2; ch_idx = ch_idx + 1) {
|
||||
if (ch_idx == 0) {
|
||||
rfval = rfb0r1 & (~0x3);
|
||||
- rfval = rfb0r1 | 0x1;
|
||||
+ rfval = rfval | 0x1;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfval);
|
||||
rfval = rfb0r2 & (~0x33);
|
||||
- rfval = rfb0r2 | 0x11;
|
||||
+ rfval = rfval | 0x11;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, rfval);
|
||||
rfval = rfb0r42 & (~0x50);
|
||||
- rfval = rfb0r42 | 0x10;
|
||||
+ rfval = rfval | 0x10;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 42, rfval);
|
||||
|
||||
rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00001006);
|
||||
@@ -8939,13 +8939,13 @@ static void rt2800_rxiq_calibration(stru
|
||||
rt2800_bbp_dcoc_write(rt2x00dev, 1, 0x00);
|
||||
} else {
|
||||
rfval = rfb0r1 & (~0x3);
|
||||
- rfval = rfb0r1 | 0x2;
|
||||
+ rfval = rfval | 0x2;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfval);
|
||||
rfval = rfb0r2 & (~0x33);
|
||||
- rfval = rfb0r2 | 0x22;
|
||||
+ rfval = rfval | 0x22;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, rfval);
|
||||
rfval = rfb0r42 & (~0x50);
|
||||
- rfval = rfb0r42 | 0x40;
|
||||
+ rfval = rfval | 0x40;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 42, rfval);
|
||||
|
||||
rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00002006);
|
@ -52,9 +52,9 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
|
||||
[EEPROM_CHIP_ID] = 0x0000,
|
||||
[EEPROM_VERSION] = 0x0001,
|
||||
@@ -10404,8 +10422,10 @@ static void rt2800_calibration_rt6352(st
|
||||
u32 reg;
|
||||
|
||||
@@ -10438,8 +10456,10 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
static void rt2800_calibration_rt6352_stage1(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
if (rt2x00_has_cap_external_pa(rt2x00dev) ||
|
||||
- rt2x00_has_cap_external_lna_bg(rt2x00dev))
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
@ -63,8 +63,8 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
+ }
|
||||
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
@@ -10423,6 +10443,8 @@ static void rt2800_calibration_rt6352(st
|
||||
}
|
||||
@@ -10463,6 +10483,8 @@ static void rt2800_calibration_rt6352_st
|
||||
!rt2x00_has_cap_external_lna_bg(rt2x00dev))
|
||||
return;
|
||||
|
||||
|
@ -14,13 +14,13 @@
|
||||
*/
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3836,14 +3836,16 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3855,14 +3855,16 @@ static void rt2800_config_channel_rf7620
|
||||
rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4);
|
||||
rt2800_rfcsr_write(rt2x00dev, 19, rfcsr);
|
||||
|
||||
- /* Default: XO=20MHz , SDM mode */
|
||||
- rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
|
||||
- rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
|
||||
- rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 4);
|
||||
- rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
|
||||
-
|
||||
- rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
|
||||
@ -29,7 +29,7 @@
|
||||
+ if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
|
||||
+ /* Default: XO=20MHz , SDM mode */
|
||||
+ rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
|
||||
+ rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
|
||||
+ rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 4);
|
||||
+ rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
|
||||
+
|
||||
+ rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
|
||||
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620,
|
||||
@@ -3877,18 +3879,23 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3896,18 +3898,23 @@ static void rt2800_config_channel_rf7620
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20);
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) {
|
||||
if (conf_is_ht40(conf)) {
|
||||
@@ -4002,25 +4009,29 @@ static void rt2800_config_alc_rt6352(str
|
||||
@@ -4021,25 +4028,29 @@ static void rt2800_config_alc_rt6352(str
|
||||
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl);
|
||||
|
||||
rt2800_vco_calibration(rt2x00dev);
|
||||
@@ -4513,7 +4524,8 @@ static void rt2800_config_channel(struct
|
||||
@@ -4532,7 +4543,8 @@ static void rt2800_config_channel(struct
|
||||
if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
/* BBP for GLRT BW */
|
||||
bbp = conf_is_ht40(conf) ?
|
||||
@ -131,7 +131,7 @@
|
||||
0x15 : 0x1a;
|
||||
rt2800_bbp_glrt_write(rt2x00dev, 141, bbp);
|
||||
|
||||
@@ -6017,18 +6029,33 @@ static int rt2800_init_registers(struct
|
||||
@@ -6052,18 +6064,34 @@ static int rt2800_init_registers(struct
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5350)) {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
@ -162,7 +162,8 @@
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150f0f);
|
||||
+ rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606);
|
||||
+ rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
+ rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0);
|
||||
+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN,
|
||||
@ -177,7 +178,7 @@
|
||||
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1);
|
||||
rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg);
|
||||
@@ -7141,14 +7168,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
@@ -7177,14 +7205,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
rt2800_bbp_write(rt2x00dev, 188, 0x00);
|
||||
rt2800_bbp_write(rt2x00dev, 189, 0x00);
|
||||
|
||||
@ -202,7 +203,7 @@
|
||||
|
||||
/* BBP for G band GLRT function (BBP_128 ~ BBP_221) */
|
||||
rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00);
|
||||
@@ -10378,6 +10407,9 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
@@ -10414,6 +10444,9 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0);
|
||||
}
|
||||
|
||||
@ -212,7 +213,7 @@
|
||||
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23);
|
||||
@@ -10455,6 +10487,9 @@ static void rt2800_calibration_rt6352(st
|
||||
@@ -10495,6 +10528,9 @@ static void rt2800_calibration_rt6352_st
|
||||
rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
}
|
||||
|
||||
@ -222,7 +223,7 @@
|
||||
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
@@ -10545,31 +10580,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10585,31 +10621,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write(rt2x00dev, 42, 0x5B);
|
||||
rt2800_rfcsr_write(rt2x00dev, 43, 0x00);
|
||||
|
||||
@ -284,7 +285,7 @@
|
||||
|
||||
/* Initialize RF channel register to default value */
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03);
|
||||
@@ -10635,63 +10675,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10675,63 +10716,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5);
|
||||
|
||||
@ -411,7 +412,7 @@
|
||||
|
||||
/* Initialize RF DC calibration register to default value */
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47);
|
||||
@@ -10754,12 +10802,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10794,12 +10843,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00);
|
||||
|
||||
@ -431,6 +432,6 @@
|
||||
+ 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)
|
||||
|
Loading…
Reference in New Issue
Block a user