60de2b6d147f0c77b58c3e5992df9d8014a9e17d
[openwrt/staging/lynxis.git] / package / kernel / mac80211 / patches / 326-ath9k-fix-ar934x-OTP-offsets.patch
1 From: Christian Lamparter <chunkeey@googlemail.com>
2 Date: Tue, 14 Feb 2017 20:10:30 +0100
3 Subject: ath9k: use correct OTP register offsets for the AR9340 and AR9550
4
5 This patch fixes the OTP register definitions for the AR934x and AR9550
6 WMAC SoC.
7
8 Previously, the ath9k driver was unable to initialize the integrated
9 WMAC on an Aerohive AP121:
10
11 | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
12 | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
13 | ath: phy0: Unable to initialize hardware; initialization status: -5
14 | ath9k ar934x_wmac: failed to initialize device
15 | ath9k: probe of ar934x_wmac failed with error -5
16
17 It turns out that the AR9300_OTP_STATUS and AR9300_OTP_DATA
18 definitions contain a typo.
19
20 Fixes: add295a4afbdf5852d0 "ath9k: use correct OTP register offsets for AR9550"
21 Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
22 Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
23 ---
24
25 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
26 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
27 @@ -75,13 +75,13 @@
28 #define AR9300_OTP_BASE \
29 ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000)
30 #define AR9300_OTP_STATUS \
31 - ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18)
32 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x31018 : 0x15f18)
33 #define AR9300_OTP_STATUS_TYPE 0x7
34 #define AR9300_OTP_STATUS_VALID 0x4
35 #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
36 #define AR9300_OTP_STATUS_SM_BUSY 0x1
37 #define AR9300_OTP_READ_DATA \
38 - ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c)
39 + ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3101c : 0x15f1c)
40
41 enum targetPowerHTRates {
42 HT_TARGET_RATE_0_8_16,