mac80211: rt2x00: experimental improvements for MT7620 wifi
authorDaniel Golle <daniel@makrotopia.org>
Thu, 28 Jul 2022 11:40:12 +0000 (13:40 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 19 Sep 2022 01:48:26 +0000 (02:48 +0100)
commit7c459ac1d5a9a5c507afd7a3205dccfad20883d1
tree24dda31482c091b5583c1d414433b2c2b4407ea4
parentd004110ef7b6a656b59ea7a5ca4a3deb4fc7ef99
mac80211: rt2x00: experimental improvements for MT7620 wifi

Serge Vasilugin reports:

To improve mt7620 built-in wifi performance some changes:
1. Correct BW20/BW40 switching (see comments with mark (1))
2. Correct TX_SW_CFG1 MAC reg from v3 of vendor driver see
https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531
3. Set bbp66 for all chains.
4. US_CYC_CNT init based on Programming guide, default value was 33 (pci),
   set chipset bus clock with fallback to cpu clock/3.
5. Don't overwrite default values for mt7620.
6. Correct some typos.
7. Add support for external LNA:
    a) RF and BBP regs never be corrected for this mode
    b) eLNA is driven the same way as ePA with mt7620's pin PA
but vendor driver explicitly pin PA to gpio mode (for forrect calibration?)
so I'm not sure that request for pa_pin in dts-file will be enough

First 5 changes (really 2) improve performance for boards w/o eLNA/ePA.
Changes 7 add support for eLNA

Configuration w/o eLAN/ePA and with eLNA show results
tx/rx (from router point of view) for each stream:
 35-40/30-35 Mbps for HT20
 65-70/60-65 Mbps for HT40

Yes. Max results for 2T2R client is 140-145/135-140
with peaks 160/150, It correspond to mediatek driver results.
Boards with ePA untested.

Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[directly include v3 of the patchset submitted upstream]
(cherry picked from commit 31a6605de04218e1c04bd5c2436c24d7d1c07506)
(cherry picked from commit e785ca05e9f0502894772f5df92192b816ba5d7c)
(cherry picked from commit 412fcf3d4400f84551f3ead0514834c62d94a251)
48 files changed:
package/kernel/mac80211/patches/rt2x00/001-rt2x00-define-RF5592-in-init_eeprom-routine.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/002-rt2x00-add-throughput-LED-trigger.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/003-rt2x00-add-support-for-external-PA-on-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/004-rt2x00-move-up-and-reuse-busy-wait-functions.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/005-rt2x00-add-RF-self-TXDC-calibration-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/006-rt2x00-add-r-calibration-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/007-rt2x00-add-RXDCOC-calibration-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/008-rt2x00-add-RXIQ-calibration-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/009-rt2x00-don-t-run-Rt5592-IQ-calibration-on-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/010-rt2x00-add-TX-LOFT-calibration-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/011-rt2x00-move-helper-functions-up-in-file.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/012-rt2x00-fix-HT20-HT40-bandwidth-switch-on-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/013-rt2x00-set-correct-TX_SW_CFG1-MAC-register-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/014-rt2x00-set-VGC-gain-for-both-chains-of-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/015-rt2x00-set-SoC-wmac-clock-register.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/016-rt2x00-correctly-set-BBP-register-86-for-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch
package/kernel/mac80211/patches/rt2x00/612-rt2x00-add-throughput-LED-trigger.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-RF-self-TXDC-calibration.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-RXDCOC-calibration.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-RXIQ-calibration.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/990-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/991-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch [deleted file]
package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch [new file with mode: 0644]
target/linux/ramips/dts/mt7620a.dtsi
target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts
target/linux/ramips/dts/mt7620a_cameo_810.dtsi
target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts
target/linux/ramips/dts/mt7620a_fon_fon2601.dts
target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts
target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi
target/linux/ramips/dts/mt7620a_phicomm_k2-v22.4.dts
target/linux/ramips/dts/mt7620a_phicomm_k2-v22.5.dts
target/linux/ramips/dts/mt7620a_phicomm_k2g.dts
target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts
target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts
target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts
target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts
target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts