aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 14:04:43 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:52:34 -0500
commitb405086ba47678a5b8f6e7cd835a3d27ebb6f744 (patch)
treeac24001381f96e48dc2f1cd02679ba718754a8a3 /drivers/net
parent325089ab5847f5c1e43f42bb90d32f981867c4c1 (diff)
ath5k: Increase PHY settling parameters for turo mode
* On turbo mode increase PHY settling times, note that we only increase switch settling time on AR5212 as indicated by initvals. * A few cleanups: Move frame control settings for AR5210 from reset_tx_queue to tweak_initvals and remove phy_scal settings from tweak_initvals (we tweak them alread on set_sleep_clock). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h14
-rw-r--r--drivers/net/wireless/ath/ath5k/qcu.c13
-rw-r--r--drivers/net/wireless/ath/ath5k/reg.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/reset.c52
4 files changed, 52 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index c9535447a8ab..005cad025170 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -259,15 +259,23 @@
259#define AR5K_INIT_TX_LAT_BG 384 259#define AR5K_INIT_TX_LAT_BG 384
260/* Tx latency for 40MHz (turbo) operation (min ?) */ 260/* Tx latency for 40MHz (turbo) operation (min ?) */
261#define AR5K_INIT_TX_LAT_MIN 32 261#define AR5K_INIT_TX_LAT_MIN 32
262/* Default Tx/Rx latencies (same for 5211)*/
263#define AR5K_INIT_TX_LATENCY_5210 54
264#define AR5K_INIT_RX_LATENCY_5210 29
262 265
263/* Tx frame to Tx data start delay */ 266/* Tx frame to Tx data start delay */
264#define AR5K_INIT_TXF2TXD_START_DEFAULT 14 267#define AR5K_INIT_TXF2TXD_START_DEFAULT 14
265#define AR5K_INIT_TXF2TXD_START_DELAY_10MHZ 12 268#define AR5K_INIT_TXF2TXD_START_DELAY_10MHZ 12
266#define AR5K_INIT_TXF2TXD_START_DELAY_5MHZ 13 269#define AR5K_INIT_TXF2TXD_START_DELAY_5MHZ 13
267 270
268/* Default Tx/Rx latencies (same for 5211)*/ 271/* We need to increase PHY switch and agc settling time
269#define AR5K_INIT_TX_LATENCY_5210 54 272 * on turbo mode */
270#define AR5K_INIT_RX_LATENCY_5210 29 273#define AR5K_SWITCH_SETTLING 5760
274#define AR5K_SWITCH_SETTLING_TURBO 7168
275
276#define AR5K_AGC_SETTLING 28
277/* 38 on 5210 but shouldn't matter */
278#define AR5K_AGC_SETTLING_TURBO 37
271 279
272 280
273/* GENERIC CHIPSET DEFINITIONS */ 281/* GENERIC CHIPSET DEFINITIONS */
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index f89bc9403f8f..00c490833ba7 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -271,19 +271,6 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
271 ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ? 271 ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
272 AR5K_INIT_PROTO_TIME_CNTRL_TURBO : 272 AR5K_INIT_PROTO_TIME_CNTRL_TURBO :
273 AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1); 273 AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1);
274 /* Set AR5K_PHY_SETTLING */
275 ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
276 (ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F)
277 | 0x38 :
278 (ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F)
279 | 0x1C,
280 AR5K_PHY_SETTLING);
281 /* Set Frame Control Register */
282 ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
283 (AR5K_PHY_FRAME_CTL_INI | AR5K_PHY_TURBO_MODE |
284 AR5K_PHY_TURBO_SHORT | 0x2020) :
285 (AR5K_PHY_FRAME_CTL_INI | 0x1020),
286 AR5K_PHY_FRAME_CTL_5210);
287 } 274 }
288 275
289 /* 276 /*
diff --git a/drivers/net/wireless/ath/ath5k/reg.h b/drivers/net/wireless/ath/ath5k/reg.h
index 4d610617af3c..dc213bb121e6 100644
--- a/drivers/net/wireless/ath/ath5k/reg.h
+++ b/drivers/net/wireless/ath/ath5k/reg.h
@@ -2245,6 +2245,8 @@
2245#define AR5K_PHY_FRAME_CTL (ah->ah_version == AR5K_AR5210 ? \ 2245#define AR5K_PHY_FRAME_CTL (ah->ah_version == AR5K_AR5210 ? \
2246 AR5K_PHY_FRAME_CTL_5210 : AR5K_PHY_FRAME_CTL_5211) 2246 AR5K_PHY_FRAME_CTL_5210 : AR5K_PHY_FRAME_CTL_5211)
2247/*---[5111+]---*/ 2247/*---[5111+]---*/
2248#define AR5K_PHY_FRAME_CTL_WIN_LEN 0x00000003 /* Force window length (?) */
2249#define AR5K_PHY_FRAME_CTL_WIN_LEN_S 0
2248#define AR5K_PHY_FRAME_CTL_TX_CLIP 0x00000038 /* Mask for tx clip (?) */ 2250#define AR5K_PHY_FRAME_CTL_TX_CLIP 0x00000038 /* Mask for tx clip (?) */
2249#define AR5K_PHY_FRAME_CTL_TX_CLIP_S 3 2251#define AR5K_PHY_FRAME_CTL_TX_CLIP_S 3
2250#define AR5K_PHY_FRAME_CTL_PREP_CHINFO 0x00010000 /* Prepend chan info */ 2252#define AR5K_PHY_FRAME_CTL_PREP_CHINFO 0x00010000 /* Prepend chan info */
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index c9e5bad7cffc..c871d40b1ad7 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -688,19 +688,6 @@ static void ath5k_hw_tweak_initval_settings(struct ath5k_hw *ah,
688 AR5K_REG_DISABLE_BITS(ah, AR5K_TXCFG, 688 AR5K_REG_DISABLE_BITS(ah, AR5K_TXCFG,
689 AR5K_TXCFG_DCU_DBL_BUF_DIS); 689 AR5K_TXCFG_DCU_DBL_BUF_DIS);
690 690
691 /* Set DAC/ADC delays */
692 if (ah->ah_version == AR5K_AR5212) {
693 u32 scal;
694 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
695 if (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4))
696 scal = AR5K_PHY_SCAL_32MHZ_2417;
697 else if (ee->ee_is_hb63)
698 scal = AR5K_PHY_SCAL_32MHZ_HB63;
699 else
700 scal = AR5K_PHY_SCAL_32MHZ;
701 ath5k_hw_reg_write(ah, scal, AR5K_PHY_SCAL);
702 }
703
704 /* Set fast ADC */ 691 /* Set fast ADC */
705 if ((ah->ah_radio == AR5K_RF5413) || 692 if ((ah->ah_radio == AR5K_RF5413) ||
706 (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4))) { 693 (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4))) {
@@ -740,6 +727,45 @@ static void ath5k_hw_tweak_initval_settings(struct ath5k_hw *ah,
740 AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211, 727 AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211,
741 AR5K_DIAG_SW_ECO_ENABLE); 728 AR5K_DIAG_SW_ECO_ENABLE);
742 } 729 }
730
731 if (ah->ah_bwmode) {
732 /* Increase PHY switch and AGC settling time
733 * on turbo mode (ath5k_hw_commit_eeprom_settings
734 * will override settling time if available) */
735 if (ah->ah_bwmode == AR5K_BWMODE_40MHZ) {
736
737 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_SETTLING,
738 AR5K_PHY_SETTLING_AGC,
739 AR5K_AGC_SETTLING_TURBO);
740
741 /* XXX: Initvals indicate we only increase
742 * switch time on AR5212, 5211 and 5210
743 * only change agc time (bug?) */
744 if (ah->ah_version == AR5K_AR5212)
745 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_SETTLING,
746 AR5K_PHY_SETTLING_SWITCH,
747 AR5K_SWITCH_SETTLING_TURBO);
748
749 if (ah->ah_version == AR5K_AR5210) {
750 /* Set Frame Control Register */
751 ath5k_hw_reg_write(ah,
752 (AR5K_PHY_FRAME_CTL_INI |
753 AR5K_PHY_TURBO_MODE |
754 AR5K_PHY_TURBO_SHORT | 0x2020),
755 AR5K_PHY_FRAME_CTL_5210);
756 }
757 /* On 5413 PHY force window length for half/quarter rate*/
758 } else if ((ah->ah_mac_srev >= AR5K_SREV_AR5424) &&
759 (ah->ah_mac_srev <= AR5K_SREV_AR5414)) {
760 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_FRAME_CTL_5211,
761 AR5K_PHY_FRAME_CTL_WIN_LEN,
762 3);
763 }
764 } else if (ah->ah_version == AR5K_AR5210) {
765 /* Set Frame Control Register for normal operation */
766 ath5k_hw_reg_write(ah, (AR5K_PHY_FRAME_CTL_INI | 0x1020),
767 AR5K_PHY_FRAME_CTL_5210);
768 }
743} 769}
744 770
745static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah, 771static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah,