openwrtv4/package
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
..
base-files build: add buildbot specific config option for setting defaults 2017-02-14 14:18:35 +01:00
boot packge/boot/rbcfg: add new boot constants found in the recent Mikrotik devices 2017-02-26 13:31:43 +01:00
devel gdb: update to version 7.12.1, fix glibc 2.25 build issues 2017-02-11 20:34:33 +01:00
firmware ath10k-firmware: update qca9984 firmware 2017-03-03 15:44:55 +01:00
kernel rt2x00: mt7620: yet another beauty session 2017-03-09 17:56:16 +01:00
libs toolchain: Allow external toolchains to specify libthread-db 2017-03-04 11:19:56 -08:00
network dnsmasq: do not forward rfc6761 excluded domains 2017-03-09 10:42:27 +01:00
system procd.sh: use parameterized respawn values 2017-03-07 11:40:36 +01:00
utils ugps: fix and improve init script 2017-03-08 13:32:24 +01:00
Makefile build: skip opkg host dependency within the SDK 2017-02-21 20:43:40 +01:00