Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 1 | /* |
Sujith Manoharan | 5b68138 | 2011-05-17 13:36:18 +0530 | [diff] [blame] | 2 | * Copyright (c) 2008-2011 Atheros Communications Inc. |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 15 | */ |
| 16 | |
| 17 | #include "hw.h" |
Luis R. Rodriguez | b622a72 | 2010-04-15 17:39:28 -0400 | [diff] [blame] | 18 | #include "ar9003_mac.h" |
Luis R. Rodriguez | 7284635 | 2010-05-12 21:15:05 -0400 | [diff] [blame] | 19 | #include "ar9003_2p2_initvals.h" |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 20 | #include "ar9485_initvals.h" |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 21 | #include "ar9340_initvals.h" |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 22 | #include "ar9330_1p1_initvals.h" |
| 23 | #include "ar9330_1p2_initvals.h" |
Gabor Juhos | a0fbb9b | 2012-07-03 19:13:22 +0200 | [diff] [blame] | 24 | #include "ar955x_1p0_initvals.h" |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 25 | #include "ar9580_1p0_initvals.h" |
Rajkumar Manoharan | 76db2f8 | 2011-10-13 11:00:43 +0530 | [diff] [blame] | 26 | #include "ar9462_2p0_initvals.h" |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 27 | #include "ar9462_2p1_initvals.h" |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 28 | #include "ar9565_1p0_initvals.h" |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 29 | #include "ar9565_1p1_initvals.h" |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 30 | |
| 31 | /* General hardware code for the AR9003 hadware family */ |
| 32 | |
Luis R. Rodriguez | 886b42b | 2010-10-14 11:44:27 -0700 | [diff] [blame] | 33 | /* |
| 34 | * The AR9003 family uses a new INI format (pre, core, post |
| 35 | * arrays per subsystem). This provides support for the |
| 36 | * AR9003 2.2 chipsets. |
| 37 | */ |
| 38 | static void ar9003_hw_init_mode_regs(struct ath_hw *ah) |
Luis R. Rodriguez | 7284635 | 2010-05-12 21:15:05 -0400 | [diff] [blame] | 39 | { |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 40 | if (AR_SREV_9330_11(ah)) { |
| 41 | /* mac */ |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 42 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 43 | ar9331_1p1_mac_core); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 44 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 45 | ar9331_1p1_mac_postamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 46 | |
| 47 | /* bb */ |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 48 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 49 | ar9331_1p1_baseband_core); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 50 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 51 | ar9331_1p1_baseband_postamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 52 | |
| 53 | /* radio */ |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 54 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 55 | ar9331_1p1_radio_core); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 56 | |
| 57 | /* soc */ |
| 58 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 59 | ar9331_1p1_soc_preamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 60 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 61 | ar9331_1p1_soc_postamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 62 | |
| 63 | /* rx/tx gain */ |
| 64 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 65 | ar9331_common_rx_gain_1p1); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 66 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 67 | ar9331_modes_lowest_ob_db_tx_gain_1p1); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 68 | |
Sujith Manoharan | 57527f8 | 2012-11-13 11:33:53 +0530 | [diff] [blame] | 69 | /* Japan 2484 Mhz CCK */ |
| 70 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 71 | ar9331_1p1_baseband_core_txfir_coeff_japan_2484); |
| 72 | |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 73 | /* additional clock settings */ |
| 74 | if (ah->is_clk_25mhz) |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 75 | INIT_INI_ARRAY(&ah->iniAdditional, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 76 | ar9331_1p1_xtal_25M); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 77 | else |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 78 | INIT_INI_ARRAY(&ah->iniAdditional, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 79 | ar9331_1p1_xtal_40M); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 80 | } else if (AR_SREV_9330_12(ah)) { |
| 81 | /* mac */ |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 82 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 83 | ar9331_1p2_mac_core); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 84 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 85 | ar9331_1p2_mac_postamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 86 | |
| 87 | /* bb */ |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 88 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 89 | ar9331_1p2_baseband_core); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 90 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 91 | ar9331_1p2_baseband_postamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 92 | |
| 93 | /* radio */ |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 94 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 95 | ar9331_1p2_radio_core); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 96 | |
| 97 | /* soc */ |
| 98 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 99 | ar9331_1p2_soc_preamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 100 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 101 | ar9331_1p2_soc_postamble); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 102 | |
| 103 | /* rx/tx gain */ |
| 104 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 105 | ar9331_common_rx_gain_1p2); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 106 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 107 | ar9331_modes_lowest_ob_db_tx_gain_1p2); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 108 | |
Sujith Manoharan | 57527f8 | 2012-11-13 11:33:53 +0530 | [diff] [blame] | 109 | /* Japan 2484 Mhz CCK */ |
| 110 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 111 | ar9331_1p2_baseband_core_txfir_coeff_japan_2484); |
| 112 | |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 113 | /* additional clock settings */ |
| 114 | if (ah->is_clk_25mhz) |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 115 | INIT_INI_ARRAY(&ah->iniAdditional, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 116 | ar9331_1p2_xtal_25M); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 117 | else |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 118 | INIT_INI_ARRAY(&ah->iniAdditional, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 119 | ar9331_1p2_xtal_40M); |
Gabor Juhos | 172805a | 2011-06-21 11:23:26 +0200 | [diff] [blame] | 120 | } else if (AR_SREV_9340(ah)) { |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 121 | /* mac */ |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 122 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 123 | ar9340_1p0_mac_core); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 124 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 125 | ar9340_1p0_mac_postamble); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 126 | |
| 127 | /* bb */ |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 128 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 129 | ar9340_1p0_baseband_core); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 130 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 131 | ar9340_1p0_baseband_postamble); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 132 | |
| 133 | /* radio */ |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 134 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 135 | ar9340_1p0_radio_core); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 136 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 137 | ar9340_1p0_radio_postamble); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 138 | |
| 139 | /* soc */ |
| 140 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 141 | ar9340_1p0_soc_preamble); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 142 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 143 | ar9340_1p0_soc_postamble); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 144 | |
| 145 | /* rx/tx gain */ |
| 146 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 147 | ar9340Common_wo_xlna_rx_gain_table_1p0); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 148 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 149 | ar9340Modes_high_ob_db_tx_gain_table_1p0); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 150 | |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 151 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
Sujith Manoharan | 2c8672c | 2013-12-02 09:56:31 +0530 | [diff] [blame^] | 152 | ar9340Modes_fast_clock_1p0); |
| 153 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 154 | ar9340_1p0_baseband_core_txfir_coeff_japan_2484); |
Vasanthakumar Thiagarajan | d89baac | 2011-04-19 19:29:04 +0530 | [diff] [blame] | 155 | |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 156 | if (!ah->is_clk_25mhz) |
| 157 | INIT_INI_ARRAY(&ah->iniAdditional, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 158 | ar9340_1p0_radio_core_40M); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 159 | } else if (AR_SREV_9485_11_OR_LATER(ah)) { |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 160 | /* mac */ |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 161 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 162 | ar9485_1_1_mac_core); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 163 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 164 | ar9485_1_1_mac_postamble); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 165 | |
| 166 | /* bb */ |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 167 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_PRE], ar9485_1_1); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 168 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 169 | ar9485_1_1_baseband_core); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 170 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 171 | ar9485_1_1_baseband_postamble); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 172 | |
| 173 | /* radio */ |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 174 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 175 | ar9485_1_1_radio_core); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 176 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 177 | ar9485_1_1_radio_postamble); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 178 | |
| 179 | /* soc */ |
| 180 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 181 | ar9485_1_1_soc_preamble); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 182 | |
| 183 | /* rx/tx gain */ |
| 184 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 185 | ar9485Common_wo_xlna_rx_gain_1_1); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 186 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 187 | ar9485_modes_lowest_ob_db_tx_gain_1_1); |
Vivek Natarajan | 1a63e2c | 2011-02-18 16:49:47 +0530 | [diff] [blame] | 188 | |
Sujith Manoharan | 57527f8 | 2012-11-13 11:33:53 +0530 | [diff] [blame] | 189 | /* Japan 2484 Mhz CCK */ |
| 190 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 191 | ar9485_1_1_baseband_core_txfir_coeff_japan_2484); |
| 192 | |
Sujith Manoharan | 2d22c7d | 2013-11-08 11:45:25 +0530 | [diff] [blame] | 193 | if (ah->config.no_pll_pwrsave) { |
| 194 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
| 195 | ar9485_1_1_pcie_phy_clkreq_disable_L1); |
| 196 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
| 197 | ar9485_1_1_pcie_phy_clkreq_disable_L1); |
| 198 | } else { |
| 199 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
| 200 | ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1); |
| 201 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
| 202 | ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1); |
| 203 | } |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 204 | } else if (AR_SREV_9462_21(ah)) { |
| 205 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
| 206 | ar9462_2p1_mac_core); |
| 207 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
| 208 | ar9462_2p1_mac_postamble); |
| 209 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
| 210 | ar9462_2p1_baseband_core); |
| 211 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
| 212 | ar9462_2p1_baseband_postamble); |
| 213 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
| 214 | ar9462_2p1_radio_core); |
| 215 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
| 216 | ar9462_2p1_radio_postamble); |
| 217 | INIT_INI_ARRAY(&ah->ini_radio_post_sys2ant, |
| 218 | ar9462_2p1_radio_postamble_sys2ant); |
| 219 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
| 220 | ar9462_2p1_soc_preamble); |
| 221 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
| 222 | ar9462_2p1_soc_postamble); |
| 223 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 224 | ar9462_2p1_common_rx_gain); |
| 225 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
| 226 | ar9462_2p1_modes_fast_clock); |
| 227 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 228 | ar9462_2p1_baseband_core_txfir_coeff_japan_2484); |
Sujith Manoharan | f51ecd7 | 2013-10-29 11:35:31 +0530 | [diff] [blame] | 229 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
| 230 | ar9462_2p1_pciephy_clkreq_disable_L1); |
| 231 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
| 232 | ar9462_2p1_pciephy_clkreq_disable_L1); |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 233 | } else if (AR_SREV_9462_20(ah)) { |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 234 | |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 235 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9462_2p0_mac_core); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 236 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 237 | ar9462_2p0_mac_postamble); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 238 | |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 239 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 240 | ar9462_2p0_baseband_core); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 241 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 242 | ar9462_2p0_baseband_postamble); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 243 | |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 244 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 245 | ar9462_2p0_radio_core); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 246 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 247 | ar9462_2p0_radio_postamble); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 248 | INIT_INI_ARRAY(&ah->ini_radio_post_sys2ant, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 249 | ar9462_2p0_radio_postamble_sys2ant); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 250 | |
| 251 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 252 | ar9462_2p0_soc_preamble); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 253 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 254 | ar9462_2p0_soc_postamble); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 255 | |
| 256 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 257 | ar9462_2p0_common_rx_gain); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 258 | |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 259 | /* Awake -> Sleep Setting */ |
| 260 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 261 | ar9462_2p0_pciephy_clkreq_disable_L1); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 262 | /* Sleep -> Awake Setting */ |
| 263 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 264 | ar9462_2p0_pciephy_clkreq_disable_L1); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 265 | |
| 266 | /* Fast clock modal settings */ |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 267 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 268 | ar9462_2p0_modes_fast_clock); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 269 | |
| 270 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
Sujith Manoharan | 57527f8 | 2012-11-13 11:33:53 +0530 | [diff] [blame] | 271 | ar9462_2p0_baseband_core_txfir_coeff_japan_2484); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 272 | } else if (AR_SREV_9550(ah)) { |
| 273 | /* mac */ |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 274 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 275 | ar955x_1p0_mac_core); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 276 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 277 | ar955x_1p0_mac_postamble); |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 278 | |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 279 | /* bb */ |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 280 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 281 | ar955x_1p0_baseband_core); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 282 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 283 | ar955x_1p0_baseband_postamble); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 284 | |
| 285 | /* radio */ |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 286 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 287 | ar955x_1p0_radio_core); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 288 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 289 | ar955x_1p0_radio_postamble); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 290 | |
| 291 | /* soc */ |
| 292 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 293 | ar955x_1p0_soc_preamble); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 294 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 295 | ar955x_1p0_soc_postamble); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 296 | |
| 297 | /* rx/tx gain */ |
| 298 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 299 | ar955x_1p0_common_wo_xlna_rx_gain_table); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 300 | INIT_INI_ARRAY(&ah->ini_modes_rx_gain_bounds, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 301 | ar955x_1p0_common_wo_xlna_rx_gain_bounds); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 302 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 303 | ar955x_1p0_modes_xpa_tx_gain_table); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 304 | |
| 305 | /* Fast clock modal settings */ |
| 306 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 307 | ar955x_1p0_modes_fast_clock); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 308 | } else if (AR_SREV_9580(ah)) { |
| 309 | /* mac */ |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 310 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 311 | ar9580_1p0_mac_core); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 312 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 313 | ar9580_1p0_mac_postamble); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 314 | |
| 315 | /* bb */ |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 316 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 317 | ar9580_1p0_baseband_core); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 318 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 319 | ar9580_1p0_baseband_postamble); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 320 | |
| 321 | /* radio */ |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 322 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 323 | ar9580_1p0_radio_core); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 324 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 325 | ar9580_1p0_radio_postamble); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 326 | |
| 327 | /* soc */ |
| 328 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 329 | ar9580_1p0_soc_preamble); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 330 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 331 | ar9580_1p0_soc_postamble); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 332 | |
| 333 | /* rx/tx gain */ |
| 334 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 335 | ar9580_1p0_rx_gain_table); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 336 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 337 | ar9580_1p0_low_ob_db_tx_gain_table); |
Luis R. Rodriguez | 5a63ef0 | 2011-08-24 15:36:08 -0700 | [diff] [blame] | 338 | |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 339 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
Sujith Manoharan | 2c8672c | 2013-12-02 09:56:31 +0530 | [diff] [blame^] | 340 | ar9580_1p0_modes_fast_clock); |
| 341 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 342 | ar9580_1p0_baseband_core_txfir_coeff_japan_2484); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 343 | } else if (AR_SREV_9565_11_OR_LATER(ah)) { |
| 344 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
| 345 | ar9565_1p1_mac_core); |
| 346 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
| 347 | ar9565_1p1_mac_postamble); |
| 348 | |
| 349 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
| 350 | ar9565_1p1_baseband_core); |
| 351 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
| 352 | ar9565_1p1_baseband_postamble); |
| 353 | |
| 354 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
| 355 | ar9565_1p1_radio_core); |
| 356 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
| 357 | ar9565_1p1_radio_postamble); |
| 358 | |
| 359 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
| 360 | ar9565_1p1_soc_preamble); |
| 361 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
| 362 | ar9565_1p1_soc_postamble); |
| 363 | |
| 364 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 365 | ar9565_1p1_Common_rx_gain_table); |
| 366 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 367 | ar9565_1p1_Modes_lowest_ob_db_tx_gain_table); |
| 368 | |
| 369 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
| 370 | ar9565_1p1_pciephy_clkreq_disable_L1); |
| 371 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
| 372 | ar9565_1p1_pciephy_clkreq_disable_L1); |
| 373 | |
| 374 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
| 375 | ar9565_1p1_modes_fast_clock); |
| 376 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 377 | ar9565_1p1_baseband_core_txfir_coeff_japan_2484); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 378 | } else if (AR_SREV_9565(ah)) { |
| 379 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
| 380 | ar9565_1p0_mac_core); |
| 381 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
| 382 | ar9565_1p0_mac_postamble); |
| 383 | |
| 384 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
| 385 | ar9565_1p0_baseband_core); |
| 386 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
| 387 | ar9565_1p0_baseband_postamble); |
| 388 | |
| 389 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
| 390 | ar9565_1p0_radio_core); |
| 391 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
| 392 | ar9565_1p0_radio_postamble); |
| 393 | |
| 394 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
| 395 | ar9565_1p0_soc_preamble); |
| 396 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
| 397 | ar9565_1p0_soc_postamble); |
| 398 | |
| 399 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 400 | ar9565_1p0_Common_rx_gain_table); |
| 401 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 402 | ar9565_1p0_Modes_lowest_ob_db_tx_gain_table); |
| 403 | |
| 404 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
Rajkumar Manoharan | 8446484 | 2012-10-25 17:16:51 +0530 | [diff] [blame] | 405 | ar9565_1p0_pciephy_clkreq_disable_L1); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 406 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
Rajkumar Manoharan | 8446484 | 2012-10-25 17:16:51 +0530 | [diff] [blame] | 407 | ar9565_1p0_pciephy_clkreq_disable_L1); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 408 | |
| 409 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
| 410 | ar9565_1p0_modes_fast_clock); |
Sujith Manoharan | 6d5228f | 2013-09-03 10:28:56 +0530 | [diff] [blame] | 411 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 412 | ar9565_1p0_baseband_core_txfir_coeff_japan_2484); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 413 | } else { |
| 414 | /* mac */ |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 415 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 416 | ar9300_2p2_mac_core); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 417 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 418 | ar9300_2p2_mac_postamble); |
Luis R. Rodriguez | 7284635 | 2010-05-12 21:15:05 -0400 | [diff] [blame] | 419 | |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 420 | /* bb */ |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 421 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 422 | ar9300_2p2_baseband_core); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 423 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 424 | ar9300_2p2_baseband_postamble); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 425 | |
| 426 | /* radio */ |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 427 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 428 | ar9300_2p2_radio_core); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 429 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 430 | ar9300_2p2_radio_postamble); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 431 | |
| 432 | /* soc */ |
| 433 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 434 | ar9300_2p2_soc_preamble); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 435 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 436 | ar9300_2p2_soc_postamble); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 437 | |
| 438 | /* rx/tx gain */ |
| 439 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 440 | ar9300Common_rx_gain_table_2p2); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 441 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 442 | ar9300Modes_lowest_ob_db_tx_gain_table_2p2); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 443 | |
| 444 | /* Load PCIE SERDES settings from INI */ |
| 445 | |
| 446 | /* Awake Setting */ |
| 447 | |
| 448 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 449 | ar9300PciePhy_pll_on_clkreq_disable_L1_2p2); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 450 | |
| 451 | /* Sleep Setting */ |
| 452 | |
| 453 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 454 | ar9300PciePhy_pll_on_clkreq_disable_L1_2p2); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 455 | |
| 456 | /* Fast clock modal settings */ |
Felix Fietkau | c7d36f9 | 2012-03-14 16:40:31 +0100 | [diff] [blame] | 457 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
Sujith Manoharan | 2c8672c | 2013-12-02 09:56:31 +0530 | [diff] [blame^] | 458 | ar9300Modes_fast_clock_2p2); |
| 459 | INIT_INI_ARRAY(&ah->iniCckfirJapan2484, |
| 460 | ar9300_2p2_baseband_core_txfir_coeff_japan_2484); |
Vasanthakumar Thiagarajan | c88457e | 2010-12-06 04:27:37 -0800 | [diff] [blame] | 461 | } |
Luis R. Rodriguez | 7284635 | 2010-05-12 21:15:05 -0400 | [diff] [blame] | 462 | } |
| 463 | |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 464 | static void ar9003_tx_gain_table_mode0(struct ath_hw *ah) |
| 465 | { |
| 466 | if (AR_SREV_9330_12(ah)) |
| 467 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 468 | ar9331_modes_lowest_ob_db_tx_gain_1p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 469 | else if (AR_SREV_9330_11(ah)) |
| 470 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 471 | ar9331_modes_lowest_ob_db_tx_gain_1p1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 472 | else if (AR_SREV_9340(ah)) |
| 473 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 474 | ar9340Modes_lowest_ob_db_tx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 475 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 476 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 477 | ar9485_modes_lowest_ob_db_tx_gain_1_1); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 478 | else if (AR_SREV_9550(ah)) |
| 479 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 480 | ar955x_1p0_modes_xpa_tx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 481 | else if (AR_SREV_9580(ah)) |
| 482 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 483 | ar9580_1p0_lowest_ob_db_tx_gain_table); |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 484 | else if (AR_SREV_9462_21(ah)) |
| 485 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 486 | ar9462_2p1_modes_low_ob_db_tx_gain); |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 487 | else if (AR_SREV_9462_20(ah)) |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 488 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 489 | ar9462_2p0_modes_low_ob_db_tx_gain); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 490 | else if (AR_SREV_9565_11(ah)) |
| 491 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 492 | ar9565_1p1_modes_low_ob_db_tx_gain_table); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 493 | else if (AR_SREV_9565(ah)) |
| 494 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 495 | ar9565_1p0_modes_low_ob_db_tx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 496 | else |
| 497 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 498 | ar9300Modes_lowest_ob_db_tx_gain_table_2p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | static void ar9003_tx_gain_table_mode1(struct ath_hw *ah) |
| 502 | { |
| 503 | if (AR_SREV_9330_12(ah)) |
| 504 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 505 | ar9331_modes_high_ob_db_tx_gain_1p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 506 | else if (AR_SREV_9330_11(ah)) |
| 507 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 508 | ar9331_modes_high_ob_db_tx_gain_1p1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 509 | else if (AR_SREV_9340(ah)) |
| 510 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 511 | ar9340Modes_high_ob_db_tx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 512 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 513 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 514 | ar9485Modes_high_ob_db_tx_gain_1_1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 515 | else if (AR_SREV_9580(ah)) |
| 516 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 517 | ar9580_1p0_high_ob_db_tx_gain_table); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 518 | else if (AR_SREV_9550(ah)) |
| 519 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 520 | ar955x_1p0_modes_no_xpa_tx_gain_table); |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 521 | else if (AR_SREV_9462_21(ah)) |
| 522 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 523 | ar9462_2p1_modes_high_ob_db_tx_gain); |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 524 | else if (AR_SREV_9462_20(ah)) |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 525 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 526 | ar9462_2p0_modes_high_ob_db_tx_gain); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 527 | else if (AR_SREV_9565_11(ah)) |
| 528 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 529 | ar9565_1p1_modes_high_ob_db_tx_gain_table); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 530 | else if (AR_SREV_9565(ah)) |
| 531 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 532 | ar9565_1p0_modes_high_ob_db_tx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 533 | else |
| 534 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 535 | ar9300Modes_high_ob_db_tx_gain_table_2p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 536 | } |
| 537 | |
| 538 | static void ar9003_tx_gain_table_mode2(struct ath_hw *ah) |
| 539 | { |
| 540 | if (AR_SREV_9330_12(ah)) |
| 541 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 542 | ar9331_modes_low_ob_db_tx_gain_1p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 543 | else if (AR_SREV_9330_11(ah)) |
| 544 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 545 | ar9331_modes_low_ob_db_tx_gain_1p1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 546 | else if (AR_SREV_9340(ah)) |
| 547 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 548 | ar9340Modes_low_ob_db_tx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 549 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 550 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 551 | ar9485Modes_low_ob_db_tx_gain_1_1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 552 | else if (AR_SREV_9580(ah)) |
| 553 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 554 | ar9580_1p0_low_ob_db_tx_gain_table); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 555 | else if (AR_SREV_9565_11(ah)) |
| 556 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 557 | ar9565_1p1_modes_low_ob_db_tx_gain_table); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 558 | else if (AR_SREV_9565(ah)) |
| 559 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 560 | ar9565_1p0_modes_low_ob_db_tx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 561 | else |
| 562 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 563 | ar9300Modes_low_ob_db_tx_gain_table_2p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 564 | } |
| 565 | |
| 566 | static void ar9003_tx_gain_table_mode3(struct ath_hw *ah) |
| 567 | { |
| 568 | if (AR_SREV_9330_12(ah)) |
| 569 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 570 | ar9331_modes_high_power_tx_gain_1p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 571 | else if (AR_SREV_9330_11(ah)) |
| 572 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 573 | ar9331_modes_high_power_tx_gain_1p1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 574 | else if (AR_SREV_9340(ah)) |
| 575 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 576 | ar9340Modes_high_power_tx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 577 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 578 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 579 | ar9485Modes_high_power_tx_gain_1_1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 580 | else if (AR_SREV_9580(ah)) |
| 581 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 582 | ar9580_1p0_high_power_tx_gain_table); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 583 | else if (AR_SREV_9565_11(ah)) |
| 584 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 585 | ar9565_1p1_modes_high_power_tx_gain_table); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 586 | else if (AR_SREV_9565(ah)) |
| 587 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 588 | ar9565_1p0_modes_high_power_tx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 589 | else |
| 590 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 591 | ar9300Modes_high_power_tx_gain_table_2p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 592 | } |
| 593 | |
Felix Fietkau | b05a011 | 2012-07-15 19:53:32 +0200 | [diff] [blame] | 594 | static void ar9003_tx_gain_table_mode4(struct ath_hw *ah) |
| 595 | { |
| 596 | if (AR_SREV_9340(ah)) |
| 597 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 598 | ar9340Modes_mixed_ob_db_tx_gain_table_1p0); |
Felix Fietkau | b05a011 | 2012-07-15 19:53:32 +0200 | [diff] [blame] | 599 | else if (AR_SREV_9580(ah)) |
| 600 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 601 | ar9580_1p0_mixed_ob_db_tx_gain_table); |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 602 | else if (AR_SREV_9462_21(ah)) |
| 603 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 604 | ar9462_2p1_modes_mix_ob_db_tx_gain); |
Sujith Manoharan | 9a54c17 | 2013-06-25 12:29:23 +0530 | [diff] [blame] | 605 | else if (AR_SREV_9462_20(ah)) |
| 606 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 607 | ar9462_2p0_modes_mix_ob_db_tx_gain); |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 608 | else |
| 609 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 610 | ar9300Modes_mixed_ob_db_tx_gain_table_2p2); |
Felix Fietkau | b05a011 | 2012-07-15 19:53:32 +0200 | [diff] [blame] | 611 | } |
| 612 | |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 613 | static void ar9003_tx_gain_table_mode5(struct ath_hw *ah) |
| 614 | { |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 615 | if (AR_SREV_9485_11_OR_LATER(ah)) |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 616 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 617 | ar9485Modes_green_ob_db_tx_gain_1_1); |
| 618 | else if (AR_SREV_9340(ah)) |
| 619 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 620 | ar9340Modes_ub124_tx_gain_table_1p0); |
| 621 | else if (AR_SREV_9580(ah)) |
| 622 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 623 | ar9580_1p0_type5_tx_gain_table); |
| 624 | else if (AR_SREV_9300_22(ah)) |
| 625 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 626 | ar9300Modes_type5_tx_gain_table_2p2); |
| 627 | } |
| 628 | |
| 629 | static void ar9003_tx_gain_table_mode6(struct ath_hw *ah) |
| 630 | { |
| 631 | if (AR_SREV_9340(ah)) |
| 632 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 633 | ar9340Modes_low_ob_db_and_spur_tx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 634 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 635 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 636 | ar9485Modes_green_spur_ob_db_tx_gain_1_1); |
| 637 | else if (AR_SREV_9580(ah)) |
| 638 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 639 | ar9580_1p0_type6_tx_gain_table); |
| 640 | } |
| 641 | |
Sujith Manoharan | 8fd007a | 2013-11-05 05:54:59 +0530 | [diff] [blame] | 642 | static void ar9003_tx_gain_table_mode7(struct ath_hw *ah) |
| 643 | { |
| 644 | if (AR_SREV_9340(ah)) |
| 645 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
| 646 | ar9340_cus227_tx_gain_table_1p0); |
| 647 | } |
| 648 | |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 649 | typedef void (*ath_txgain_tab)(struct ath_hw *ah); |
| 650 | |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 651 | static void ar9003_tx_gain_table_apply(struct ath_hw *ah) |
| 652 | { |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 653 | static const ath_txgain_tab modes[] = { |
| 654 | ar9003_tx_gain_table_mode0, |
| 655 | ar9003_tx_gain_table_mode1, |
| 656 | ar9003_tx_gain_table_mode2, |
| 657 | ar9003_tx_gain_table_mode3, |
| 658 | ar9003_tx_gain_table_mode4, |
| 659 | ar9003_tx_gain_table_mode5, |
| 660 | ar9003_tx_gain_table_mode6, |
Sujith Manoharan | 8fd007a | 2013-11-05 05:54:59 +0530 | [diff] [blame] | 661 | ar9003_tx_gain_table_mode7, |
Felix Fietkau | eab6d79 | 2013-01-10 19:41:52 +0100 | [diff] [blame] | 662 | }; |
| 663 | int idx = ar9003_hw_get_tx_gain_idx(ah); |
| 664 | |
| 665 | if (idx >= ARRAY_SIZE(modes)) |
| 666 | idx = 0; |
| 667 | |
| 668 | modes[idx](ah); |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 669 | } |
| 670 | |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 671 | static void ar9003_rx_gain_table_mode0(struct ath_hw *ah) |
| 672 | { |
| 673 | if (AR_SREV_9330_12(ah)) |
| 674 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 675 | ar9331_common_rx_gain_1p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 676 | else if (AR_SREV_9330_11(ah)) |
| 677 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 678 | ar9331_common_rx_gain_1p1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 679 | else if (AR_SREV_9340(ah)) |
| 680 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 681 | ar9340Common_rx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 682 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 683 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | a796a1d | 2012-12-26 12:27:39 +0530 | [diff] [blame] | 684 | ar9485_common_rx_gain_1_1); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 685 | else if (AR_SREV_9550(ah)) { |
| 686 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 687 | ar955x_1p0_common_rx_gain_table); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 688 | INIT_INI_ARRAY(&ah->ini_modes_rx_gain_bounds, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 689 | ar955x_1p0_common_rx_gain_bounds); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 690 | } else if (AR_SREV_9580(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 691 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 692 | ar9580_1p0_rx_gain_table); |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 693 | else if (AR_SREV_9462_21(ah)) |
| 694 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 695 | ar9462_2p1_common_rx_gain); |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 696 | else if (AR_SREV_9462_20(ah)) |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 697 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 698 | ar9462_2p0_common_rx_gain); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 699 | else if (AR_SREV_9565_11(ah)) |
| 700 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 701 | ar9565_1p1_Common_rx_gain_table); |
Sujith Manoharan | 6ac2150 | 2013-09-02 13:59:02 +0530 | [diff] [blame] | 702 | else if (AR_SREV_9565(ah)) |
| 703 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 704 | ar9565_1p0_Common_rx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 705 | else |
| 706 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 707 | ar9300Common_rx_gain_table_2p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | static void ar9003_rx_gain_table_mode1(struct ath_hw *ah) |
| 711 | { |
| 712 | if (AR_SREV_9330_12(ah)) |
| 713 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 714 | ar9331_common_wo_xlna_rx_gain_1p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 715 | else if (AR_SREV_9330_11(ah)) |
| 716 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 717 | ar9331_common_wo_xlna_rx_gain_1p1); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 718 | else if (AR_SREV_9340(ah)) |
| 719 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 720 | ar9340Common_wo_xlna_rx_gain_table_1p0); |
Sujith Manoharan | fb5a2dc | 2013-08-19 11:03:43 +0530 | [diff] [blame] | 721 | else if (AR_SREV_9485_11_OR_LATER(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 722 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 723 | ar9485Common_wo_xlna_rx_gain_1_1); |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 724 | else if (AR_SREV_9462_21(ah)) |
| 725 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 726 | ar9462_2p1_common_wo_xlna_rx_gain); |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 727 | else if (AR_SREV_9462_20(ah)) |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 728 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 729 | ar9462_2p0_common_wo_xlna_rx_gain); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 730 | else if (AR_SREV_9550(ah)) { |
| 731 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 732 | ar955x_1p0_common_wo_xlna_rx_gain_table); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 733 | INIT_INI_ARRAY(&ah->ini_modes_rx_gain_bounds, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 734 | ar955x_1p0_common_wo_xlna_rx_gain_bounds); |
Gabor Juhos | 8bc45c6 | 2012-07-03 19:13:23 +0200 | [diff] [blame] | 735 | } else if (AR_SREV_9580(ah)) |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 736 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 737 | ar9580_1p0_wo_xlna_rx_gain_table); |
Sujith Manoharan | 3777f7d | 2013-11-19 12:11:13 +0530 | [diff] [blame] | 738 | else if (AR_SREV_9565_11(ah)) |
| 739 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 740 | ar9565_1p1_common_wo_xlna_rx_gain_table); |
Sujith Manoharan | aaa53ee | 2012-09-10 09:19:54 +0530 | [diff] [blame] | 741 | else if (AR_SREV_9565(ah)) |
| 742 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 743 | ar9565_1p0_common_wo_xlna_rx_gain_table); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 744 | else |
| 745 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Felix Fietkau | a364517 | 2012-07-15 19:53:33 +0200 | [diff] [blame] | 746 | ar9300Common_wo_xlna_rx_gain_table_2p2); |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 747 | } |
| 748 | |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 749 | static void ar9003_rx_gain_table_mode2(struct ath_hw *ah) |
| 750 | { |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 751 | if (AR_SREV_9462_21(ah)) { |
| 752 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
| 753 | ar9462_2p1_common_mixed_rx_gain); |
| 754 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_core, |
| 755 | ar9462_2p1_baseband_core_mix_rxgain); |
| 756 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_postamble, |
| 757 | ar9462_2p1_baseband_postamble_mix_rxgain); |
| 758 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna, |
| 759 | ar9462_2p1_baseband_postamble_5g_xlna); |
| 760 | } else if (AR_SREV_9462_20(ah)) { |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 761 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 762 | ar9462_2p0_common_mixed_rx_gain); |
Sujith Manoharan | c177fab | 2013-06-18 15:42:38 +0530 | [diff] [blame] | 763 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_core, |
| 764 | ar9462_2p0_baseband_core_mix_rxgain); |
| 765 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_postamble, |
| 766 | ar9462_2p0_baseband_postamble_mix_rxgain); |
Sujith Manoharan | 51dbd0a | 2013-06-18 10:13:42 +0530 | [diff] [blame] | 767 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna, |
| 768 | ar9462_2p0_baseband_postamble_5g_xlna); |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | static void ar9003_rx_gain_table_mode3(struct ath_hw *ah) |
| 773 | { |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 774 | if (AR_SREV_9462_21(ah)) { |
| 775 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 776 | ar9462_2p1_common_5g_xlna_only_rxgain); |
Sujith Manoharan | d567e4e | 2013-06-24 18:18:45 +0530 | [diff] [blame] | 777 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna, |
| 778 | ar9462_2p1_baseband_postamble_5g_xlna); |
| 779 | } else if (AR_SREV_9462_20(ah)) { |
Sujith Manoharan | 51dbd0a | 2013-06-18 10:13:42 +0530 | [diff] [blame] | 780 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
Sujith Manoharan | dbb3e2f | 2013-11-26 15:04:55 +0530 | [diff] [blame] | 781 | ar9462_2p0_common_5g_xlna_only_rxgain); |
Sujith Manoharan | 51dbd0a | 2013-06-18 10:13:42 +0530 | [diff] [blame] | 782 | INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna, |
| 783 | ar9462_2p0_baseband_postamble_5g_xlna); |
| 784 | } |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 785 | } |
| 786 | |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 787 | static void ar9003_rx_gain_table_apply(struct ath_hw *ah) |
| 788 | { |
| 789 | switch (ar9003_hw_get_rx_gain_idx(ah)) { |
| 790 | case 0: |
| 791 | default: |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 792 | ar9003_rx_gain_table_mode0(ah); |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 793 | break; |
| 794 | case 1: |
Senthil Balasubramanian | 4d0707e | 2011-09-13 22:38:17 +0530 | [diff] [blame] | 795 | ar9003_rx_gain_table_mode1(ah); |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 796 | break; |
Senthil Balasubramanian | 2577c6e | 2011-09-13 22:38:18 +0530 | [diff] [blame] | 797 | case 2: |
| 798 | ar9003_rx_gain_table_mode2(ah); |
| 799 | break; |
Sujith Manoharan | 51dbd0a | 2013-06-18 10:13:42 +0530 | [diff] [blame] | 800 | case 3: |
| 801 | ar9003_rx_gain_table_mode3(ah); |
| 802 | break; |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 803 | } |
| 804 | } |
| 805 | |
| 806 | /* set gain table pointers according to values read from the eeprom */ |
| 807 | static void ar9003_hw_init_mode_gain_regs(struct ath_hw *ah) |
| 808 | { |
| 809 | ar9003_tx_gain_table_apply(ah); |
| 810 | ar9003_rx_gain_table_apply(ah); |
| 811 | } |
| 812 | |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 813 | /* |
| 814 | * Helper for ASPM support. |
| 815 | * |
| 816 | * Disable PLL when in L0s as well as receiver clock when in L1. |
| 817 | * This power saving option must be enabled through the SerDes. |
| 818 | * |
| 819 | * Programming the SerDes must go through the same 288 bit serial shift |
| 820 | * register as the other analog registers. Hence the 9 writes. |
| 821 | */ |
| 822 | static void ar9003_hw_configpcipowersave(struct ath_hw *ah, |
Stanislaw Gruszka | 84c87dc | 2011-08-05 13:10:32 +0200 | [diff] [blame] | 823 | bool power_off) |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 824 | { |
Sujith Manoharan | c6fc7e6 | 2013-10-29 11:52:06 +0530 | [diff] [blame] | 825 | unsigned int i; |
| 826 | struct ar5416IniArray *array; |
| 827 | |
Sujith Manoharan | b380a43b | 2013-08-25 14:43:09 +0530 | [diff] [blame] | 828 | /* |
| 829 | * Increase L1 Entry Latency. Some WB222 boards don't have |
| 830 | * this change in eeprom/OTP. |
| 831 | * |
| 832 | */ |
| 833 | if (AR_SREV_9462(ah)) { |
| 834 | u32 val = ah->config.aspm_l1_fix; |
| 835 | if ((val & 0xff000000) == 0x17000000) { |
| 836 | val &= 0x00ffffff; |
| 837 | val |= 0x27000000; |
| 838 | REG_WRITE(ah, 0x570c, val); |
| 839 | } |
| 840 | } |
| 841 | |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 842 | /* Nothing to do on restore for 11N */ |
Stanislaw Gruszka | 84c87dc | 2011-08-05 13:10:32 +0200 | [diff] [blame] | 843 | if (!power_off /* !restore */) { |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 844 | /* set bit 19 to allow forcing of pcie core into L1 state */ |
| 845 | REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); |
Sujith Manoharan | d1ae25a | 2013-08-25 16:30:40 +0530 | [diff] [blame] | 846 | REG_WRITE(ah, AR_WA, ah->WARegVal); |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 847 | } |
Luis R. Rodriguez | 653fe37 | 2010-06-21 18:38:48 -0400 | [diff] [blame] | 848 | |
| 849 | /* |
| 850 | * Configire PCIE after Ini init. SERDES values now come from ini file |
| 851 | * This enables PCIe low power mode. |
| 852 | */ |
Sujith Manoharan | c6fc7e6 | 2013-10-29 11:52:06 +0530 | [diff] [blame] | 853 | array = power_off ? &ah->iniPcieSerdes : |
| 854 | &ah->iniPcieSerdesLowPower; |
Luis R. Rodriguez | 653fe37 | 2010-06-21 18:38:48 -0400 | [diff] [blame] | 855 | |
Sujith Manoharan | c6fc7e6 | 2013-10-29 11:52:06 +0530 | [diff] [blame] | 856 | for (i = 0; i < array->ia_rows; i++) { |
| 857 | REG_WRITE(ah, |
| 858 | INI_RA(array, i, 0), |
| 859 | INI_RA(array, i, 1)); |
Luis R. Rodriguez | 653fe37 | 2010-06-21 18:38:48 -0400 | [diff] [blame] | 860 | } |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 861 | } |
| 862 | |
| 863 | /* Sets up the AR9003 hardware familiy callbacks */ |
| 864 | void ar9003_hw_attach_ops(struct ath_hw *ah) |
| 865 | { |
| 866 | struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah); |
| 867 | struct ath_hw_ops *ops = ath9k_hw_ops(ah); |
| 868 | |
Felix Fietkau | 6aaacd8 | 2013-01-13 19:54:58 +0100 | [diff] [blame] | 869 | ar9003_hw_init_mode_regs(ah); |
Luis R. Rodriguez | c14a85d | 2010-04-15 17:39:21 -0400 | [diff] [blame] | 870 | priv_ops->init_mode_gain_regs = ar9003_hw_init_mode_gain_regs; |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 871 | |
| 872 | ops->config_pci_powersave = ar9003_hw_configpcipowersave; |
| 873 | |
| 874 | ar9003_hw_attach_phy_ops(ah); |
| 875 | ar9003_hw_attach_calib_ops(ah); |
| 876 | ar9003_hw_attach_mac_ops(ah); |
Luis R. Rodriguez | b3950e6 | 2010-04-15 17:39:03 -0400 | [diff] [blame] | 877 | } |