2017-02-14 19:10:33

by Christian Lamparter

[permalink] [raw]
Subject: [PATCH] ath9k: use correct OTP register offsets for the AR9340 and AR9550

This patch fixes the OTP register definitions for the AR934x and AR9550
WMAC SoC.

Previously, the ath9k driver was unable to initialize the integrated
WMAC on an Aerohive AP121:

| ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
| ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
| ath: phy0: Unable to initialize hardware; initialization status: -5
| ath9k ar934x_wmac: failed to initialize device
| ath9k: probe of ar934x_wmac failed with error -5

It turns out that the AR9300_OTP_STATUS and AR9300_OTP_DATA
definitions contain a typo.

Cc: Gabor Juhos <[email protected]>
Cc: [email protected]
Fixes: add295a4afbdf5852d0 "ath9k: use correct OTP register offsets for AR9550"
Signed-off-by: Christian Lamparter <[email protected]>
Signed-off-by: Chris Blake <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
index 7dc7205dc877..bd2269c7de6b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
@@ -75,13 +75,13 @@
#define AR9300_OTP_BASE \
((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000)
#define AR9300_OTP_STATUS \
- ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18)
+ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x31018 : 0x15f18)
#define AR9300_OTP_STATUS_TYPE 0x7
#define AR9300_OTP_STATUS_VALID 0x4
#define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
#define AR9300_OTP_STATUS_SM_BUSY 0x1
#define AR9300_OTP_READ_DATA \
- ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c)
+ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3101c : 0x15f1c)

enum targetPowerHTRates {
HT_TARGET_RATE_0_8_16,
--
2.11.0


2017-02-15 09:22:29

by Kalle Valo

[permalink] [raw]
Subject: Re: ath9k: use correct OTP register offsets for the AR9340 and AR9550

Christian Lamparter <[email protected]> wrote:
> This patch fixes the OTP register definitions for the AR934x and AR9550
> WMAC SoC.
>
> Previously, the ath9k driver was unable to initialize the integrated
> WMAC on an Aerohive AP121:
>
> | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
> | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
> | ath: phy0: Unable to initialize hardware; initialization status: -5
> | ath9k ar934x_wmac: failed to initialize device
> | ath9k: probe of ar934x_wmac failed with error -5
>
> It turns out that the AR9300_OTP_STATUS and AR9300_OTP_DATA
> definitions contain a typo.
>
> Cc: Gabor Juhos <[email protected]>
> Cc: [email protected]
> Fixes: add295a4afbdf5852d0 "ath9k: use correct OTP register offsets for AR9550"
> Signed-off-by: Christian Lamparter <[email protected]>
> Signed-off-by: Chris Blake <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

c9f1e3260081 ath9k: use correct OTP register offsets for the AR9340 and AR9550

--
https://patchwork.kernel.org/patch/9572541/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches