ath9k_hw: Define devid and mac version for AR9340
PATCH v2 1/22 ath9k_hw: Define devid and mac version for AR9340
Signed-off-by Vasanthakumar Thiagarajan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 2 +- drivers/net/wireless/ath/ath9k/hw.h | 1 + drivers/net/wireless/ath/ath9k/reg.h | 4 ++++ 3 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +1 -1
@@ -552,7 +552,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)return -EOPNOTSUPP ; } -if (AR_SREV_9271 (ah) ||AR_SREV_9100 (ah)) +if (AR_SREV_9271 (ah) ||AR_SREV_9100 (ah) ||AR_SREV_9340 (ah)) ah->is_pciexpress = false; ah->hw_version.phyRev =REG_READ (ah,AR_PHY_CHIP_ID );
drivers/net/wireless/ath/ath9k/hw.h +1 -0
@@ -43,6 +43,7 @@#define AR9287_DEVID_PCI 0x002d#define AR9287_DEVID_PCIE 0x002e#define AR9300_DEVID_PCIE 0x0030 +#define AR9300_DEVID_AR9340 0x0031#define AR9300_DEVID_AR9485_PCIE 0x0032#define AR5416_AR9100_DEVID 0x000b
drivers/net/wireless/ath/ath9k/reg.h +4 -0
@@ -790,6 +790,7 @@#define AR_SREV_VERSION_9485 0x240#define AR_SREV_REVISION_9485_10 0#define AR_SREV_REVISION_9485_11 1 +#define AR_SREV_VERSION_9340 0x300#define AR_SREV_5416 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \
@@ -869,6 +870,9 @@ (AR_SREV_9485 (_ah) && \ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9485_11)) +#define AR_SREV_9340 (_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340)) +#define AR_SREV_9285E_20 (_ah) \ (AR_SREV_9285_12_OR_LATER(_ah) && \ ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
Signature · 1 line
1.7.0.4
PATCH v2 6/22 ath9k_hw: Initialize mode registers from initvals.h for AR9340
Signed-off-by Vasanthakumar Thiagarajan <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar9003_hw.c | 59 ++++++++++++++++++++++++++- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 3 + drivers/net/wireless/ath/ath9k/hw.h | 1 + 3 files changed, 62 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_hw.c +58 -1
@@ -18,6 +18,7 @@#include "ar9003_mac.h" #include "ar9003_2p2_initvals.h" #include "ar9485_initvals.h" +#include "ar9340_initvals.h" /* General hardware code for the AR9003 hadware family */
@@ -28,7 +29,63 @@*/ static void ar9003_hw_init_mode_regs (struct ath_hw *ah) { -if (AR_SREV_9485_11 (ah)) { +if (AR_SREV_9340 (ah)) { +/* mac */ +INIT_INI_ARRAY (&ah->iniMac[ATH_INI_PRE ],NULL ,0 ,0 ); +INIT_INI_ARRAY (&ah->iniMac[ATH_INI_CORE ], + ar9340_1p0_mac_core, +ARRAY_SIZE (ar9340_1p0_mac_core),2 ); +INIT_INI_ARRAY (&ah->iniMac[ATH_INI_POST ], + ar9340_1p0_mac_postamble, +ARRAY_SIZE (ar9340_1p0_mac_postamble),5 ); + +/* bb */ +INIT_INI_ARRAY (&ah->iniBB[ATH_INI_PRE ],NULL ,0 ,0 ); +INIT_INI_ARRAY (&ah->iniBB[ATH_INI_CORE ], + ar9340_1p0_baseband_core, +ARRAY_SIZE (ar9340_1p0_baseband_core),2 ); +INIT_INI_ARRAY (&ah->iniBB[ATH_INI_POST ], + ar9340_1p0_baseband_postamble, +ARRAY_SIZE (ar9340_1p0_baseband_postamble),5 ); + +/* radio */ +INIT_INI_ARRAY (&ah->iniRadio[ATH_INI_PRE ],NULL ,0 ,0 ); +INIT_INI_ARRAY (&ah->iniRadio[ATH_INI_CORE ], + ar9340_1p0_radio_core, +ARRAY_SIZE (ar9340_1p0_radio_core),2 ); +INIT_INI_ARRAY (&ah->iniRadio[ATH_INI_POST ], + ar9340_1p0_radio_postamble, +ARRAY_SIZE (ar9340_1p0_radio_postamble),5 ); + +/* soc */ +INIT_INI_ARRAY (&ah->iniSOC[ATH_INI_PRE ], + ar9340_1p0_soc_preamble, +ARRAY_SIZE (ar9340_1p0_soc_preamble),2 ); +INIT_INI_ARRAY (&ah->iniSOC[ATH_INI_CORE ],NULL ,0 ,0 ); +INIT_INI_ARRAY (&ah->iniSOC[ATH_INI_POST ], + ar9340_1p0_soc_postamble, +ARRAY_SIZE (ar9340_1p0_soc_postamble),5 ); + +/* rx/tx gain */ +INIT_INI_ARRAY (&ah->iniModesRxGain, + ar9340Common_wo_xlna_rx_gain_table_1p0, +ARRAY_SIZE (ar9340Common_wo_xlna_rx_gain_table_1p0), +5 ); +INIT_INI_ARRAY (&ah->iniModesTxGain, + ar9340Modes_high_ob_db_tx_gain_table_1p0, +ARRAY_SIZE (ar9340Modes_high_ob_db_tx_gain_table_1p0), +5 ); + +INIT_INI_ARRAY (&ah->iniModesAdditional, + ar9340Modes_fast_clock_1p0, +ARRAY_SIZE (ar9340Modes_fast_clock_1p0), +3 ); + +INIT_INI_ARRAY (&ah->iniModesAdditional_40M, + ar9340_1p0_radio_core_40M, +ARRAY_SIZE (ar9340_1p0_radio_core_40M), +2 ); + }else if (AR_SREV_9485_11 (ah)) {/* mac */ INIT_INI_ARRAY (&ah->iniMac[ATH_INI_PRE ],NULL ,0 ,0 ); INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
drivers/net/wireless/ath/ath9k/ar9003_phy.c +3 -0
@@ -646,6 +646,9 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,REG_WRITE_ARRAY (&ah->iniModesAdditional, modesIndex, regWrites); +if (AR_SREV_9340 (ah) && !ah->is_clk_25mhz) +REG_WRITE_ARRAY (&ah->iniModesAdditional_40M,1 , regWrites); +ar9003_hw_override_ini (ah);ar9003_hw_set_channel_regs (ah, chan);ar9003_hw_set_chain_masks (ah, ah->rxchainmask, ah->txchainmask);
drivers/net/wireless/ath/ath9k/hw.h +1 -0
@@ -799,6 +799,7 @@ struct ath_hw {struct ar5416IniArray iniPcieSerdes;struct ar5416IniArray iniPcieSerdesLowPower;struct ar5416IniArray iniModesAdditional; +struct ar5416IniArray iniModesAdditional_40M;struct ar5416IniArray iniModesRxGain;struct ar5416IniArray iniModesTxGain;struct ar5416IniArray iniModes_9271_1_0_only;
Signature · 1 line
1.7.0.4
PATCH v2 7/22 ath9k_hw: Don't do ani initialization for AR9340
In reply to Vasanthakumar ThiagarajanSigned-off-by Vasanthakumar Thiagarajan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +1 -1
@@ -462,7 +462,7 @@ static int ath9k_hw_post_init(struct ath_hw *ah)return ecode; } -if (!AR_SREV_9100 (ah)) { +if (!AR_SREV_9100 (ah) && !AR_SREV_9340 (ah)) {ath9k_hw_ani_setup (ah);ath9k_hw_ani_init (ah); }
Signature · 1 line
1.7.0.4
PATCH v2 12/22 ath9k_hw: Fix register offset AR_PHY_65NM_CH0_THERM for AR9340
In reply to Vasanthakumar ThiagarajanSigned-off-by Vasanthakumar Thiagarajan <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar9003_phy.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_phy.h +1 -1
@@ -588,7 +588,7 @@#define AR_PHY_65NM_CH0_BIAS2 0x160c4#define AR_PHY_65NM_CH0_BIAS4 0x160cc#define AR_PHY_65NM_CH0_RXTX4 0x1610c -#define AR_PHY_65NM_CH0_THERM (AR_SREV_9485(ah) ? 0x1628c : 0x16290) +#define AR_PHY_65NM_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 : 0x1628c)#define AR_PHY_65NM_CH0_THERM_LOCAL 0x80000000#define AR_PHY_65NM_CH0_THERM_LOCAL_S 31
Signature · 1 line
1.7.0.4
PATCH v2 20/22 ath9k_hw: Assign macversion based on devid for built-in wmac
In reply to Vasanthakumar ThiagarajanSigned-off-by Vasanthakumar Thiagarajan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +11 -3
@@ -247,6 +247,17 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah) {u32 val; +switch (ah->hw_version.devid) { +case AR5416_AR9100_DEVID : + ah->hw_version.macVersion =AR_SREV_VERSION_9100 ; +break ; +case AR9300_DEVID_AR9340 : + ah->hw_version.macVersion =AR_SREV_VERSION_9340 ; + val =REG_READ (ah,AR_SREV ); + ah->hw_version.macRev =MS (val,AR_SREV_REVISION2 ); +return ; + } + val =REG_READ (ah,AR_SREV ) &AR_SREV_ID ;if (val ==0xFF ) {
@@ -484,9 +495,6 @@ static int __ath9k_hw_init(struct ath_hw *ah)struct ath_common *common =ath9k_hw_common (ah);int r =0 ; -if (ah->hw_version.devid ==AR5416_AR9100_DEVID ) - ah->hw_version.macVersion =AR_SREV_VERSION_9100 ; -ath9k_hw_read_revisions (ah);/*
Signature · 1 line
1.7.0.4