openwrtv4/package/kernel
Daniel Golle 181bc02d2e rt2x00: mt7620: yet another beauty session
So here is another round of improvements for MT7620 WiFi.

This commit fixes a few significant issues related to TX_PWR_CFG_x and
TX_ALC and also makes the code more readable by adding register
descriptions for things added for MT7620 and use the usual bit-field
access macros and the now defined macros instead of plain bit-ops and
magic numbers.

Properly describe EEPROM_TARGET_POWER at word 0x68 (== byte 0xD0) and
thereby fix internal TXALC which would otherwise just read
out-of-bounds of the EEPROM map.

Split-out tx-power/ALC related stuff into an additional function.
Fix VCO calibration, it was carried out properly in the channel
switching but incomplete in the actual VCO calibration function.
Also there is no need to trigger VCO calibration in channel switching,
the VCO calibration function is already being called at this point.
Remove it from channel switching function to avoid redundant code.

The TX power calibration differs significantly from all other
Mediatek/Ralink chips: They finally allow 0.5dB steps stored as 8-bit
values for (almost) each bitrate -- and promptly ran out of space and
for some reason didn't want to change the EEPROM layout. The hence
opted for a scheme of sharing values for some adjecent bitrates and
a highly over-complicated (or obfuscated?) way to populate the
TX_PWR_CFG_x registers with the values stored in the EEPROM.
The code here now looks much less complicated than what you see in the
vendor's driver, however, it does the exact same thing:
bGpwrdeltaMinus is a constant and always TRUE, hence half of the
code was dead. Gpwrdelta is always 0 (rather than using the value read
from the EEPROM). What remains is some very grotesque effort to avoid
0x20, probably some hardware bug related to some misunderstanding of
what a singed 8-bit value is (imagine: if it was a signed 6-bit value
then someone could believe that 0x20 == 0x0). And then they didn't
clean it up once they later on anandonned that whole story of having a
constant offset for 40 MHz channels and just set the offset to be
constant 0 -- there is no effort for avoiding 0x20 for the 20 MHz
values stored in the EEPROM, hence that's probably just a forbidden
value in the EEPROM specs and won't appear anyway...
Anyway, the whole thing felt like solving some college math test
where in the end everything cancels out and the result equals 0 ;)
To make sure that channel bandwidth power compensation really doesn't
need to be taken care of, output a warning when the corresponding
value stored in the EEPROM is non-zero.

Also there is no apparent reason to refrain from initializing RFCSR
register 13, it doesn't fail what-so-ever.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-03-09 17:56:16 +01:00
..
acx-mac80211 acx-mac80211: fix scan API error that could lead to a crash 2017-02-03 12:35:44 +01:00
ar7-atm treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
ath10k-ct ath10k-ct: depend on kmod-hwmon-core, it gets used when CONFIG_THERMAL is set 2017-02-01 17:49:54 +01:00
avila-wdt kernel/avila-wdt: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:52 +02:00
brcm2708-gpu-fw brcm2708-gpu-fw: update to latest version 2017-03-04 19:40:49 +01:00
broadcom-wl treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
button-hotplug kernel/button-hotplug: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:52 +02:00
gpio-button-hotplug gpio-button-hotplug: add more buttons 2016-11-27 15:34:23 +01:00
gpio-nct5104d gpio-nct5104d: add compatibility for linux 4.9 2017-02-01 17:49:52 +01:00
hwmon-gsc kernel: move the gateworks system controller driver to an out-of-tree package 2017-01-10 12:10:20 +01:00
i2c-gpio-custom kernel/i2c-gpio-custom: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:52 +02:00
kmod-sched-cake kmod-sched-cake: Bump to latest version 2017-01-30 16:30:41 +01:00
lantiq ltq-ptm: use netif_trans_update() only for kernel >= 4.7 2017-02-12 01:26:33 +01:00
leds-apu2 leds-apu2: add compatibility for linux 4.9 2017-02-01 17:49:52 +01:00
linux ar71xx: fix build without CONFIG_NOP_USB_XCEIV (FS#593) 2017-03-07 11:37:50 +01:00
mac80211 rt2x00: mt7620: yet another beauty session 2017-03-09 17:56:16 +01:00
mt76 mt76: split kmod package 2017-02-23 15:56:57 +01:00
mwlwifi mwlwifi: Fixes rewritten history hash and latest version 2017-01-26 13:53:57 +01:00
om-watchdog package/om-watchdog: add OpenMesh A40 support 2017-02-14 12:18:05 +01:00
rotary-gpio-custom rotary-gpio-custom: depend on Linux 3.18 and 4.4 (will not work on newer kernels) 2017-02-01 17:49:53 +01:00
rtc-rv5c386a rtc-rv5c386a: fix include path for bcm47xx_nvram.h 2016-11-30 12:47:25 +01:00
spi-gpio-custom kernel/spi-gpio-custom: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:53 +02:00
trelay kernel/trelay: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:53 +02:00
w1-gpio-custom kernel/w1-gpio-custom: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:53 +02:00
wrt55agv2-spidevs kernel/wrt55agv2-spidevs: drop Build/Prepare rule in favor of default one 2016-10-15 11:36:53 +02:00