aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-11-08 01:15:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-11-11 14:47:45 -0500
commit2d22c7dded7dcf6feaede2d6f476fd991426980a (patch)
tree257d30ca358b65b4d1beedeafcc7d9dcc9e6414c
parent876efcf05c3aa582de5efefa7dd6fbb731b4d085 (diff)
ath9k: Use correct PCIE initvals for AR9485
Currently, the PLL is turned off for AR9485 when switching to a low power state, but AR9485 has an issue where the card will become unresponsive if left idle for a long time without any traffic. To fix this, force the PLL to always be on using a different initval array, ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1. This is done for most of the AR9485 based cards like HB125, WB225 etc. but certain models require the feature to be turned off. Identify such cards and use default values for them. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_hw.c22
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9485_initvals.h42
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h19
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c87
6 files changed, 128 insertions, 48 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index b07f164d65cf..20e49095db2a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -187,17 +187,17 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
187 INIT_INI_ARRAY(&ah->iniCckfirJapan2484, 187 INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
188 ar9485_1_1_baseband_core_txfir_coeff_japan_2484); 188 ar9485_1_1_baseband_core_txfir_coeff_japan_2484);
189 189
190 /* Load PCIE SERDES settings from INI */ 190 if (ah->config.no_pll_pwrsave) {
191 191 INIT_INI_ARRAY(&ah->iniPcieSerdes,
192 /* Awake Setting */ 192 ar9485_1_1_pcie_phy_clkreq_disable_L1);
193 193 INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
194 INIT_INI_ARRAY(&ah->iniPcieSerdes, 194 ar9485_1_1_pcie_phy_clkreq_disable_L1);
195 ar9485_1_1_pcie_phy_clkreq_disable_L1); 195 } else {
196 196 INIT_INI_ARRAY(&ah->iniPcieSerdes,
197 /* Sleep Setting */ 197 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
198 198 INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
199 INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, 199 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
200 ar9485_1_1_pcie_phy_clkreq_disable_L1); 200 }
201 } else if (AR_SREV_9462_21(ah)) { 201 } else if (AR_SREV_9462_21(ah)) {
202 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], 202 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
203 ar9462_2p1_mac_core); 203 ar9462_2p1_mac_core);
diff --git a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
index 6f899c692647..7c1845221e1c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
@@ -32,13 +32,6 @@ static const u32 ar9485_1_1_mac_postamble[][5] = {
32 {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440}, 32 {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
33}; 33};
34 34
35static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = {
36 /* Addr allmodes */
37 {0x00018c00, 0x18012e5e},
38 {0x00018c04, 0x000801d8},
39 {0x00018c08, 0x0000080c},
40};
41
42static const u32 ar9485Common_wo_xlna_rx_gain_1_1[][2] = { 35static const u32 ar9485Common_wo_xlna_rx_gain_1_1[][2] = {
43 /* Addr allmodes */ 36 /* Addr allmodes */
44 {0x00009e00, 0x037216a0}, 37 {0x00009e00, 0x037216a0},
@@ -1101,20 +1094,6 @@ static const u32 ar9485_common_rx_gain_1_1[][2] = {
1101 {0x0000a1fc, 0x00000296}, 1094 {0x0000a1fc, 0x00000296},
1102}; 1095};
1103 1096
1104static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = {
1105 /* Addr allmodes */
1106 {0x00018c00, 0x18052e5e},
1107 {0x00018c04, 0x000801d8},
1108 {0x00018c08, 0x0000080c},
1109};
1110
1111static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = {
1112 /* Addr allmodes */
1113 {0x00018c00, 0x18053e5e},
1114 {0x00018c04, 0x000801d8},
1115 {0x00018c08, 0x0000080c},
1116};
1117
1118static const u32 ar9485_1_1_soc_preamble[][2] = { 1097static const u32 ar9485_1_1_soc_preamble[][2] = {
1119 /* Addr allmodes */ 1098 /* Addr allmodes */
1120 {0x00004014, 0xba280400}, 1099 {0x00004014, 0xba280400},
@@ -1173,13 +1152,6 @@ static const u32 ar9485_1_1_baseband_postamble[][5] = {
1173 {0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1152 {0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1174}; 1153};
1175 1154
1176static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
1177 /* Addr allmodes */
1178 {0x00018c00, 0x18013e5e},
1179 {0x00018c04, 0x000801d8},
1180 {0x00018c08, 0x0000080c},
1181};
1182
1183static const u32 ar9485_1_1_radio_postamble[][2] = { 1155static const u32 ar9485_1_1_radio_postamble[][2] = {
1184 /* Addr allmodes */ 1156 /* Addr allmodes */
1185 {0x0001609c, 0x0b283f31}, 1157 {0x0001609c, 0x0b283f31},
@@ -1358,4 +1330,18 @@ static const u32 ar9485_1_1_baseband_core_txfir_coeff_japan_2484[][2] = {
1358 {0x0000a3a0, 0xca9228ee}, 1330 {0x0000a3a0, 0xca9228ee},
1359}; 1331};
1360 1332
1333static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
1334 /* Addr allmodes */
1335 {0x00018c00, 0x18013e5e},
1336 {0x00018c04, 0x000801d8},
1337 {0x00018c08, 0x0000080c},
1338};
1339
1340static const u32 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1[][2] = {
1341 /* Addr allmodes */
1342 {0x00018c00, 0x1801265e},
1343 {0x00018c04, 0x000801d8},
1344 {0x00018c08, 0x0000080c},
1345};
1346
1361#endif /* INITVALS_9485_H */ 1347#endif /* INITVALS_9485_H */
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index e7a38d844a6a..60a5da53668f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -632,15 +632,16 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs);
632/* Main driver core */ 632/* Main driver core */
633/********************/ 633/********************/
634 634
635#define ATH9K_PCI_CUS198 0x0001 635#define ATH9K_PCI_CUS198 0x0001
636#define ATH9K_PCI_CUS230 0x0002 636#define ATH9K_PCI_CUS230 0x0002
637#define ATH9K_PCI_CUS217 0x0004 637#define ATH9K_PCI_CUS217 0x0004
638#define ATH9K_PCI_CUS252 0x0008 638#define ATH9K_PCI_CUS252 0x0008
639#define ATH9K_PCI_WOW 0x0010 639#define ATH9K_PCI_WOW 0x0010
640#define ATH9K_PCI_BT_ANT_DIV 0x0020 640#define ATH9K_PCI_BT_ANT_DIV 0x0020
641#define ATH9K_PCI_D3_L1_WAR 0x0040 641#define ATH9K_PCI_D3_L1_WAR 0x0040
642#define ATH9K_PCI_AR9565_1ANT 0x0080 642#define ATH9K_PCI_AR9565_1ANT 0x0080
643#define ATH9K_PCI_AR9565_2ANT 0x0100 643#define ATH9K_PCI_AR9565_2ANT 0x0100
644#define ATH9K_PCI_NO_PLL_PWRSAVE 0x0200
644 645
645/* 646/*
646 * Default cache line size, in bytes. 647 * Default cache line size, in bytes.
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 9ea24f1cba73..a2c9a5dbac6b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -316,6 +316,7 @@ struct ath9k_ops_config {
316 u32 ant_ctrl_comm2g_switch_enable; 316 u32 ant_ctrl_comm2g_switch_enable;
317 bool xatten_margin_cfg; 317 bool xatten_margin_cfg;
318 bool alt_mingainidx; 318 bool alt_mingainidx;
319 bool no_pll_pwrsave;
319}; 320};
320 321
321enum ath9k_int { 322enum ath9k_int {
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index d1c5de0c0261..710192ed27ed 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -609,6 +609,11 @@ static void ath9k_init_platform(struct ath_softc *sc)
609 ah->config.pcie_waen = 0x0040473b; 609 ah->config.pcie_waen = 0x0040473b;
610 ath_info(common, "Enable WAR for ASPM D3/L1\n"); 610 ath_info(common, "Enable WAR for ASPM D3/L1\n");
611 } 611 }
612
613 if (sc->driver_data & ATH9K_PCI_NO_PLL_PWRSAVE) {
614 ah->config.no_pll_pwrsave = true;
615 ath_info(common, "Disable PLL PowerSave\n");
616 }
612} 617}
613 618
614static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob, 619static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob,
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 7e4c2524b630..b5656fce4ff5 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -195,6 +195,93 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
195 0x3219), 195 0x3219),
196 .driver_data = ATH9K_PCI_BT_ANT_DIV }, 196 .driver_data = ATH9K_PCI_BT_ANT_DIV },
197 197
198 /* AR9485 cards with PLL power-save disabled by default. */
199 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
200 0x0032,
201 PCI_VENDOR_ID_AZWAVE,
202 0x2C97),
203 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
204 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
205 0x0032,
206 PCI_VENDOR_ID_AZWAVE,
207 0x2100),
208 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
209 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
210 0x0032,
211 0x1C56, /* ASKEY */
212 0x4001),
213 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
214 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
215 0x0032,
216 0x11AD, /* LITEON */
217 0x6627),
218 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
219 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
220 0x0032,
221 0x11AD, /* LITEON */
222 0x6628),
223 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
224 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
225 0x0032,
226 PCI_VENDOR_ID_FOXCONN,
227 0xE04E),
228 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
229 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
230 0x0032,
231 PCI_VENDOR_ID_FOXCONN,
232 0xE04F),
233 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
234 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
235 0x0032,
236 0x144F, /* ASKEY */
237 0x7197),
238 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
239 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
240 0x0032,
241 0x1B9A, /* XAVI */
242 0x2000),
243 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
244 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
245 0x0032,
246 0x1B9A, /* XAVI */
247 0x2001),
248 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
249 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
250 0x0032,
251 PCI_VENDOR_ID_AZWAVE,
252 0x1186),
253 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
254 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
255 0x0032,
256 PCI_VENDOR_ID_AZWAVE,
257 0x1F86),
258 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
259 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
260 0x0032,
261 PCI_VENDOR_ID_AZWAVE,
262 0x1195),
263 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
264 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
265 0x0032,
266 PCI_VENDOR_ID_AZWAVE,
267 0x1F95),
268 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
269 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
270 0x0032,
271 0x1B9A, /* XAVI */
272 0x1C00),
273 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
274 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
275 0x0032,
276 0x1B9A, /* XAVI */
277 0x1C01),
278 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
279 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
280 0x0032,
281 PCI_VENDOR_ID_ASUSTEK,
282 0x850D),
283 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
284
198 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ 285 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
199 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ 286 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
200 287