mac80211: rt2x00: correct wrong BBP register in RxDCOC calibration
authorShiji Yang <yangshiji66@qq.com>
Thu, 9 Nov 2023 04:42:09 +0000 (12:42 +0800)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 13 Nov 2023 00:55:38 +0000 (00:55 +0000)
This fix can reduce the total calibration time from 6 seconds to
1 second.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
package/kernel/mac80211/patches/rt2x00/101-wifi-rt2x00-correct-wrong-BBP-register-in-RxDCOC-cal.patch [new file with mode: 0644]

diff --git a/package/kernel/mac80211/patches/rt2x00/101-wifi-rt2x00-correct-wrong-BBP-register-in-RxDCOC-cal.patch b/package/kernel/mac80211/patches/rt2x00/101-wifi-rt2x00-correct-wrong-BBP-register-in-RxDCOC-cal.patch
new file mode 100644 (file)
index 0000000..253d1d9
--- /dev/null
@@ -0,0 +1,26 @@
+From: Shiji Yang <yangshiji66@outlook.com>
+Date: Thu, 9 Nov 2023 12:01:18 +0800
+Subject: [PATCH] wifi: rt2x00: correct wrong BBP register in RxDCOC
+ calibration
+
+Refer to Mediatek vendor driver RxDCOC_Calibration() function, when
+performing gainfreeze calibration, we should write register 140
+instead of 141. This fix can reduce the total calibration time from
+6 seconds to 1 second.
+
+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
+@@ -8711,7 +8711,7 @@ static void rt2800_rxdcoc_calibration(st
+       rt2800_rfcsr_write_bank(rt2x00dev, 5, 4, saverfb5r4);
+       rt2800_rfcsr_write_bank(rt2x00dev, 7, 4, saverfb7r4);
+-      rt2800_bbp_write(rt2x00dev, 158, 141);
++      rt2800_bbp_write(rt2x00dev, 158, 140);
+       bbpreg = rt2800_bbp_read(rt2x00dev, 159);
+       bbpreg = bbpreg & (~0x40);
+       rt2800_bbp_write(rt2x00dev, 159, bbpreg);