ath9k: Cleanup IQ calibration for PCOEM chips
PATCH 1/4 ath9k: Cleanup IQ calibration for PCOEM chips
From: Sujith Manoharan <[email protected]>
Since IQ calibration is done as part of AGC calibration for AR9485 and above, remove the seperate IQ calibration code.
Signed-off-by Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_calib.c +1 -11
@@ -1047,7 +1047,7 @@ static bool ar9003_hw_init_cal_pcoem(struct ath_hw *ah,struct ath9k_hw_cal_data *caldata = ah->caldata;bool txiqcal_done = false;bool is_reusable = true, status = true; -bool run_rtt_cal = false, run_agc_cal, sep_iq_cal = false; +bool run_rtt_cal = false, run_agc_cal;bool rtt = !!(ah->caps.hw_caps &ATH9K_HW_CAP_RTT );u32 rx_delay =0 ; u32 agc_ctrl = 0, agc_supp_cals = AR_PHY_AGC_CONTROL_OFFSET_CAL |
@@ -1119,22 +1119,12 @@ static bool ar9003_hw_init_cal_pcoem(struct ath_hw *ah,REG_CLR_BIT (ah,AR_PHY_TX_IQCAL_CONTROL_0 ,AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL ); txiqcal_done = run_agc_cal = true; - }else if (caldata && !test_bit (TXIQCAL_DONE , &caldata->cal_flags)) { - run_agc_cal = true; - sep_iq_cal = true; } skip_tx_iqcal:if (ath9k_hw_mci_is_enabled (ah) &&IS_CHAN_2GHZ (chan) && run_agc_cal)ar9003_mci_init_cal_req (ah, &is_reusable); -if (sep_iq_cal) { - txiqcal_done =ar9003_hw_tx_iq_cal_run (ah); -REG_WRITE (ah,AR_PHY_ACTIVE ,AR_PHY_ACTIVE_DIS ); -udelay (5 ); -REG_WRITE (ah,AR_PHY_ACTIVE ,AR_PHY_ACTIVE_EN ); - } -if (REG_READ (ah,AR_PHY_CL_CAL_CTL ) &AR_PHY_CL_CAL_ENABLE ) { rx_delay =REG_READ (ah,AR_PHY_RX_DELAY );/* Disable BB_active */
Signature · 1 line
1.8.4.2
PATCH 2/4 ath9k: Add initvals for AR9565 1.1
From: Sujith Manoharan <[email protected]>
The initialization arrays for v1.1 AR9565
are mostly the same as v1.0/v1.0.1 except forradio_postamble.
Signed-off-by Sujith Manoharan <[email protected]>
--- .../net/wireless/ath/ath9k/ar9565_1p1_initvals.h | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 drivers/net/wireless/ath/ath9k/ar9565_1p1_initvals.h
drivers/net/wireless/ath/ath9k/ar9565_1p1_initvals.h new file +64 -0
@@ -0,0 +1,64 @@ +/* +* Copyright (c) 2010-2011 Atheros Communications Inc. +* Copyright (c) 2011-2012 Qualcomm Atheros Inc. +* +* Permission to use, copy, modify, and/or distribute this software for any +* purpose with or without fee is hereby granted, provided that the above +* copyright notice and this permission notice appear in all copies. +* +* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifndef INITVALS_9565_1P1_H +#define INITVALS_9565_1P1_H + +/* AR9565 1.1 */ + +#define ar9565_1p1_mac_core ar9565_1p0_mac_core + +#define ar9565_1p1_mac_postamble ar9565_1p0_mac_postamble + +#define ar9565_1p1_baseband_core ar9565_1p0_baseband_core + +#define ar9565_1p1_baseband_postamble ar9565_1p0_baseband_postamble + +#define ar9565_1p1_radio_core ar9565_1p0_radio_core + +#define ar9565_1p1_soc_preamble ar9565_1p0_soc_preamble + +#define ar9565_1p1_soc_postamble ar9565_1p0_soc_postamble + +#define ar9565_1p1_Common_rx_gain_table ar9565_1p0_Common_rx_gain_table + +#define ar9565_1p1_Modes_lowest_ob_db_tx_gain_table ar9565_1p0_Modes_lowest_ob_db_tx_gain_table + +#define ar9565_1p1_pciephy_clkreq_disable_L1 ar9565_1p0_pciephy_clkreq_disable_L1 + +#define ar9565_1p1_modes_fast_clock ar9565_1p0_modes_fast_clock + +#define ar9565_1p1_common_wo_xlna_rx_gain_table ar9565_1p0_common_wo_xlna_rx_gain_table + +#define ar9565_1p1_modes_low_ob_db_tx_gain_table ar9565_1p0_modes_low_ob_db_tx_gain_table + +#define ar9565_1p1_modes_high_ob_db_tx_gain_table ar9565_1p0_modes_high_ob_db_tx_gain_table + +#define ar9565_1p1_modes_high_power_tx_gain_table ar9565_1p0_modes_high_power_tx_gain_table + +#define ar9565_1p1_baseband_core_txfir_coeff_japan_2484 ar9565_1p0_baseband_core_txfir_coeff_japan_2484 + +static const u32 ar9565_1p1_radio_postamble[][5 ] = { +/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ + {0x0001609c ,0x0b8ee524 ,0x0b8ee524 ,0x0b8ee524 ,0x0b8ee524 }, + {0x000160ac ,0xa4646c08 ,0xa4646c08 ,0x24645808 ,0x24645808 }, + {0x000160b0 ,0x01d67f70 ,0x01d67f70 ,0x01d67f70 ,0x01d67f70 }, + {0x0001610c ,0x40000000 ,0x40000000 ,0x40000000 ,0x40000000 }, + {0x00016140 ,0x10804008 ,0x10804008 ,0x50804008 ,0x50804008 }, +}; + +#endif /* INITVALS_9565_1P1_H */
Signature · 1 line
1.8.4.2
PATCH 3/4 ath9k: Add version macros for AR9565 1.1
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Signed-off-by Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/reg.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/reg.h +11 -1
@@ -809,6 +809,8 @@#define AR_SREV_REVISION_9462_21 3#define AR_SREV_VERSION_9565 0x2C0#define AR_SREV_REVISION_9565_10 0 +#define AR_SREV_REVISION_9565_101 1 +#define AR_SREV_REVISION_9565_11 2#define AR_SREV_VERSION_9550 0x400#define AR_SREV_5416 (_ah) \
@@ -927,10 +929,18 @@#define AR_SREV_9565 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565)) -#define AR_SREV_9565_10 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10)) +#define AR_SREV_9565_101 (_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101)) +#define AR_SREV_9565_11 (_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11)) +#define AR_SREV_9565_11_OR_LATER (_ah) \ + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11))#define AR_SREV_9550 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550))
Signature · 1 line
1.8.4.2
PATCH 4/4 ath9k: Attach INI arrays for AR9565 v1.1
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Signed-off-by Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar9003_hw.c | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
drivers/net/wireless/ath/ath9k/ar9003_hw.c +54 -0
@@ -26,6 +26,7 @@#include "ar9462_2p0_initvals.h" #include "ar9462_2p1_initvals.h" #include "ar9565_1p0_initvals.h" +#include "ar9565_1p1_initvals.h" /* General hardware code for the AR9003 hadware family */
@@ -335,6 +336,41 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)INIT_INI_ARRAY (&ah->iniModesFastClock, ar9580_1p0_modes_fast_clock); + }else if (AR_SREV_9565_11_OR_LATER (ah)) { +INIT_INI_ARRAY (&ah->iniMac[ATH_INI_CORE ], + ar9565_1p1_mac_core); +INIT_INI_ARRAY (&ah->iniMac[ATH_INI_POST ], + ar9565_1p1_mac_postamble); + +INIT_INI_ARRAY (&ah->iniBB[ATH_INI_CORE ], + ar9565_1p1_baseband_core); +INIT_INI_ARRAY (&ah->iniBB[ATH_INI_POST ], + ar9565_1p1_baseband_postamble); + +INIT_INI_ARRAY (&ah->iniRadio[ATH_INI_CORE ], + ar9565_1p1_radio_core); +INIT_INI_ARRAY (&ah->iniRadio[ATH_INI_POST ], + ar9565_1p1_radio_postamble); + +INIT_INI_ARRAY (&ah->iniSOC[ATH_INI_PRE ], + ar9565_1p1_soc_preamble); +INIT_INI_ARRAY (&ah->iniSOC[ATH_INI_POST ], + ar9565_1p1_soc_postamble); + +INIT_INI_ARRAY (&ah->iniModesRxGain, + ar9565_1p1_Common_rx_gain_table); +INIT_INI_ARRAY (&ah->iniModesTxGain, + ar9565_1p1_Modes_lowest_ob_db_tx_gain_table); + +INIT_INI_ARRAY (&ah->iniPcieSerdes, + ar9565_1p1_pciephy_clkreq_disable_L1); +INIT_INI_ARRAY (&ah->iniPcieSerdesLowPower, + ar9565_1p1_pciephy_clkreq_disable_L1); + +INIT_INI_ARRAY (&ah->iniModesFastClock, + ar9565_1p1_modes_fast_clock); +INIT_INI_ARRAY (&ah->iniCckfirJapan2484, + ar9565_1p1_baseband_core_txfir_coeff_japan_2484); }else if (AR_SREV_9565 (ah)) {INIT_INI_ARRAY (&ah->iniMac[ATH_INI_CORE ], ar9565_1p0_mac_core);
@@ -445,6 +481,9 @@ static void ar9003_tx_gain_table_mode0(struct ath_hw *ah)else if (AR_SREV_9462_20 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9462_modes_low_ob_db_tx_gain_table_2p0); +else if (AR_SREV_9565_11 (ah)) +INIT_INI_ARRAY (&ah->iniModesTxGain, + ar9565_1p1_modes_low_ob_db_tx_gain_table);else if (AR_SREV_9565 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9565_1p0_modes_low_ob_db_tx_gain_table);
@@ -479,6 +518,9 @@ static void ar9003_tx_gain_table_mode1(struct ath_hw *ah)else if (AR_SREV_9462_20 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9462_modes_high_ob_db_tx_gain_table_2p0); +else if (AR_SREV_9565_11 (ah)) +INIT_INI_ARRAY (&ah->iniModesTxGain, + ar9565_1p1_modes_high_ob_db_tx_gain_table);else if (AR_SREV_9565 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9565_1p0_modes_high_ob_db_tx_gain_table);
@@ -504,6 +546,9 @@ static void ar9003_tx_gain_table_mode2(struct ath_hw *ah)else if (AR_SREV_9580 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9580_1p0_low_ob_db_tx_gain_table); +else if (AR_SREV_9565_11 (ah)) +INIT_INI_ARRAY (&ah->iniModesTxGain, + ar9565_1p1_modes_low_ob_db_tx_gain_table);else if (AR_SREV_9565 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9565_1p0_modes_low_ob_db_tx_gain_table);
@@ -529,6 +574,9 @@ static void ar9003_tx_gain_table_mode3(struct ath_hw *ah)else if (AR_SREV_9580 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9580_1p0_high_power_tx_gain_table); +else if (AR_SREV_9565_11 (ah)) +INIT_INI_ARRAY (&ah->iniModesTxGain, + ar9565_1p1_modes_high_power_tx_gain_table);else if (AR_SREV_9565 (ah))INIT_INI_ARRAY (&ah->iniModesTxGain, ar9565_1p0_modes_high_power_tx_gain_table);
@@ -642,6 +690,9 @@ static void ar9003_rx_gain_table_mode0(struct ath_hw *ah)else if (AR_SREV_9462_20 (ah))INIT_INI_ARRAY (&ah->iniModesRxGain, ar9462_common_rx_gain_table_2p0); +else if (AR_SREV_9565_11 (ah)) +INIT_INI_ARRAY (&ah->iniModesRxGain, + ar9565_1p1_Common_rx_gain_table);else if (AR_SREV_9565 (ah))INIT_INI_ARRAY (&ah->iniModesRxGain, ar9565_1p0_Common_rx_gain_table);
@@ -678,6 +729,9 @@ static void ar9003_rx_gain_table_mode1(struct ath_hw *ah) }else if (AR_SREV_9580 (ah))INIT_INI_ARRAY (&ah->iniModesRxGain, ar9580_1p0_wo_xlna_rx_gain_table); +else if (AR_SREV_9565_11 (ah)) +INIT_INI_ARRAY (&ah->iniModesRxGain, + ar9565_1p1_common_wo_xlna_rx_gain_table);else if (AR_SREV_9565 (ah))INIT_INI_ARRAY (&ah->iniModesRxGain, ar9565_1p0_common_wo_xlna_rx_gain_table);
Signature · 1 line
1.8.4.2