blob: a1ea78e05b479c09dc47e948e79152eb17669770 [file] [log] [blame]
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001/*
2 * Initial register settings functions
3 *
Nick Kossifidisc6e387a2008-08-29 22:45:39 +03004 * Copyright (c) 2004-2007 Reyk Floeter <reyk@openbsd.org>
Nick Kossifidisa406c132009-02-09 06:08:51 +02005 * Copyright (c) 2006-2009 Nick Kossifidis <mickflemm@gmail.com>
Nick Kossifidisc6e387a2008-08-29 22:45:39 +03006 * Copyright (c) 2007-2008 Jiri Slaby <jirislaby@gmail.com>
Jiri Slabyfa1c1142007-08-12 17:33:16 +02007 *
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 *
20 */
21
22#include "ath5k.h"
Jiri Slabyfa1c1142007-08-12 17:33:16 +020023#include "reg.h"
Nick Kossifidisc6e387a2008-08-29 22:45:39 +030024#include "debug.h"
Jiri Slabyfa1c1142007-08-12 17:33:16 +020025
Nick Kossifidisc47faa32011-11-25 20:40:25 +020026/**
27 * struct ath5k_ini - Mode-independent initial register writes
28 * @ini_register: Register address
29 * @ini_value: Default value
30 * @ini_mode: 0 to write 1 to read (and clear)
Jiri Slabyfa1c1142007-08-12 17:33:16 +020031 */
Jiri Slabyfa1c1142007-08-12 17:33:16 +020032struct ath5k_ini {
33 u16 ini_register;
34 u32 ini_value;
35
36 enum {
37 AR5K_INI_WRITE = 0, /* Default */
Nick Kossifidisc47faa32011-11-25 20:40:25 +020038 AR5K_INI_READ = 1,
Jiri Slabyfa1c1142007-08-12 17:33:16 +020039 } ini_mode;
40};
41
Nick Kossifidisc47faa32011-11-25 20:40:25 +020042/**
43 * struct ath5k_ini_mode - Mode specific initial register values
44 * @mode_register: Register address
45 * @mode_value: Set of values for each enum ath5k_driver_mode
Jiri Slabyfa1c1142007-08-12 17:33:16 +020046 */
Jiri Slabyfa1c1142007-08-12 17:33:16 +020047struct ath5k_ini_mode {
48 u16 mode_register;
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +020049 u32 mode_value[3];
Jiri Slabyfa1c1142007-08-12 17:33:16 +020050};
51
52/* Initial register settings for AR5210 */
53static const struct ath5k_ini ar5210_ini[] = {
54 /* PCU and MAC registers */
55 { AR5K_NOQCU_TXDP0, 0 },
56 { AR5K_NOQCU_TXDP1, 0 },
57 { AR5K_RXDP, 0 },
58 { AR5K_CR, 0 },
59 { AR5K_ISR, 0, AR5K_INI_READ },
60 { AR5K_IMR, 0 },
61 { AR5K_IER, AR5K_IER_DISABLE },
62 { AR5K_BSR, 0, AR5K_INI_READ },
63 { AR5K_TXCFG, AR5K_DMASIZE_128B },
64 { AR5K_RXCFG, AR5K_DMASIZE_128B },
65 { AR5K_CFG, AR5K_INIT_CFG },
Nick Kossifidisc6e387a2008-08-29 22:45:39 +030066 { AR5K_TOPS, 8 },
67 { AR5K_RXNOFRM, 8 },
68 { AR5K_RPGTO, 0 },
69 { AR5K_TXNOFRM, 0 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +020070 { AR5K_SFR, 0 },
71 { AR5K_MIBC, 0 },
72 { AR5K_MISC, 0 },
73 { AR5K_RX_FILTER_5210, 0 },
74 { AR5K_MCAST_FILTER0_5210, 0 },
75 { AR5K_MCAST_FILTER1_5210, 0 },
76 { AR5K_TX_MASK0, 0 },
77 { AR5K_TX_MASK1, 0 },
78 { AR5K_CLR_TMASK, 0 },
79 { AR5K_TRIG_LVL, AR5K_TUNE_MIN_TX_FIFO_THRES },
80 { AR5K_DIAG_SW_5210, 0 },
81 { AR5K_RSSI_THR, AR5K_TUNE_RSSI_THRES },
82 { AR5K_TSF_L32_5210, 0 },
83 { AR5K_TIMER0_5210, 0 },
84 { AR5K_TIMER1_5210, 0xffffffff },
85 { AR5K_TIMER2_5210, 0xffffffff },
86 { AR5K_TIMER3_5210, 1 },
87 { AR5K_CFP_DUR_5210, 0 },
88 { AR5K_CFP_PERIOD_5210, 0 },
89 /* PHY registers */
90 { AR5K_PHY(0), 0x00000047 },
91 { AR5K_PHY_AGC, 0x00000000 },
92 { AR5K_PHY(3), 0x09848ea6 },
93 { AR5K_PHY(4), 0x3d32e000 },
94 { AR5K_PHY(5), 0x0000076b },
95 { AR5K_PHY_ACT, AR5K_PHY_ACT_DISABLE },
96 { AR5K_PHY(8), 0x02020200 },
97 { AR5K_PHY(9), 0x00000e0e },
98 { AR5K_PHY(10), 0x0a020201 },
99 { AR5K_PHY(11), 0x00036ffc },
100 { AR5K_PHY(12), 0x00000000 },
101 { AR5K_PHY(13), 0x00000e0e },
102 { AR5K_PHY(14), 0x00000007 },
103 { AR5K_PHY(15), 0x00020100 },
104 { AR5K_PHY(16), 0x89630000 },
105 { AR5K_PHY(17), 0x1372169c },
106 { AR5K_PHY(18), 0x0018b633 },
107 { AR5K_PHY(19), 0x1284613c },
108 { AR5K_PHY(20), 0x0de8b8e0 },
109 { AR5K_PHY(21), 0x00074859 },
110 { AR5K_PHY(22), 0x7e80beba },
111 { AR5K_PHY(23), 0x313a665e },
112 { AR5K_PHY_AGCCTL, 0x00001d08 },
113 { AR5K_PHY(25), 0x0001ce00 },
114 { AR5K_PHY(26), 0x409a4190 },
115 { AR5K_PHY(28), 0x0000000f },
116 { AR5K_PHY(29), 0x00000080 },
117 { AR5K_PHY(30), 0x00000004 },
Pavel Roskin0a5d3812011-07-07 18:13:24 -0400118 { AR5K_PHY(31), 0x00000018 }, /* 0x987c */
119 { AR5K_PHY(64), 0x00000000 }, /* 0x9900 */
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200120 { AR5K_PHY(65), 0x00000000 },
121 { AR5K_PHY(66), 0x00000000 },
122 { AR5K_PHY(67), 0x00800000 },
123 { AR5K_PHY(68), 0x00000003 },
124 /* BB gain table (64bytes) */
125 { AR5K_BB_GAIN(0), 0x00000000 },
126 { AR5K_BB_GAIN(1), 0x00000020 },
127 { AR5K_BB_GAIN(2), 0x00000010 },
128 { AR5K_BB_GAIN(3), 0x00000030 },
129 { AR5K_BB_GAIN(4), 0x00000008 },
130 { AR5K_BB_GAIN(5), 0x00000028 },
131 { AR5K_BB_GAIN(6), 0x00000028 },
132 { AR5K_BB_GAIN(7), 0x00000004 },
133 { AR5K_BB_GAIN(8), 0x00000024 },
134 { AR5K_BB_GAIN(9), 0x00000014 },
135 { AR5K_BB_GAIN(10), 0x00000034 },
136 { AR5K_BB_GAIN(11), 0x0000000c },
137 { AR5K_BB_GAIN(12), 0x0000002c },
138 { AR5K_BB_GAIN(13), 0x00000002 },
139 { AR5K_BB_GAIN(14), 0x00000022 },
140 { AR5K_BB_GAIN(15), 0x00000012 },
141 { AR5K_BB_GAIN(16), 0x00000032 },
142 { AR5K_BB_GAIN(17), 0x0000000a },
143 { AR5K_BB_GAIN(18), 0x0000002a },
144 { AR5K_BB_GAIN(19), 0x00000001 },
145 { AR5K_BB_GAIN(20), 0x00000021 },
146 { AR5K_BB_GAIN(21), 0x00000011 },
147 { AR5K_BB_GAIN(22), 0x00000031 },
148 { AR5K_BB_GAIN(23), 0x00000009 },
149 { AR5K_BB_GAIN(24), 0x00000029 },
150 { AR5K_BB_GAIN(25), 0x00000005 },
151 { AR5K_BB_GAIN(26), 0x00000025 },
152 { AR5K_BB_GAIN(27), 0x00000015 },
153 { AR5K_BB_GAIN(28), 0x00000035 },
154 { AR5K_BB_GAIN(29), 0x0000000d },
155 { AR5K_BB_GAIN(30), 0x0000002d },
156 { AR5K_BB_GAIN(31), 0x00000003 },
157 { AR5K_BB_GAIN(32), 0x00000023 },
158 { AR5K_BB_GAIN(33), 0x00000013 },
159 { AR5K_BB_GAIN(34), 0x00000033 },
160 { AR5K_BB_GAIN(35), 0x0000000b },
161 { AR5K_BB_GAIN(36), 0x0000002b },
162 { AR5K_BB_GAIN(37), 0x00000007 },
163 { AR5K_BB_GAIN(38), 0x00000027 },
164 { AR5K_BB_GAIN(39), 0x00000017 },
165 { AR5K_BB_GAIN(40), 0x00000037 },
166 { AR5K_BB_GAIN(41), 0x0000000f },
167 { AR5K_BB_GAIN(42), 0x0000002f },
168 { AR5K_BB_GAIN(43), 0x0000002f },
169 { AR5K_BB_GAIN(44), 0x0000002f },
170 { AR5K_BB_GAIN(45), 0x0000002f },
171 { AR5K_BB_GAIN(46), 0x0000002f },
172 { AR5K_BB_GAIN(47), 0x0000002f },
173 { AR5K_BB_GAIN(48), 0x0000002f },
174 { AR5K_BB_GAIN(49), 0x0000002f },
175 { AR5K_BB_GAIN(50), 0x0000002f },
176 { AR5K_BB_GAIN(51), 0x0000002f },
177 { AR5K_BB_GAIN(52), 0x0000002f },
178 { AR5K_BB_GAIN(53), 0x0000002f },
179 { AR5K_BB_GAIN(54), 0x0000002f },
180 { AR5K_BB_GAIN(55), 0x0000002f },
181 { AR5K_BB_GAIN(56), 0x0000002f },
182 { AR5K_BB_GAIN(57), 0x0000002f },
183 { AR5K_BB_GAIN(58), 0x0000002f },
184 { AR5K_BB_GAIN(59), 0x0000002f },
185 { AR5K_BB_GAIN(60), 0x0000002f },
186 { AR5K_BB_GAIN(61), 0x0000002f },
187 { AR5K_BB_GAIN(62), 0x0000002f },
188 { AR5K_BB_GAIN(63), 0x0000002f },
189 /* 5110 RF gain table (64btes) */
190 { AR5K_RF_GAIN(0), 0x0000001d },
191 { AR5K_RF_GAIN(1), 0x0000005d },
192 { AR5K_RF_GAIN(2), 0x0000009d },
193 { AR5K_RF_GAIN(3), 0x000000dd },
194 { AR5K_RF_GAIN(4), 0x0000011d },
195 { AR5K_RF_GAIN(5), 0x00000021 },
196 { AR5K_RF_GAIN(6), 0x00000061 },
197 { AR5K_RF_GAIN(7), 0x000000a1 },
198 { AR5K_RF_GAIN(8), 0x000000e1 },
199 { AR5K_RF_GAIN(9), 0x00000031 },
200 { AR5K_RF_GAIN(10), 0x00000071 },
201 { AR5K_RF_GAIN(11), 0x000000b1 },
202 { AR5K_RF_GAIN(12), 0x0000001c },
203 { AR5K_RF_GAIN(13), 0x0000005c },
204 { AR5K_RF_GAIN(14), 0x00000029 },
205 { AR5K_RF_GAIN(15), 0x00000069 },
206 { AR5K_RF_GAIN(16), 0x000000a9 },
207 { AR5K_RF_GAIN(17), 0x00000020 },
208 { AR5K_RF_GAIN(18), 0x00000019 },
209 { AR5K_RF_GAIN(19), 0x00000059 },
210 { AR5K_RF_GAIN(20), 0x00000099 },
211 { AR5K_RF_GAIN(21), 0x00000030 },
212 { AR5K_RF_GAIN(22), 0x00000005 },
213 { AR5K_RF_GAIN(23), 0x00000025 },
214 { AR5K_RF_GAIN(24), 0x00000065 },
215 { AR5K_RF_GAIN(25), 0x000000a5 },
216 { AR5K_RF_GAIN(26), 0x00000028 },
217 { AR5K_RF_GAIN(27), 0x00000068 },
218 { AR5K_RF_GAIN(28), 0x0000001f },
219 { AR5K_RF_GAIN(29), 0x0000001e },
220 { AR5K_RF_GAIN(30), 0x00000018 },
221 { AR5K_RF_GAIN(31), 0x00000058 },
222 { AR5K_RF_GAIN(32), 0x00000098 },
223 { AR5K_RF_GAIN(33), 0x00000003 },
224 { AR5K_RF_GAIN(34), 0x00000004 },
225 { AR5K_RF_GAIN(35), 0x00000044 },
226 { AR5K_RF_GAIN(36), 0x00000084 },
227 { AR5K_RF_GAIN(37), 0x00000013 },
228 { AR5K_RF_GAIN(38), 0x00000012 },
229 { AR5K_RF_GAIN(39), 0x00000052 },
230 { AR5K_RF_GAIN(40), 0x00000092 },
231 { AR5K_RF_GAIN(41), 0x000000d2 },
232 { AR5K_RF_GAIN(42), 0x0000002b },
233 { AR5K_RF_GAIN(43), 0x0000002a },
234 { AR5K_RF_GAIN(44), 0x0000006a },
235 { AR5K_RF_GAIN(45), 0x000000aa },
236 { AR5K_RF_GAIN(46), 0x0000001b },
237 { AR5K_RF_GAIN(47), 0x0000001a },
238 { AR5K_RF_GAIN(48), 0x0000005a },
239 { AR5K_RF_GAIN(49), 0x0000009a },
240 { AR5K_RF_GAIN(50), 0x000000da },
241 { AR5K_RF_GAIN(51), 0x00000006 },
242 { AR5K_RF_GAIN(52), 0x00000006 },
243 { AR5K_RF_GAIN(53), 0x00000006 },
244 { AR5K_RF_GAIN(54), 0x00000006 },
245 { AR5K_RF_GAIN(55), 0x00000006 },
246 { AR5K_RF_GAIN(56), 0x00000006 },
247 { AR5K_RF_GAIN(57), 0x00000006 },
248 { AR5K_RF_GAIN(58), 0x00000006 },
249 { AR5K_RF_GAIN(59), 0x00000006 },
250 { AR5K_RF_GAIN(60), 0x00000006 },
251 { AR5K_RF_GAIN(61), 0x00000006 },
252 { AR5K_RF_GAIN(62), 0x00000006 },
253 { AR5K_RF_GAIN(63), 0x00000006 },
254 /* PHY activation */
255 { AR5K_PHY(53), 0x00000020 },
256 { AR5K_PHY(51), 0x00000004 },
257 { AR5K_PHY(50), 0x00060106 },
258 { AR5K_PHY(39), 0x0000006d },
259 { AR5K_PHY(48), 0x00000000 },
260 { AR5K_PHY(52), 0x00000014 },
261 { AR5K_PHY_ACT, AR5K_PHY_ACT_ENABLE },
262};
263
264/* Initial register settings for AR5211 */
265static const struct ath5k_ini ar5211_ini[] = {
266 { AR5K_RXDP, 0x00000000 },
267 { AR5K_RTSD0, 0x84849c9c },
268 { AR5K_RTSD1, 0x7c7c7c7c },
269 { AR5K_RXCFG, 0x00000005 },
270 { AR5K_MIBC, 0x00000000 },
271 { AR5K_TOPS, 0x00000008 },
272 { AR5K_RXNOFRM, 0x00000008 },
273 { AR5K_TXNOFRM, 0x00000010 },
274 { AR5K_RPGTO, 0x00000000 },
275 { AR5K_RFCNT, 0x0000001f },
276 { AR5K_QUEUE_TXDP(0), 0x00000000 },
277 { AR5K_QUEUE_TXDP(1), 0x00000000 },
278 { AR5K_QUEUE_TXDP(2), 0x00000000 },
279 { AR5K_QUEUE_TXDP(3), 0x00000000 },
280 { AR5K_QUEUE_TXDP(4), 0x00000000 },
281 { AR5K_QUEUE_TXDP(5), 0x00000000 },
282 { AR5K_QUEUE_TXDP(6), 0x00000000 },
283 { AR5K_QUEUE_TXDP(7), 0x00000000 },
284 { AR5K_QUEUE_TXDP(8), 0x00000000 },
285 { AR5K_QUEUE_TXDP(9), 0x00000000 },
286 { AR5K_DCU_FP, 0x00000000 },
287 { AR5K_STA_ID1, 0x00000000 },
288 { AR5K_BSS_ID0, 0x00000000 },
289 { AR5K_BSS_ID1, 0x00000000 },
290 { AR5K_RSSI_THR, 0x00000000 },
291 { AR5K_CFP_PERIOD_5211, 0x00000000 },
292 { AR5K_TIMER0_5211, 0x00000030 },
293 { AR5K_TIMER1_5211, 0x0007ffff },
294 { AR5K_TIMER2_5211, 0x01ffffff },
295 { AR5K_TIMER3_5211, 0x00000031 },
296 { AR5K_CFP_DUR_5211, 0x00000000 },
297 { AR5K_RX_FILTER_5211, 0x00000000 },
298 { AR5K_MCAST_FILTER0_5211, 0x00000000 },
299 { AR5K_MCAST_FILTER1_5211, 0x00000002 },
300 { AR5K_DIAG_SW_5211, 0x00000000 },
301 { AR5K_ADDAC_TEST, 0x00000000 },
302 { AR5K_DEFAULT_ANTENNA, 0x00000000 },
303 /* PHY registers */
304 { AR5K_PHY_AGC, 0x00000000 },
305 { AR5K_PHY(3), 0x2d849093 },
306 { AR5K_PHY(4), 0x7d32e000 },
307 { AR5K_PHY(5), 0x00000f6b },
308 { AR5K_PHY_ACT, 0x00000000 },
309 { AR5K_PHY(11), 0x00026ffe },
310 { AR5K_PHY(12), 0x00000000 },
311 { AR5K_PHY(15), 0x00020100 },
312 { AR5K_PHY(16), 0x206a017a },
313 { AR5K_PHY(19), 0x1284613c },
314 { AR5K_PHY(21), 0x00000859 },
315 { AR5K_PHY(26), 0x409a4190 }, /* 0x9868 */
316 { AR5K_PHY(27), 0x050cb081 },
317 { AR5K_PHY(28), 0x0000000f },
318 { AR5K_PHY(29), 0x00000080 },
319 { AR5K_PHY(30), 0x0000000c },
320 { AR5K_PHY(64), 0x00000000 },
321 { AR5K_PHY(65), 0x00000000 },
322 { AR5K_PHY(66), 0x00000000 },
323 { AR5K_PHY(67), 0x00800000 },
324 { AR5K_PHY(68), 0x00000001 },
325 { AR5K_PHY(71), 0x0000092a },
326 { AR5K_PHY_IQ, 0x00000000 },
327 { AR5K_PHY(73), 0x00058a05 },
328 { AR5K_PHY(74), 0x00000001 },
329 { AR5K_PHY(75), 0x00000000 },
330 { AR5K_PHY_PAPD_PROBE, 0x00000000 },
331 { AR5K_PHY(77), 0x00000000 }, /* 0x9934 */
332 { AR5K_PHY(78), 0x00000000 }, /* 0x9938 */
333 { AR5K_PHY(79), 0x0000003f }, /* 0x993c */
334 { AR5K_PHY(80), 0x00000004 },
335 { AR5K_PHY(82), 0x00000000 },
336 { AR5K_PHY(83), 0x00000000 },
337 { AR5K_PHY(84), 0x00000000 },
338 { AR5K_PHY_RADAR, 0x5d50f14c },
339 { AR5K_PHY(86), 0x00000018 },
340 { AR5K_PHY(87), 0x004b6a8e },
341 /* Initial Power table (32bytes)
342 * common on all cards/modes.
343 * Note: Table is rewritten during
344 * txpower setup later using calibration
Nick Kossifidisa406c132009-02-09 06:08:51 +0200345 * data etc. so next write is non-common */
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200346 { AR5K_PHY_PCDAC_TXPOWER(1), 0x06ff05ff },
347 { AR5K_PHY_PCDAC_TXPOWER(2), 0x07ff07ff },
348 { AR5K_PHY_PCDAC_TXPOWER(3), 0x08ff08ff },
349 { AR5K_PHY_PCDAC_TXPOWER(4), 0x09ff09ff },
350 { AR5K_PHY_PCDAC_TXPOWER(5), 0x0aff0aff },
351 { AR5K_PHY_PCDAC_TXPOWER(6), 0x0bff0bff },
352 { AR5K_PHY_PCDAC_TXPOWER(7), 0x0cff0cff },
353 { AR5K_PHY_PCDAC_TXPOWER(8), 0x0dff0dff },
354 { AR5K_PHY_PCDAC_TXPOWER(9), 0x0fff0eff },
355 { AR5K_PHY_PCDAC_TXPOWER(10), 0x12ff12ff },
356 { AR5K_PHY_PCDAC_TXPOWER(11), 0x14ff13ff },
357 { AR5K_PHY_PCDAC_TXPOWER(12), 0x16ff15ff },
358 { AR5K_PHY_PCDAC_TXPOWER(13), 0x19ff17ff },
359 { AR5K_PHY_PCDAC_TXPOWER(14), 0x1bff1aff },
360 { AR5K_PHY_PCDAC_TXPOWER(15), 0x1eff1dff },
361 { AR5K_PHY_PCDAC_TXPOWER(16), 0x23ff20ff },
362 { AR5K_PHY_PCDAC_TXPOWER(17), 0x27ff25ff },
363 { AR5K_PHY_PCDAC_TXPOWER(18), 0x2cff29ff },
364 { AR5K_PHY_PCDAC_TXPOWER(19), 0x31ff2fff },
365 { AR5K_PHY_PCDAC_TXPOWER(20), 0x37ff34ff },
366 { AR5K_PHY_PCDAC_TXPOWER(21), 0x3aff3aff },
367 { AR5K_PHY_PCDAC_TXPOWER(22), 0x3aff3aff },
368 { AR5K_PHY_PCDAC_TXPOWER(23), 0x3aff3aff },
369 { AR5K_PHY_PCDAC_TXPOWER(24), 0x3aff3aff },
370 { AR5K_PHY_PCDAC_TXPOWER(25), 0x3aff3aff },
371 { AR5K_PHY_PCDAC_TXPOWER(26), 0x3aff3aff },
372 { AR5K_PHY_PCDAC_TXPOWER(27), 0x3aff3aff },
373 { AR5K_PHY_PCDAC_TXPOWER(28), 0x3aff3aff },
374 { AR5K_PHY_PCDAC_TXPOWER(29), 0x3aff3aff },
375 { AR5K_PHY_PCDAC_TXPOWER(30), 0x3aff3aff },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200376 { AR5K_PHY_PCDAC_TXPOWER(31), 0x3aff3aff },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200377 { AR5K_PHY_CCKTXCTL, 0x00000000 },
378 { AR5K_PHY(642), 0x503e4646 },
379 { AR5K_PHY_GAIN_2GHZ, 0x6480416c },
380 { AR5K_PHY(644), 0x0199a003 },
381 { AR5K_PHY(645), 0x044cd610 },
382 { AR5K_PHY(646), 0x13800040 },
383 { AR5K_PHY(647), 0x1be00060 },
384 { AR5K_PHY(648), 0x0c53800a },
385 { AR5K_PHY(649), 0x0014df3b },
386 { AR5K_PHY(650), 0x000001b5 },
387 { AR5K_PHY(651), 0x00000020 },
388};
389
390/* Initial mode-specific settings for AR5211
Nick Kossifidisa406c132009-02-09 06:08:51 +0200391 * 5211 supports OFDM-only g (draft g) but we
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200392 * need to test it ! */
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200393static const struct ath5k_ini_mode ar5211_ini_mode[] = {
394 { AR5K_TXCFG,
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200395 /* A B G */
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200396 { 0x00000015, 0x0000001d, 0x00000015 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200397 { AR5K_QUEUE_DFS_LOCAL_IFS(0),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200398 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200399 { AR5K_QUEUE_DFS_LOCAL_IFS(1),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200400 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200401 { AR5K_QUEUE_DFS_LOCAL_IFS(2),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200402 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200403 { AR5K_QUEUE_DFS_LOCAL_IFS(3),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200404 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200405 { AR5K_QUEUE_DFS_LOCAL_IFS(4),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200406 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200407 { AR5K_QUEUE_DFS_LOCAL_IFS(5),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200408 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200409 { AR5K_QUEUE_DFS_LOCAL_IFS(6),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200410 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200411 { AR5K_QUEUE_DFS_LOCAL_IFS(7),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200412 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200413 { AR5K_QUEUE_DFS_LOCAL_IFS(8),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200414 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200415 { AR5K_QUEUE_DFS_LOCAL_IFS(9),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200416 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200417 { AR5K_DCU_GBL_IFS_SLOT,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200418 { 0x00000168, 0x000001b8, 0x00000168 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200419 { AR5K_DCU_GBL_IFS_SIFS,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200420 { 0x00000230, 0x000000b0, 0x00000230 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200421 { AR5K_DCU_GBL_IFS_EIFS,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200422 { 0x00000d98, 0x00001f48, 0x00000d98 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200423 { AR5K_DCU_GBL_IFS_MISC,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200424 { 0x0000a0e0, 0x00005880, 0x0000a0e0 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200425 { AR5K_TIME_OUT,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200426 { 0x04000400, 0x20003000, 0x04000400 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200427 { AR5K_USEC_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200428 { 0x0e8d8fa7, 0x01608f95, 0x0e8d8fa7 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200429 { AR5K_PHY(8),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200430 { 0x02020200, 0x02010200, 0x02020200 } },
431 { AR5K_PHY_RF_CTL2,
432 { 0x00000e0e, 0x00000707, 0x00000e0e } },
433 { AR5K_PHY_RF_CTL3,
434 { 0x0a020001, 0x05010000, 0x0a020001 } },
435 { AR5K_PHY_RF_CTL4,
436 { 0x00000e0e, 0x00000e0e, 0x00000e0e } },
437 { AR5K_PHY_PA_CTL,
438 { 0x00000007, 0x0000000b, 0x0000000b } },
439 { AR5K_PHY_SETTLING,
440 { 0x1372169c, 0x137216a8, 0x1372169c } },
441 { AR5K_PHY_GAIN,
442 { 0x0018ba67, 0x0018ba69, 0x0018ba69 } },
443 { AR5K_PHY_DESIRED_SIZE,
444 { 0x0c28b4e0, 0x0c28b4e0, 0x0c28b4e0 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200445 { AR5K_PHY_SIG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200446 { 0x7e800d2e, 0x7ec00d2e, 0x7e800d2e } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200447 { AR5K_PHY_AGCCOARSE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200448 { 0x31375d5e, 0x313a5d5e, 0x31375d5e } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200449 { AR5K_PHY_AGCCTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200450 { 0x0000bd10, 0x0000bd38, 0x0000bd10 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200451 { AR5K_PHY_NF,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200452 { 0x0001ce00, 0x0001ce00, 0x0001ce00 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200453 { AR5K_PHY_RX_DELAY,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200454 { 0x00002710, 0x0000157c, 0x00002710 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200455 { AR5K_PHY(70),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200456 { 0x00000190, 0x00000084, 0x00000190 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200457 { AR5K_PHY_FRAME_CTL_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200458 { 0x6fe01020, 0x6fe00920, 0x6fe01020 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200459 { AR5K_PHY_PCDAC_TXPOWER_BASE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200460 { 0x05ff14ff, 0x05ff14ff, 0x05ff19ff } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200461 { AR5K_RF_BUFFER_CONTROL_4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200462 { 0x00000010, 0x00000010, 0x00000010 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200463};
464
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200465/* Initial register settings for AR5212 and newer chips */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200466static const struct ath5k_ini ar5212_ini_common_start[] = {
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200467 { AR5K_RXDP, 0x00000000 },
468 { AR5K_RXCFG, 0x00000005 },
469 { AR5K_MIBC, 0x00000000 },
470 { AR5K_TOPS, 0x00000008 },
471 { AR5K_RXNOFRM, 0x00000008 },
472 { AR5K_TXNOFRM, 0x00000010 },
473 { AR5K_RPGTO, 0x00000000 },
474 { AR5K_RFCNT, 0x0000001f },
475 { AR5K_QUEUE_TXDP(0), 0x00000000 },
476 { AR5K_QUEUE_TXDP(1), 0x00000000 },
477 { AR5K_QUEUE_TXDP(2), 0x00000000 },
478 { AR5K_QUEUE_TXDP(3), 0x00000000 },
479 { AR5K_QUEUE_TXDP(4), 0x00000000 },
480 { AR5K_QUEUE_TXDP(5), 0x00000000 },
481 { AR5K_QUEUE_TXDP(6), 0x00000000 },
482 { AR5K_QUEUE_TXDP(7), 0x00000000 },
483 { AR5K_QUEUE_TXDP(8), 0x00000000 },
484 { AR5K_QUEUE_TXDP(9), 0x00000000 },
485 { AR5K_DCU_FP, 0x00000000 },
486 { AR5K_DCU_TXP, 0x00000000 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200487 /* Tx filter table 0 (32 entries) */
488 { AR5K_DCU_TX_FILTER_0(0), 0x00000000 }, /* DCU 0 */
489 { AR5K_DCU_TX_FILTER_0(1), 0x00000000 },
490 { AR5K_DCU_TX_FILTER_0(2), 0x00000000 },
491 { AR5K_DCU_TX_FILTER_0(3), 0x00000000 },
492 { AR5K_DCU_TX_FILTER_0(4), 0x00000000 }, /* DCU 1 */
493 { AR5K_DCU_TX_FILTER_0(5), 0x00000000 },
494 { AR5K_DCU_TX_FILTER_0(6), 0x00000000 },
495 { AR5K_DCU_TX_FILTER_0(7), 0x00000000 },
496 { AR5K_DCU_TX_FILTER_0(8), 0x00000000 }, /* DCU 2 */
497 { AR5K_DCU_TX_FILTER_0(9), 0x00000000 },
498 { AR5K_DCU_TX_FILTER_0(10), 0x00000000 },
499 { AR5K_DCU_TX_FILTER_0(11), 0x00000000 },
500 { AR5K_DCU_TX_FILTER_0(12), 0x00000000 }, /* DCU 3 */
501 { AR5K_DCU_TX_FILTER_0(13), 0x00000000 },
502 { AR5K_DCU_TX_FILTER_0(14), 0x00000000 },
503 { AR5K_DCU_TX_FILTER_0(15), 0x00000000 },
504 { AR5K_DCU_TX_FILTER_0(16), 0x00000000 }, /* DCU 4 */
505 { AR5K_DCU_TX_FILTER_0(17), 0x00000000 },
506 { AR5K_DCU_TX_FILTER_0(18), 0x00000000 },
507 { AR5K_DCU_TX_FILTER_0(19), 0x00000000 },
508 { AR5K_DCU_TX_FILTER_0(20), 0x00000000 }, /* DCU 5 */
509 { AR5K_DCU_TX_FILTER_0(21), 0x00000000 },
510 { AR5K_DCU_TX_FILTER_0(22), 0x00000000 },
511 { AR5K_DCU_TX_FILTER_0(23), 0x00000000 },
512 { AR5K_DCU_TX_FILTER_0(24), 0x00000000 }, /* DCU 6 */
513 { AR5K_DCU_TX_FILTER_0(25), 0x00000000 },
514 { AR5K_DCU_TX_FILTER_0(26), 0x00000000 },
515 { AR5K_DCU_TX_FILTER_0(27), 0x00000000 },
516 { AR5K_DCU_TX_FILTER_0(28), 0x00000000 }, /* DCU 7 */
517 { AR5K_DCU_TX_FILTER_0(29), 0x00000000 },
518 { AR5K_DCU_TX_FILTER_0(30), 0x00000000 },
519 { AR5K_DCU_TX_FILTER_0(31), 0x00000000 },
520 /* Tx filter table 1 (16 entries) */
521 { AR5K_DCU_TX_FILTER_1(0), 0x00000000 },
522 { AR5K_DCU_TX_FILTER_1(1), 0x00000000 },
523 { AR5K_DCU_TX_FILTER_1(2), 0x00000000 },
524 { AR5K_DCU_TX_FILTER_1(3), 0x00000000 },
525 { AR5K_DCU_TX_FILTER_1(4), 0x00000000 },
526 { AR5K_DCU_TX_FILTER_1(5), 0x00000000 },
527 { AR5K_DCU_TX_FILTER_1(6), 0x00000000 },
528 { AR5K_DCU_TX_FILTER_1(7), 0x00000000 },
529 { AR5K_DCU_TX_FILTER_1(8), 0x00000000 },
530 { AR5K_DCU_TX_FILTER_1(9), 0x00000000 },
531 { AR5K_DCU_TX_FILTER_1(10), 0x00000000 },
532 { AR5K_DCU_TX_FILTER_1(11), 0x00000000 },
533 { AR5K_DCU_TX_FILTER_1(12), 0x00000000 },
534 { AR5K_DCU_TX_FILTER_1(13), 0x00000000 },
535 { AR5K_DCU_TX_FILTER_1(14), 0x00000000 },
536 { AR5K_DCU_TX_FILTER_1(15), 0x00000000 },
537 { AR5K_DCU_TX_FILTER_CLR, 0x00000000 },
538 { AR5K_DCU_TX_FILTER_SET, 0x00000000 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200539 { AR5K_STA_ID1, 0x00000000 },
540 { AR5K_BSS_ID0, 0x00000000 },
541 { AR5K_BSS_ID1, 0x00000000 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200542 { AR5K_BEACON_5211, 0x00000000 },
543 { AR5K_CFP_PERIOD_5211, 0x00000000 },
544 { AR5K_TIMER0_5211, 0x00000030 },
545 { AR5K_TIMER1_5211, 0x0007ffff },
546 { AR5K_TIMER2_5211, 0x01ffffff },
547 { AR5K_TIMER3_5211, 0x00000031 },
548 { AR5K_CFP_DUR_5211, 0x00000000 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200549 { AR5K_RX_FILTER_5211, 0x00000000 },
550 { AR5K_DIAG_SW_5211, 0x00000000 },
551 { AR5K_ADDAC_TEST, 0x00000000 },
552 { AR5K_DEFAULT_ANTENNA, 0x00000000 },
Pavel Roskin0a5d3812011-07-07 18:13:24 -0400553 { AR5K_FRAME_CTL_QOSM, 0x000fc78f },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200554 { AR5K_XRMODE, 0x2a82301a },
555 { AR5K_XRDELAY, 0x05dc01e0 },
556 { AR5K_XRTIMEOUT, 0x1f402710 },
557 { AR5K_XRCHIRP, 0x01f40000 },
558 { AR5K_XRSTOMP, 0x00001e1c },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200559 { AR5K_SLEEP0, 0x0002aaaa },
560 { AR5K_SLEEP1, 0x02005555 },
561 { AR5K_SLEEP2, 0x00000000 },
Luis R. Rodriguez13b81552009-09-10 17:52:45 -0700562 { AR_BSSMSKL, 0xffffffff },
563 { AR_BSSMSKU, 0x0000ffff },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200564 { AR5K_TXPC, 0x00000000 },
565 { AR5K_PROFCNT_TX, 0x00000000 },
566 { AR5K_PROFCNT_RX, 0x00000000 },
567 { AR5K_PROFCNT_RXCLR, 0x00000000 },
568 { AR5K_PROFCNT_CYCLE, 0x00000000 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200569 { AR5K_QUIET_CTL1, 0x00000088 },
570 /* Initial rate duration table (32 entries )*/
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200571 { AR5K_RATE_DUR(0), 0x00000000 },
572 { AR5K_RATE_DUR(1), 0x0000008c },
573 { AR5K_RATE_DUR(2), 0x000000e4 },
574 { AR5K_RATE_DUR(3), 0x000002d5 },
575 { AR5K_RATE_DUR(4), 0x00000000 },
576 { AR5K_RATE_DUR(5), 0x00000000 },
577 { AR5K_RATE_DUR(6), 0x000000a0 },
578 { AR5K_RATE_DUR(7), 0x000001c9 },
579 { AR5K_RATE_DUR(8), 0x0000002c },
580 { AR5K_RATE_DUR(9), 0x0000002c },
581 { AR5K_RATE_DUR(10), 0x00000030 },
582 { AR5K_RATE_DUR(11), 0x0000003c },
583 { AR5K_RATE_DUR(12), 0x0000002c },
584 { AR5K_RATE_DUR(13), 0x0000002c },
585 { AR5K_RATE_DUR(14), 0x00000030 },
586 { AR5K_RATE_DUR(15), 0x0000003c },
587 { AR5K_RATE_DUR(16), 0x00000000 },
588 { AR5K_RATE_DUR(17), 0x00000000 },
589 { AR5K_RATE_DUR(18), 0x00000000 },
590 { AR5K_RATE_DUR(19), 0x00000000 },
591 { AR5K_RATE_DUR(20), 0x00000000 },
592 { AR5K_RATE_DUR(21), 0x00000000 },
593 { AR5K_RATE_DUR(22), 0x00000000 },
594 { AR5K_RATE_DUR(23), 0x00000000 },
595 { AR5K_RATE_DUR(24), 0x000000d5 },
596 { AR5K_RATE_DUR(25), 0x000000df },
597 { AR5K_RATE_DUR(26), 0x00000102 },
598 { AR5K_RATE_DUR(27), 0x0000013a },
599 { AR5K_RATE_DUR(28), 0x00000075 },
600 { AR5K_RATE_DUR(29), 0x0000007f },
601 { AR5K_RATE_DUR(30), 0x000000a2 },
602 { AR5K_RATE_DUR(31), 0x00000000 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200603 { AR5K_QUIET_CTL2, 0x00010002 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200604 { AR5K_TSF_PARM, 0x00000001 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200605 { AR5K_QOS_NOACK, 0x000000c0 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200606 { AR5K_PHY_ERR_FIL, 0x00000000 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200607 { AR5K_XRLAT_TX, 0x00000168 },
608 { AR5K_ACKSIFS, 0x00000000 },
609 /* Rate -> db table
610 * notice ...03<-02<-01<-00 ! */
611 { AR5K_RATE2DB(0), 0x03020100 },
612 { AR5K_RATE2DB(1), 0x07060504 },
613 { AR5K_RATE2DB(2), 0x0b0a0908 },
614 { AR5K_RATE2DB(3), 0x0f0e0d0c },
615 { AR5K_RATE2DB(4), 0x13121110 },
616 { AR5K_RATE2DB(5), 0x17161514 },
617 { AR5K_RATE2DB(6), 0x1b1a1918 },
618 { AR5K_RATE2DB(7), 0x1f1e1d1c },
619 /* Db -> Rate table */
620 { AR5K_DB2RATE(0), 0x03020100 },
621 { AR5K_DB2RATE(1), 0x07060504 },
622 { AR5K_DB2RATE(2), 0x0b0a0908 },
623 { AR5K_DB2RATE(3), 0x0f0e0d0c },
624 { AR5K_DB2RATE(4), 0x13121110 },
625 { AR5K_DB2RATE(5), 0x17161514 },
626 { AR5K_DB2RATE(6), 0x1b1a1918 },
627 { AR5K_DB2RATE(7), 0x1f1e1d1c },
628 /* PHY registers (Common settings
629 * for all chips/modes) */
630 { AR5K_PHY(3), 0xad848e19 },
631 { AR5K_PHY(4), 0x7d28e000 },
632 { AR5K_PHY_TIMING_3, 0x9c0a9f6b },
633 { AR5K_PHY_ACT, 0x00000000 },
634 { AR5K_PHY(16), 0x206a017a },
635 { AR5K_PHY(21), 0x00000859 },
636 { AR5K_PHY_BIN_MASK_1, 0x00000000 },
637 { AR5K_PHY_BIN_MASK_2, 0x00000000 },
638 { AR5K_PHY_BIN_MASK_3, 0x00000000 },
639 { AR5K_PHY_BIN_MASK_CTL, 0x00800000 },
640 { AR5K_PHY_ANT_CTL, 0x00000001 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200641 /*{ AR5K_PHY(71), 0x0000092a },*/ /* Old value */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200642 { AR5K_PHY_MAX_RX_LEN, 0x00000c80 },
643 { AR5K_PHY_IQ, 0x05100000 },
644 { AR5K_PHY_WARM_RESET, 0x00000001 },
645 { AR5K_PHY_CTL, 0x00000004 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200646 { AR5K_PHY_TXPOWER_RATE1, 0x1e1f2022 },
647 { AR5K_PHY_TXPOWER_RATE2, 0x0a0b0c0d },
648 { AR5K_PHY_TXPOWER_RATE_MAX, 0x0000003f },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200649 { AR5K_PHY(82), 0x9280b212 },
650 { AR5K_PHY_RADAR, 0x5d50e188 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200651 /*{ AR5K_PHY(86), 0x000000ff },*/
Nick Kossifidisa406c132009-02-09 06:08:51 +0200652 { AR5K_PHY(87), 0x004b6a8e },
653 { AR5K_PHY_NFTHRES, 0x000003ce },
654 { AR5K_PHY_RESTART, 0x192fb515 },
655 { AR5K_PHY(94), 0x00000001 },
656 { AR5K_PHY_RFBUS_REQ, 0x00000000 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200657 /*{ AR5K_PHY(644), 0x0080a333 },*/ /* Old value */
658 /*{ AR5K_PHY(645), 0x00206c10 },*/ /* Old value */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200659 { AR5K_PHY(644), 0x00806333 },
660 { AR5K_PHY(645), 0x00106c10 },
661 { AR5K_PHY(646), 0x009c4060 },
662 /* { AR5K_PHY(647), 0x1483800a }, */
663 /* { AR5K_PHY(648), 0x01831061 }, */ /* Old value */
664 { AR5K_PHY(648), 0x018830c6 },
665 { AR5K_PHY(649), 0x00000400 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200666 /*{ AR5K_PHY(650), 0x000001b5 },*/
Nick Kossifidisa406c132009-02-09 06:08:51 +0200667 { AR5K_PHY(651), 0x00000000 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200668 { AR5K_PHY_TXPOWER_RATE3, 0x20202020 },
Bob Copeland77ded012009-04-15 07:57:32 -0400669 { AR5K_PHY_TXPOWER_RATE4, 0x20202020 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200670 /*{ AR5K_PHY(655), 0x13c889af },*/
Nick Kossifidisa406c132009-02-09 06:08:51 +0200671 { AR5K_PHY(656), 0x38490a20 },
672 { AR5K_PHY(657), 0x00007bb6 },
673 { AR5K_PHY(658), 0x0fff3ffc },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200674};
675
676/* Initial mode-specific settings for AR5212 (Written before ar5212_ini) */
677static const struct ath5k_ini_mode ar5212_ini_mode_start[] = {
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200678 { AR5K_QUEUE_DFS_LOCAL_IFS(0),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200679 /* A/XR B G */
680 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200681 { AR5K_QUEUE_DFS_LOCAL_IFS(1),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200682 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200683 { AR5K_QUEUE_DFS_LOCAL_IFS(2),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200684 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200685 { AR5K_QUEUE_DFS_LOCAL_IFS(3),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200686 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200687 { AR5K_QUEUE_DFS_LOCAL_IFS(4),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200688 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200689 { AR5K_QUEUE_DFS_LOCAL_IFS(5),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200690 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200691 { AR5K_QUEUE_DFS_LOCAL_IFS(6),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200692 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200693 { AR5K_QUEUE_DFS_LOCAL_IFS(7),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200694 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200695 { AR5K_QUEUE_DFS_LOCAL_IFS(8),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200696 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200697 { AR5K_QUEUE_DFS_LOCAL_IFS(9),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200698 { 0x002ffc0f, 0x002ffc1f, 0x002ffc0f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200699 { AR5K_DCU_GBL_IFS_SIFS,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200700 { 0x00000230, 0x000000b0, 0x00000160 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200701 { AR5K_DCU_GBL_IFS_SLOT,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200702 { 0x00000168, 0x000001b8, 0x0000018c } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200703 { AR5K_DCU_GBL_IFS_EIFS,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200704 { 0x00000e60, 0x00001f1c, 0x00003e38 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200705 { AR5K_DCU_GBL_IFS_MISC,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200706 { 0x0000a0e0, 0x00005880, 0x0000b0e0 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200707 { AR5K_TIME_OUT,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200708 { 0x03e803e8, 0x04200420, 0x08400840 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200709 { AR5K_PHY(8),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200710 { 0x02020200, 0x02010200, 0x02020200 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200711 { AR5K_PHY_RF_CTL2,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200712 { 0x00000e0e, 0x00000707, 0x00000e0e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200713 { AR5K_PHY_SETTLING,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200714 { 0x1372161c, 0x13721722, 0x137216a2 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200715 { AR5K_PHY_AGCCTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200716 { 0x00009d10, 0x00009d18, 0x00009d18 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200717 { AR5K_PHY_NF,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200718 { 0x0001ce00, 0x0001ce00, 0x0001ce00 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200719 { AR5K_PHY_WEAK_OFDM_HIGH_THR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200720 { 0x409a4190, 0x409a4190, 0x409a4190 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200721 { AR5K_PHY(70),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200722 { 0x000001b8, 0x00000084, 0x00000108 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200723 { AR5K_PHY_OFDM_SELFCORR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200724 { 0x10058a05, 0x10058a05, 0x10058a05 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200725 { 0xa230,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200726 { 0x00000000, 0x00000000, 0x00000108 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200727};
728
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200729/* Initial mode-specific settings for AR5212 + RF5111
730 * (Written after ar5212_ini) */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200731static const struct ath5k_ini_mode rf5111_ini_mode_end[] = {
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200732 { AR5K_TXCFG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200733 /* A/XR B G */
734 { 0x00008015, 0x00008015, 0x00008015 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200735 { AR5K_USEC_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200736 { 0x128d8fa7, 0x04e00f95, 0x12e00fab } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200737 { AR5K_PHY_RF_CTL3,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200738 { 0x0a020001, 0x05010100, 0x0a020001 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200739 { AR5K_PHY_RF_CTL4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200740 { 0x00000e0e, 0x00000e0e, 0x00000e0e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200741 { AR5K_PHY_PA_CTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200742 { 0x00000007, 0x0000000b, 0x0000000b } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200743 { AR5K_PHY_GAIN,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200744 { 0x0018da5a, 0x0018ca69, 0x0018ca69 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200745 { AR5K_PHY_DESIRED_SIZE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200746 { 0x0de8b4e0, 0x0de8b4e0, 0x0de8b4e0 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200747 { AR5K_PHY_SIG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200748 { 0x7e800d2e, 0x7ee84d2e, 0x7ee84d2e } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200749 { AR5K_PHY_AGCCOARSE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200750 { 0x3137665e, 0x3137665e, 0x3137665e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200751 { AR5K_PHY_WEAK_OFDM_LOW_THR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200752 { 0x050cb081, 0x050cb081, 0x050cb080 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200753 { AR5K_PHY_RX_DELAY,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200754 { 0x00002710, 0x0000157c, 0x00002af8 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200755 { AR5K_PHY_FRAME_CTL_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200756 { 0xf7b81020, 0xf7b80d20, 0xf7b81020 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200757 { AR5K_PHY_GAIN_2GHZ,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200758 { 0x642c416a, 0x6440416a, 0x6440416a } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200759 { AR5K_PHY_CCK_RX_CTL_4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200760 { 0x1883800a, 0x1873800a, 0x1883800a } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200761};
762
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200763/* Common for all modes */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200764static const struct ath5k_ini rf5111_ini_common_end[] = {
765 { AR5K_DCU_FP, 0x00000000 },
Pavel Roskin0a5d3812011-07-07 18:13:24 -0400766 { AR5K_PHY_AGC, 0x00000000 },
767 { AR5K_PHY_ADC_CTL, 0x00022ffe },
768 { 0x983c, 0x00020100 },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200769 { AR5K_PHY_GAIN_OFFSET, 0x1284613c },
770 { AR5K_PHY_PAPD_PROBE, 0x00004883 },
771 { 0x9940, 0x00000004 },
772 { 0x9958, 0x000000ff },
773 { 0x9974, 0x00000000 },
774 { AR5K_PHY_SPENDING, 0x00000018 },
775 { AR5K_PHY_CCKTXCTL, 0x00000000 },
776 { AR5K_PHY_CCK_CROSSCORR, 0xd03e6788 },
777 { AR5K_PHY_DAG_CCK_CTL, 0x000001b5 },
778 { 0xa23c, 0x13c889af },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200779};
780
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200781
782/* Initial mode-specific settings for AR5212 + RF5112
783 * (Written after ar5212_ini) */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200784static const struct ath5k_ini_mode rf5112_ini_mode_end[] = {
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200785 { AR5K_TXCFG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200786 /* A/XR B G */
787 { 0x00008015, 0x00008015, 0x00008015 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200788 { AR5K_USEC_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200789 { 0x128d93a7, 0x04e01395, 0x12e013ab } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200790 { AR5K_PHY_RF_CTL3,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200791 { 0x0a020001, 0x05020100, 0x0a020001 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200792 { AR5K_PHY_RF_CTL4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200793 { 0x00000e0e, 0x00000e0e, 0x00000e0e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200794 { AR5K_PHY_PA_CTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200795 { 0x00000007, 0x0000000b, 0x0000000b } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200796 { AR5K_PHY_GAIN,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200797 { 0x0018da6d, 0x0018ca75, 0x0018ca75 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200798 { AR5K_PHY_DESIRED_SIZE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200799 { 0x0de8b4e0, 0x0de8b4e0, 0x0de8b4e0 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200800 { AR5K_PHY_SIG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200801 { 0x7e800d2e, 0x7ee80d2e, 0x7ee80d2e } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200802 { AR5K_PHY_AGCCOARSE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200803 { 0x3137665e, 0x3137665e, 0x3137665e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200804 { AR5K_PHY_WEAK_OFDM_LOW_THR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200805 { 0x050cb081, 0x050cb081, 0x050cb081 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200806 { AR5K_PHY_RX_DELAY,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200807 { 0x000007d0, 0x0000044c, 0x00000898 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200808 { AR5K_PHY_FRAME_CTL_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200809 { 0xf7b81020, 0xf7b80d10, 0xf7b81010 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200810 { AR5K_PHY_CCKTXCTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200811 { 0x00000000, 0x00000008, 0x00000008 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200812 { AR5K_PHY_CCK_CROSSCORR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200813 { 0xd6be6788, 0xd03e6788, 0xd03e6788 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200814 { AR5K_PHY_GAIN_2GHZ,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200815 { 0x642c0140, 0x6442c160, 0x6442c160 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200816 { AR5K_PHY_CCK_RX_CTL_4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200817 { 0x1883800a, 0x1873800a, 0x1883800a } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200818};
819
820static const struct ath5k_ini rf5112_ini_common_end[] = {
821 { AR5K_DCU_FP, 0x00000000 },
822 { AR5K_PHY_AGC, 0x00000000 },
823 { AR5K_PHY_ADC_CTL, 0x00022ffe },
824 { 0x983c, 0x00020100 },
825 { AR5K_PHY_GAIN_OFFSET, 0x1284613c },
826 { AR5K_PHY_PAPD_PROBE, 0x00004882 },
827 { 0x9940, 0x00000004 },
828 { 0x9958, 0x000000ff },
829 { 0x9974, 0x00000000 },
830 { AR5K_PHY_DAG_CCK_CTL, 0x000001b5 },
831 { 0xa23c, 0x13c889af },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200832};
833
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200834
835/* Initial mode-specific settings for RF5413/5414
836 * (Written after ar5212_ini) */
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200837static const struct ath5k_ini_mode rf5413_ini_mode_end[] = {
838 { AR5K_TXCFG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200839 /* A/XR B G */
840 { 0x00000015, 0x00000015, 0x00000015 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200841 { AR5K_USEC_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200842 { 0x128d93a7, 0x04e01395, 0x12e013ab } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200843 { AR5K_PHY_RF_CTL3,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200844 { 0x0a020001, 0x05020100, 0x0a020001 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200845 { AR5K_PHY_RF_CTL4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200846 { 0x00000e0e, 0x00000e0e, 0x00000e0e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200847 { AR5K_PHY_PA_CTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200848 { 0x00000007, 0x0000000b, 0x0000000b } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200849 { AR5K_PHY_GAIN,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200850 { 0x0018fa61, 0x001a1a63, 0x001a1a63 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200851 { AR5K_PHY_DESIRED_SIZE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200852 { 0x0c98b4e0, 0x0c98b0da, 0x0c98b0da } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200853 { AR5K_PHY_SIG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200854 { 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200855 { AR5K_PHY_AGCCOARSE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200856 { 0x3139605e, 0x3139605e, 0x3139605e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200857 { AR5K_PHY_WEAK_OFDM_LOW_THR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200858 { 0x050cb081, 0x050cb081, 0x050cb081 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200859 { AR5K_PHY_RX_DELAY,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200860 { 0x000007d0, 0x0000044c, 0x00000898 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200861 { AR5K_PHY_FRAME_CTL_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200862 { 0xf7b81000, 0xf7b80d00, 0xf7b81000 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200863 { AR5K_PHY_CCKTXCTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200864 { 0x00000000, 0x00000000, 0x00000000 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200865 { AR5K_PHY_CCK_CROSSCORR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200866 { 0xd6be6788, 0xd03e6788, 0xd03e6788 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200867 { AR5K_PHY_GAIN_2GHZ,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200868 { 0x002ec1e0, 0x002ac120, 0x002ac120 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200869 { AR5K_PHY_CCK_RX_CTL_4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200870 { 0x1883800a, 0x1863800a, 0x1883800a } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200871 { 0xa300,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200872 { 0x18010000, 0x18010000, 0x18010000 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200873 { 0xa304,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200874 { 0x30032602, 0x30032602, 0x30032602 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200875 { 0xa308,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200876 { 0x48073e06, 0x48073e06, 0x48073e06 } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200877 { 0xa30c,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200878 { 0x560b4c0a, 0x560b4c0a, 0x560b4c0a } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200879 { 0xa310,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200880 { 0x641a600f, 0x641a600f, 0x641a600f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200881 { 0xa314,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200882 { 0x784f6e1b, 0x784f6e1b, 0x784f6e1b } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200883 { 0xa318,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200884 { 0x868f7c5a, 0x868f7c5a, 0x868f7c5a } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200885 { 0xa31c,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200886 { 0x90cf865b, 0x8ecf865b, 0x8ecf865b } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200887 { 0xa320,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200888 { 0x9d4f970f, 0x9b4f970f, 0x9b4f970f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200889 { 0xa324,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200890 { 0xa7cfa38f, 0xa3cf9f8f, 0xa3cf9f8f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200891 { 0xa328,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200892 { 0xb55faf1f, 0xb35faf1f, 0xb35faf1f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200893 { 0xa32c,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200894 { 0xbddfb99f, 0xbbdfb99f, 0xbbdfb99f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200895 { 0xa330,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200896 { 0xcb7fc53f, 0xcb7fc73f, 0xcb7fc73f } },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200897 { 0xa334,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200898 { 0xd5ffd1bf, 0xd3ffd1bf, 0xd3ffd1bf } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200899};
900
901static const struct ath5k_ini rf5413_ini_common_end[] = {
902 { AR5K_DCU_FP, 0x000003e0 },
903 { AR5K_5414_CBCFG, 0x00000010 },
904 { AR5K_SEQ_MASK, 0x0000000f },
905 { 0x809c, 0x00000000 },
906 { 0x80a0, 0x00000000 },
907 { AR5K_MIC_QOS_CTL, 0x00000000 },
908 { AR5K_MIC_QOS_SEL, 0x00000000 },
909 { AR5K_MISC_MODE, 0x00000000 },
910 { AR5K_OFDM_FIL_CNT, 0x00000000 },
911 { AR5K_CCK_FIL_CNT, 0x00000000 },
912 { AR5K_PHYERR_CNT1, 0x00000000 },
913 { AR5K_PHYERR_CNT1_MASK, 0x00000000 },
914 { AR5K_PHYERR_CNT2, 0x00000000 },
915 { AR5K_PHYERR_CNT2_MASK, 0x00000000 },
916 { AR5K_TSF_THRES, 0x00000000 },
917 { 0x8140, 0x800003f9 },
918 { 0x8144, 0x00000000 },
919 { AR5K_PHY_AGC, 0x00000000 },
920 { AR5K_PHY_ADC_CTL, 0x0000a000 },
921 { 0x983c, 0x00200400 },
922 { AR5K_PHY_GAIN_OFFSET, 0x1284233c },
923 { AR5K_PHY_SCR, 0x0000001f },
924 { AR5K_PHY_SLMT, 0x00000080 },
925 { AR5K_PHY_SCAL, 0x0000000e },
926 { 0x9958, 0x00081fff },
927 { AR5K_PHY_TIMING_7, 0x00000000 },
928 { AR5K_PHY_TIMING_8, 0x02800000 },
929 { AR5K_PHY_TIMING_11, 0x00000000 },
930 { AR5K_PHY_HEAVY_CLIP_ENABLE, 0x00000000 },
931 { 0x99e4, 0xaaaaaaaa },
932 { 0x99e8, 0x3c466478 },
933 { 0x99ec, 0x000000aa },
934 { AR5K_PHY_SCLOCK, 0x0000000c },
935 { AR5K_PHY_SDELAY, 0x000000ff },
936 { AR5K_PHY_SPENDING, 0x00000014 },
937 { AR5K_PHY_DAG_CCK_CTL, 0x000009b5 },
938 { 0xa23c, 0x93c889af },
939 { AR5K_PHY_FAST_ADC, 0x00000001 },
940 { 0xa250, 0x0000a000 },
941 { AR5K_PHY_BLUETOOTH, 0x00000000 },
942 { AR5K_PHY_TPC_RG1, 0x0cc75380 },
943 { 0xa25c, 0x0f0f0f01 },
944 { 0xa260, 0x5f690f01 },
945 { 0xa264, 0x00418a11 },
946 { 0xa268, 0x00000000 },
947 { AR5K_PHY_TPC_RG5, 0x0c30c16a },
948 { 0xa270, 0x00820820 },
949 { 0xa274, 0x081b7caa },
950 { 0xa278, 0x1ce739ce },
951 { 0xa27c, 0x051701ce },
952 { 0xa338, 0x00000000 },
953 { 0xa33c, 0x00000000 },
954 { 0xa340, 0x00000000 },
955 { 0xa344, 0x00000000 },
956 { 0xa348, 0x3fffffff },
957 { 0xa34c, 0x3fffffff },
958 { 0xa350, 0x3fffffff },
959 { 0xa354, 0x0003ffff },
960 { 0xa358, 0x79a8aa1f },
961 { 0xa35c, 0x066c420f },
962 { 0xa360, 0x0f282207 },
963 { 0xa364, 0x17601685 },
964 { 0xa368, 0x1f801104 },
965 { 0xa36c, 0x37a00c03 },
966 { 0xa370, 0x3fc40883 },
967 { 0xa374, 0x57c00803 },
968 { 0xa378, 0x5fd80682 },
969 { 0xa37c, 0x7fe00482 },
970 { 0xa380, 0x7f3c7bba },
971 { 0xa384, 0xf3307ff0 },
Jiri Slabyfa1c1142007-08-12 17:33:16 +0200972};
973
Nick Kossifidisc47faa32011-11-25 20:40:25 +0200974/* Initial mode-specific settings for RF2413/2414
975 * (Written after ar5212_ini) */
Nick Kossifidisa406c132009-02-09 06:08:51 +0200976/* XXX: a mode ? */
Nick Kossifidisf714dd62008-02-28 14:43:51 -0500977static const struct ath5k_ini_mode rf2413_ini_mode_end[] = {
978 { AR5K_TXCFG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200979 /* A/XR B G */
980 { 0x00000015, 0x00000015, 0x00000015 } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -0500981 { AR5K_USEC_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200982 { 0x128d93a7, 0x04e01395, 0x12e013ab } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200983 { AR5K_PHY_RF_CTL3,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200984 { 0x0a020001, 0x05020000, 0x0a020001 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200985 { AR5K_PHY_RF_CTL4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200986 { 0x00000e00, 0x00000e00, 0x00000e00 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200987 { AR5K_PHY_PA_CTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200988 { 0x00000002, 0x0000000a, 0x0000000a } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200989 { AR5K_PHY_GAIN,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200990 { 0x0018da6d, 0x001a6a64, 0x001a6a64 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200991 { AR5K_PHY_DESIRED_SIZE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200992 { 0x0de8b4e0, 0x0de8b0da, 0x0c98b0da } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -0500993 { AR5K_PHY_SIG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200994 { 0x7e800d2e, 0x7ee80d2e, 0x7ec80d2e } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -0500995 { AR5K_PHY_AGCCOARSE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200996 { 0x3137665e, 0x3137665e, 0x3139605e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +0200997 { AR5K_PHY_WEAK_OFDM_LOW_THR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +0200998 { 0x050cb081, 0x050cb081, 0x050cb081 } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -0500999 { AR5K_PHY_RX_DELAY,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001000 { 0x000007d0, 0x0000044c, 0x00000898 } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001001 { AR5K_PHY_FRAME_CTL_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001002 { 0xf7b81000, 0xf7b80d00, 0xf7b81000 } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001003 { AR5K_PHY_CCKTXCTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001004 { 0x00000000, 0x00000000, 0x00000000 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001005 { AR5K_PHY_CCK_CROSSCORR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001006 { 0xd6be6788, 0xd03e6788, 0xd03e6788 } },
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001007 { AR5K_PHY_GAIN_2GHZ,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001008 { 0x002c0140, 0x0042c140, 0x0042c140 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001009 { AR5K_PHY_CCK_RX_CTL_4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001010 { 0x1883800a, 0x1863800a, 0x1883800a } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001011};
1012
1013static const struct ath5k_ini rf2413_ini_common_end[] = {
1014 { AR5K_DCU_FP, 0x000003e0 },
1015 { AR5K_SEQ_MASK, 0x0000000f },
1016 { AR5K_MIC_QOS_CTL, 0x00000000 },
1017 { AR5K_MIC_QOS_SEL, 0x00000000 },
1018 { AR5K_MISC_MODE, 0x00000000 },
1019 { AR5K_OFDM_FIL_CNT, 0x00000000 },
1020 { AR5K_CCK_FIL_CNT, 0x00000000 },
1021 { AR5K_PHYERR_CNT1, 0x00000000 },
1022 { AR5K_PHYERR_CNT1_MASK, 0x00000000 },
1023 { AR5K_PHYERR_CNT2, 0x00000000 },
1024 { AR5K_PHYERR_CNT2_MASK, 0x00000000 },
1025 { AR5K_TSF_THRES, 0x00000000 },
1026 { 0x8140, 0x800000a8 },
1027 { 0x8144, 0x00000000 },
1028 { AR5K_PHY_AGC, 0x00000000 },
1029 { AR5K_PHY_ADC_CTL, 0x0000a000 },
1030 { 0x983c, 0x00200400 },
1031 { AR5K_PHY_GAIN_OFFSET, 0x1284233c },
1032 { AR5K_PHY_SCR, 0x0000001f },
1033 { AR5K_PHY_SLMT, 0x00000080 },
1034 { AR5K_PHY_SCAL, 0x0000000e },
1035 { 0x9958, 0x000000ff },
1036 { AR5K_PHY_TIMING_7, 0x00000000 },
1037 { AR5K_PHY_TIMING_8, 0x02800000 },
1038 { AR5K_PHY_TIMING_11, 0x00000000 },
1039 { AR5K_PHY_HEAVY_CLIP_ENABLE, 0x00000000 },
1040 { 0x99e4, 0xaaaaaaaa },
1041 { 0x99e8, 0x3c466478 },
1042 { 0x99ec, 0x000000aa },
1043 { AR5K_PHY_SCLOCK, 0x0000000c },
1044 { AR5K_PHY_SDELAY, 0x000000ff },
1045 { AR5K_PHY_SPENDING, 0x00000014 },
1046 { AR5K_PHY_DAG_CCK_CTL, 0x000009b5 },
1047 { 0xa23c, 0x93c889af },
1048 { AR5K_PHY_FAST_ADC, 0x00000001 },
1049 { 0xa250, 0x0000a000 },
1050 { AR5K_PHY_BLUETOOTH, 0x00000000 },
1051 { AR5K_PHY_TPC_RG1, 0x0cc75380 },
1052 { 0xa25c, 0x0f0f0f01 },
1053 { 0xa260, 0x5f690f01 },
1054 { 0xa264, 0x00418a11 },
1055 { 0xa268, 0x00000000 },
1056 { AR5K_PHY_TPC_RG5, 0x0c30c16a },
1057 { 0xa270, 0x00820820 },
1058 { 0xa274, 0x001b7caa },
1059 { 0xa278, 0x1ce739ce },
1060 { 0xa27c, 0x051701ce },
1061 { 0xa300, 0x18010000 },
1062 { 0xa304, 0x30032602 },
1063 { 0xa308, 0x48073e06 },
1064 { 0xa30c, 0x560b4c0a },
1065 { 0xa310, 0x641a600f },
1066 { 0xa314, 0x784f6e1b },
1067 { 0xa318, 0x868f7c5a },
1068 { 0xa31c, 0x8ecf865b },
1069 { 0xa320, 0x9d4f970f },
1070 { 0xa324, 0xa5cfa18f },
1071 { 0xa328, 0xb55faf1f },
1072 { 0xa32c, 0xbddfb99f },
1073 { 0xa330, 0xcd7fc73f },
1074 { 0xa334, 0xd5ffd1bf },
1075 { 0xa338, 0x00000000 },
1076 { 0xa33c, 0x00000000 },
1077 { 0xa340, 0x00000000 },
1078 { 0xa344, 0x00000000 },
1079 { 0xa348, 0x3fffffff },
1080 { 0xa34c, 0x3fffffff },
1081 { 0xa350, 0x3fffffff },
1082 { 0xa354, 0x0003ffff },
1083 { 0xa358, 0x79a8aa1f },
1084 { 0xa35c, 0x066c420f },
1085 { 0xa360, 0x0f282207 },
1086 { 0xa364, 0x17601685 },
1087 { 0xa368, 0x1f801104 },
1088 { 0xa36c, 0x37a00c03 },
1089 { 0xa370, 0x3fc40883 },
1090 { 0xa374, 0x57c00803 },
1091 { 0xa378, 0x5fd80682 },
1092 { 0xa37c, 0x7fe00482 },
1093 { 0xa380, 0x7f3c7bba },
1094 { 0xa384, 0xf3307ff0 },
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001095};
1096
Nick Kossifidisc47faa32011-11-25 20:40:25 +02001097/* Initial mode-specific settings for RF2425
1098 * (Written after ar5212_ini) */
Nick Kossifidisa406c132009-02-09 06:08:51 +02001099/* XXX: a mode ? */
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001100static const struct ath5k_ini_mode rf2425_ini_mode_end[] = {
1101 { AR5K_TXCFG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001102 /* A/XR B G */
1103 { 0x00000015, 0x00000015, 0x00000015 } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001104 { AR5K_USEC_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001105 { 0x128d93a7, 0x04e01395, 0x12e013ab } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001106 { AR5K_PHY_RF_CTL3,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001107 { 0x0a020001, 0x05020100, 0x0a020001 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001108 { AR5K_PHY_RF_CTL4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001109 { 0x00000e0e, 0x00000e0e, 0x00000e0e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001110 { AR5K_PHY_PA_CTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001111 { 0x00000003, 0x0000000b, 0x0000000b } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001112 { AR5K_PHY_SETTLING,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001113 { 0x1372161c, 0x13721722, 0x13721422 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001114 { AR5K_PHY_GAIN,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001115 { 0x0018fa61, 0x00199a65, 0x00199a65 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001116 { AR5K_PHY_DESIRED_SIZE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001117 { 0x0c98b4e0, 0x0c98b0da, 0x0c98b0da } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001118 { AR5K_PHY_SIG,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001119 { 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001120 { AR5K_PHY_AGCCOARSE,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001121 { 0x3139605e, 0x3139605e, 0x3139605e } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001122 { AR5K_PHY_WEAK_OFDM_LOW_THR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001123 { 0x050cb081, 0x050cb081, 0x050cb081 } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001124 { AR5K_PHY_RX_DELAY,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001125 { 0x000007d0, 0x0000044c, 0x00000898 } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001126 { AR5K_PHY_FRAME_CTL_5211,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001127 { 0xf7b81000, 0xf7b80d00, 0xf7b81000 } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001128 { AR5K_PHY_CCKTXCTL,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001129 { 0x00000000, 0x00000000, 0x00000000 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001130 { AR5K_PHY_CCK_CROSSCORR,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001131 { 0xd6be6788, 0xd03e6788, 0xd03e6788 } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001132 { AR5K_PHY_GAIN_2GHZ,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001133 { 0x00000140, 0x0052c140, 0x0052c140 } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001134 { AR5K_PHY_CCK_RX_CTL_4,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001135 { 0x1883800a, 0x1863800a, 0x1883800a } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001136 { 0xa324,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001137 { 0xa7cfa7cf, 0xa7cfa7cf, 0xa7cfa7cf } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001138 { 0xa328,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001139 { 0xa7cfa7cf, 0xa7cfa7cf, 0xa7cfa7cf } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001140 { 0xa32c,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001141 { 0xa7cfa7cf, 0xa7cfa7cf, 0xa7cfa7cf } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001142 { 0xa330,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001143 { 0xa7cfa7cf, 0xa7cfa7cf, 0xa7cfa7cf } },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001144 { 0xa334,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001145 { 0xa7cfa7cf, 0xa7cfa7cf, 0xa7cfa7cf } },
Nick Kossifidisa406c132009-02-09 06:08:51 +02001146};
1147
1148static const struct ath5k_ini rf2425_ini_common_end[] = {
1149 { AR5K_DCU_FP, 0x000003e0 },
1150 { AR5K_SEQ_MASK, 0x0000000f },
1151 { 0x809c, 0x00000000 },
1152 { 0x80a0, 0x00000000 },
1153 { AR5K_MIC_QOS_CTL, 0x00000000 },
1154 { AR5K_MIC_QOS_SEL, 0x00000000 },
1155 { AR5K_MISC_MODE, 0x00000000 },
1156 { AR5K_OFDM_FIL_CNT, 0x00000000 },
1157 { AR5K_CCK_FIL_CNT, 0x00000000 },
1158 { AR5K_PHYERR_CNT1, 0x00000000 },
1159 { AR5K_PHYERR_CNT1_MASK, 0x00000000 },
1160 { AR5K_PHYERR_CNT2, 0x00000000 },
1161 { AR5K_PHYERR_CNT2_MASK, 0x00000000 },
1162 { AR5K_TSF_THRES, 0x00000000 },
1163 { 0x8140, 0x800003f9 },
1164 { 0x8144, 0x00000000 },
1165 { AR5K_PHY_AGC, 0x00000000 },
1166 { AR5K_PHY_ADC_CTL, 0x0000a000 },
1167 { 0x983c, 0x00200400 },
1168 { AR5K_PHY_GAIN_OFFSET, 0x1284233c },
1169 { AR5K_PHY_SCR, 0x0000001f },
1170 { AR5K_PHY_SLMT, 0x00000080 },
1171 { AR5K_PHY_SCAL, 0x0000000e },
1172 { 0x9958, 0x00081fff },
1173 { AR5K_PHY_TIMING_7, 0x00000000 },
1174 { AR5K_PHY_TIMING_8, 0x02800000 },
1175 { AR5K_PHY_TIMING_11, 0x00000000 },
1176 { 0x99dc, 0xfebadbe8 },
1177 { AR5K_PHY_HEAVY_CLIP_ENABLE, 0x00000000 },
1178 { 0x99e4, 0xaaaaaaaa },
1179 { 0x99e8, 0x3c466478 },
1180 { 0x99ec, 0x000000aa },
1181 { AR5K_PHY_SCLOCK, 0x0000000c },
1182 { AR5K_PHY_SDELAY, 0x000000ff },
1183 { AR5K_PHY_SPENDING, 0x00000014 },
1184 { AR5K_PHY_DAG_CCK_CTL, 0x000009b5 },
1185 { AR5K_PHY_TXPOWER_RATE3, 0x20202020 },
1186 { AR5K_PHY_TXPOWER_RATE4, 0x20202020 },
1187 { 0xa23c, 0x93c889af },
1188 { AR5K_PHY_FAST_ADC, 0x00000001 },
1189 { 0xa250, 0x0000a000 },
1190 { AR5K_PHY_BLUETOOTH, 0x00000000 },
1191 { AR5K_PHY_TPC_RG1, 0x0cc75380 },
1192 { 0xa25c, 0x0f0f0f01 },
1193 { 0xa260, 0x5f690f01 },
1194 { 0xa264, 0x00418a11 },
1195 { 0xa268, 0x00000000 },
1196 { AR5K_PHY_TPC_RG5, 0x0c30c166 },
1197 { 0xa270, 0x00820820 },
1198 { 0xa274, 0x081a3caa },
1199 { 0xa278, 0x1ce739ce },
1200 { 0xa27c, 0x051701ce },
1201 { 0xa300, 0x16010000 },
1202 { 0xa304, 0x2c032402 },
1203 { 0xa308, 0x48433e42 },
1204 { 0xa30c, 0x5a0f500b },
1205 { 0xa310, 0x6c4b624a },
1206 { 0xa314, 0x7e8b748a },
1207 { 0xa318, 0x96cf8ccb },
1208 { 0xa31c, 0xa34f9d0f },
1209 { 0xa320, 0xa7cfa58f },
1210 { 0xa348, 0x3fffffff },
1211 { 0xa34c, 0x3fffffff },
1212 { 0xa350, 0x3fffffff },
1213 { 0xa354, 0x0003ffff },
1214 { 0xa358, 0x79a8aa1f },
1215 { 0xa35c, 0x066c420f },
1216 { 0xa360, 0x0f282207 },
1217 { 0xa364, 0x17601685 },
1218 { 0xa368, 0x1f801104 },
1219 { 0xa36c, 0x37a00c03 },
1220 { 0xa370, 0x3fc40883 },
1221 { 0xa374, 0x57c00803 },
1222 { 0xa378, 0x5fd80682 },
1223 { 0xa37c, 0x7fe00482 },
1224 { 0xa380, 0x7f3c7bba },
1225 { 0xa384, 0xf3307ff0 },
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001226};
1227
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001228/*
1229 * Initial BaseBand Gain settings for RF5111/5112 (AR5210 comes with
1230 * RF5110 only so initial BB Gain settings are included in AR5K_AR5210_INI)
1231 */
1232
1233/* RF5111 Initial BaseBand Gain settings */
1234static const struct ath5k_ini rf5111_ini_bbgain[] = {
1235 { AR5K_BB_GAIN(0), 0x00000000 },
1236 { AR5K_BB_GAIN(1), 0x00000020 },
1237 { AR5K_BB_GAIN(2), 0x00000010 },
1238 { AR5K_BB_GAIN(3), 0x00000030 },
1239 { AR5K_BB_GAIN(4), 0x00000008 },
1240 { AR5K_BB_GAIN(5), 0x00000028 },
1241 { AR5K_BB_GAIN(6), 0x00000004 },
1242 { AR5K_BB_GAIN(7), 0x00000024 },
1243 { AR5K_BB_GAIN(8), 0x00000014 },
1244 { AR5K_BB_GAIN(9), 0x00000034 },
1245 { AR5K_BB_GAIN(10), 0x0000000c },
1246 { AR5K_BB_GAIN(11), 0x0000002c },
1247 { AR5K_BB_GAIN(12), 0x00000002 },
1248 { AR5K_BB_GAIN(13), 0x00000022 },
1249 { AR5K_BB_GAIN(14), 0x00000012 },
1250 { AR5K_BB_GAIN(15), 0x00000032 },
1251 { AR5K_BB_GAIN(16), 0x0000000a },
1252 { AR5K_BB_GAIN(17), 0x0000002a },
1253 { AR5K_BB_GAIN(18), 0x00000006 },
1254 { AR5K_BB_GAIN(19), 0x00000026 },
1255 { AR5K_BB_GAIN(20), 0x00000016 },
1256 { AR5K_BB_GAIN(21), 0x00000036 },
1257 { AR5K_BB_GAIN(22), 0x0000000e },
1258 { AR5K_BB_GAIN(23), 0x0000002e },
1259 { AR5K_BB_GAIN(24), 0x00000001 },
1260 { AR5K_BB_GAIN(25), 0x00000021 },
1261 { AR5K_BB_GAIN(26), 0x00000011 },
1262 { AR5K_BB_GAIN(27), 0x00000031 },
1263 { AR5K_BB_GAIN(28), 0x00000009 },
1264 { AR5K_BB_GAIN(29), 0x00000029 },
1265 { AR5K_BB_GAIN(30), 0x00000005 },
1266 { AR5K_BB_GAIN(31), 0x00000025 },
1267 { AR5K_BB_GAIN(32), 0x00000015 },
1268 { AR5K_BB_GAIN(33), 0x00000035 },
1269 { AR5K_BB_GAIN(34), 0x0000000d },
1270 { AR5K_BB_GAIN(35), 0x0000002d },
1271 { AR5K_BB_GAIN(36), 0x00000003 },
1272 { AR5K_BB_GAIN(37), 0x00000023 },
1273 { AR5K_BB_GAIN(38), 0x00000013 },
1274 { AR5K_BB_GAIN(39), 0x00000033 },
1275 { AR5K_BB_GAIN(40), 0x0000000b },
1276 { AR5K_BB_GAIN(41), 0x0000002b },
1277 { AR5K_BB_GAIN(42), 0x0000002b },
1278 { AR5K_BB_GAIN(43), 0x0000002b },
1279 { AR5K_BB_GAIN(44), 0x0000002b },
1280 { AR5K_BB_GAIN(45), 0x0000002b },
1281 { AR5K_BB_GAIN(46), 0x0000002b },
1282 { AR5K_BB_GAIN(47), 0x0000002b },
1283 { AR5K_BB_GAIN(48), 0x0000002b },
1284 { AR5K_BB_GAIN(49), 0x0000002b },
1285 { AR5K_BB_GAIN(50), 0x0000002b },
1286 { AR5K_BB_GAIN(51), 0x0000002b },
1287 { AR5K_BB_GAIN(52), 0x0000002b },
1288 { AR5K_BB_GAIN(53), 0x0000002b },
1289 { AR5K_BB_GAIN(54), 0x0000002b },
1290 { AR5K_BB_GAIN(55), 0x0000002b },
1291 { AR5K_BB_GAIN(56), 0x0000002b },
1292 { AR5K_BB_GAIN(57), 0x0000002b },
1293 { AR5K_BB_GAIN(58), 0x0000002b },
1294 { AR5K_BB_GAIN(59), 0x0000002b },
1295 { AR5K_BB_GAIN(60), 0x0000002b },
1296 { AR5K_BB_GAIN(61), 0x0000002b },
1297 { AR5K_BB_GAIN(62), 0x00000002 },
1298 { AR5K_BB_GAIN(63), 0x00000016 },
1299};
1300
Nick Kossifidisa406c132009-02-09 06:08:51 +02001301/* RF5112 Initial BaseBand Gain settings (Same for RF5413/5414+) */
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001302static const struct ath5k_ini rf5112_ini_bbgain[] = {
1303 { AR5K_BB_GAIN(0), 0x00000000 },
1304 { AR5K_BB_GAIN(1), 0x00000001 },
1305 { AR5K_BB_GAIN(2), 0x00000002 },
1306 { AR5K_BB_GAIN(3), 0x00000003 },
1307 { AR5K_BB_GAIN(4), 0x00000004 },
1308 { AR5K_BB_GAIN(5), 0x00000005 },
1309 { AR5K_BB_GAIN(6), 0x00000008 },
1310 { AR5K_BB_GAIN(7), 0x00000009 },
1311 { AR5K_BB_GAIN(8), 0x0000000a },
1312 { AR5K_BB_GAIN(9), 0x0000000b },
1313 { AR5K_BB_GAIN(10), 0x0000000c },
1314 { AR5K_BB_GAIN(11), 0x0000000d },
1315 { AR5K_BB_GAIN(12), 0x00000010 },
1316 { AR5K_BB_GAIN(13), 0x00000011 },
1317 { AR5K_BB_GAIN(14), 0x00000012 },
1318 { AR5K_BB_GAIN(15), 0x00000013 },
1319 { AR5K_BB_GAIN(16), 0x00000014 },
1320 { AR5K_BB_GAIN(17), 0x00000015 },
1321 { AR5K_BB_GAIN(18), 0x00000018 },
1322 { AR5K_BB_GAIN(19), 0x00000019 },
1323 { AR5K_BB_GAIN(20), 0x0000001a },
1324 { AR5K_BB_GAIN(21), 0x0000001b },
1325 { AR5K_BB_GAIN(22), 0x0000001c },
1326 { AR5K_BB_GAIN(23), 0x0000001d },
1327 { AR5K_BB_GAIN(24), 0x00000020 },
1328 { AR5K_BB_GAIN(25), 0x00000021 },
1329 { AR5K_BB_GAIN(26), 0x00000022 },
1330 { AR5K_BB_GAIN(27), 0x00000023 },
1331 { AR5K_BB_GAIN(28), 0x00000024 },
1332 { AR5K_BB_GAIN(29), 0x00000025 },
1333 { AR5K_BB_GAIN(30), 0x00000028 },
1334 { AR5K_BB_GAIN(31), 0x00000029 },
1335 { AR5K_BB_GAIN(32), 0x0000002a },
1336 { AR5K_BB_GAIN(33), 0x0000002b },
1337 { AR5K_BB_GAIN(34), 0x0000002c },
1338 { AR5K_BB_GAIN(35), 0x0000002d },
1339 { AR5K_BB_GAIN(36), 0x00000030 },
1340 { AR5K_BB_GAIN(37), 0x00000031 },
1341 { AR5K_BB_GAIN(38), 0x00000032 },
1342 { AR5K_BB_GAIN(39), 0x00000033 },
1343 { AR5K_BB_GAIN(40), 0x00000034 },
1344 { AR5K_BB_GAIN(41), 0x00000035 },
1345 { AR5K_BB_GAIN(42), 0x00000035 },
1346 { AR5K_BB_GAIN(43), 0x00000035 },
1347 { AR5K_BB_GAIN(44), 0x00000035 },
1348 { AR5K_BB_GAIN(45), 0x00000035 },
1349 { AR5K_BB_GAIN(46), 0x00000035 },
1350 { AR5K_BB_GAIN(47), 0x00000035 },
1351 { AR5K_BB_GAIN(48), 0x00000035 },
1352 { AR5K_BB_GAIN(49), 0x00000035 },
1353 { AR5K_BB_GAIN(50), 0x00000035 },
1354 { AR5K_BB_GAIN(51), 0x00000035 },
1355 { AR5K_BB_GAIN(52), 0x00000035 },
1356 { AR5K_BB_GAIN(53), 0x00000035 },
1357 { AR5K_BB_GAIN(54), 0x00000035 },
1358 { AR5K_BB_GAIN(55), 0x00000035 },
1359 { AR5K_BB_GAIN(56), 0x00000035 },
1360 { AR5K_BB_GAIN(57), 0x00000035 },
1361 { AR5K_BB_GAIN(58), 0x00000035 },
1362 { AR5K_BB_GAIN(59), 0x00000035 },
1363 { AR5K_BB_GAIN(60), 0x00000035 },
1364 { AR5K_BB_GAIN(61), 0x00000035 },
1365 { AR5K_BB_GAIN(62), 0x00000010 },
1366 { AR5K_BB_GAIN(63), 0x0000001a },
1367};
1368
1369
Nick Kossifidisc47faa32011-11-25 20:40:25 +02001370/**
1371 * ath5k_hw_ini_registers() - Write initial register dump common for all modes
1372 * @ah: The &struct ath5k_hw
1373 * @size: Dump size
1374 * @ini_regs: The array of &struct ath5k_ini
1375 * @skip_pcu: Skip PCU registers
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001376 */
Nick Kossifidisc47faa32011-11-25 20:40:25 +02001377static void
1378ath5k_hw_ini_registers(struct ath5k_hw *ah, unsigned int size,
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001379 const struct ath5k_ini *ini_regs, bool skip_pcu)
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001380{
1381 unsigned int i;
1382
1383 /* Write initial registers */
1384 for (i = 0; i < size; i++) {
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001385 /* Skip PCU registers if
1386 * requested */
1387 if (skip_pcu &&
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001388 ini_regs[i].ini_register >= AR5K_PCU_MIN &&
1389 ini_regs[i].ini_register <= AR5K_PCU_MAX)
1390 continue;
1391
1392 switch (ini_regs[i].ini_mode) {
1393 case AR5K_INI_READ:
1394 /* Cleared on read */
1395 ath5k_hw_reg_read(ah, ini_regs[i].ini_register);
1396 break;
1397 case AR5K_INI_WRITE:
1398 default:
1399 AR5K_REG_WAIT(i);
1400 ath5k_hw_reg_write(ah, ini_regs[i].ini_value,
1401 ini_regs[i].ini_register);
1402 }
1403 }
1404}
1405
Nick Kossifidisc47faa32011-11-25 20:40:25 +02001406/**
1407 * ath5k_hw_ini_mode_registers() - Write initial mode-specific register dump
1408 * @ah: The &struct ath5k_hw
1409 * @size: Dump size
1410 * @ini_mode: The array of &struct ath5k_ini_mode
1411 * @mode: One of enum ath5k_driver_mode
1412 */
1413static void
1414ath5k_hw_ini_mode_registers(struct ath5k_hw *ah,
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001415 unsigned int size, const struct ath5k_ini_mode *ini_mode,
1416 u8 mode)
1417{
1418 unsigned int i;
1419
1420 for (i = 0; i < size; i++) {
1421 AR5K_REG_WAIT(i);
1422 ath5k_hw_reg_write(ah, ini_mode[i].mode_value[mode],
1423 (u32)ini_mode[i].mode_register);
1424 }
1425
1426}
1427
Nick Kossifidisc47faa32011-11-25 20:40:25 +02001428/**
1429 * ath5k_hw_write_initvals() - Write initial chip-specific register dump
1430 * @ah: The &struct ath5k_hw
1431 * @mode: One of enum ath5k_driver_mode
1432 * @skip_pcu: Skip PCU registers
1433 *
1434 * Write initial chip-specific register dump, to get the chipset on a
1435 * clean and ready-to-work state after warm reset.
1436 */
1437int
1438ath5k_hw_write_initvals(struct ath5k_hw *ah, u8 mode, bool skip_pcu)
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001439{
1440 /*
1441 * Write initial register settings
1442 */
1443
Pavel Roskin6a2a0e72011-07-09 00:17:51 -04001444 /* For AR5212 and compatible */
John Daiker0bbac082008-10-17 12:16:00 -07001445 if (ah->ah_version == AR5K_AR5212) {
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001446
1447 /* First set of mode-specific settings */
1448 ath5k_hw_ini_mode_registers(ah,
1449 ARRAY_SIZE(ar5212_ini_mode_start),
1450 ar5212_ini_mode_start, mode);
1451
1452 /*
1453 * Write initial settings common for all modes
1454 */
Nick Kossifidisa406c132009-02-09 06:08:51 +02001455 ath5k_hw_ini_registers(ah, ARRAY_SIZE(ar5212_ini_common_start),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001456 ar5212_ini_common_start, skip_pcu);
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001457
1458 /* Second set of mode-specific settings */
Nick Kossifidisa406c132009-02-09 06:08:51 +02001459 switch (ah->ah_radio) {
1460 case AR5K_RF5111:
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001461
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001462 ath5k_hw_ini_mode_registers(ah,
Nick Kossifidisa406c132009-02-09 06:08:51 +02001463 ARRAY_SIZE(rf5111_ini_mode_end),
1464 rf5111_ini_mode_end, mode);
1465
1466 ath5k_hw_ini_registers(ah,
1467 ARRAY_SIZE(rf5111_ini_common_end),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001468 rf5111_ini_common_end, skip_pcu);
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001469
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001470 /* Baseband gain table */
1471 ath5k_hw_ini_registers(ah,
1472 ARRAY_SIZE(rf5111_ini_bbgain),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001473 rf5111_ini_bbgain, skip_pcu);
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001474
Nick Kossifidisa406c132009-02-09 06:08:51 +02001475 break;
1476 case AR5K_RF5112:
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001477
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001478 ath5k_hw_ini_mode_registers(ah,
Nick Kossifidisa406c132009-02-09 06:08:51 +02001479 ARRAY_SIZE(rf5112_ini_mode_end),
1480 rf5112_ini_mode_end, mode);
1481
1482 ath5k_hw_ini_registers(ah,
1483 ARRAY_SIZE(rf5112_ini_common_end),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001484 rf5112_ini_common_end, skip_pcu);
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001485
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001486 ath5k_hw_ini_registers(ah,
1487 ARRAY_SIZE(rf5112_ini_bbgain),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001488 rf5112_ini_bbgain, skip_pcu);
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001489
Nick Kossifidisa406c132009-02-09 06:08:51 +02001490 break;
1491 case AR5K_RF5413:
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001492
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001493 ath5k_hw_ini_mode_registers(ah,
1494 ARRAY_SIZE(rf5413_ini_mode_end),
1495 rf5413_ini_mode_end, mode);
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001496
1497 ath5k_hw_ini_registers(ah,
Nick Kossifidisa406c132009-02-09 06:08:51 +02001498 ARRAY_SIZE(rf5413_ini_common_end),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001499 rf5413_ini_common_end, skip_pcu);
Nick Kossifidisa406c132009-02-09 06:08:51 +02001500
1501 ath5k_hw_ini_registers(ah,
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001502 ARRAY_SIZE(rf5112_ini_bbgain),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001503 rf5112_ini_bbgain, skip_pcu);
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001504
Nick Kossifidisa406c132009-02-09 06:08:51 +02001505 break;
1506 case AR5K_RF2316:
1507 case AR5K_RF2413:
Nick Kossifidisf714dd62008-02-28 14:43:51 -05001508
1509 ath5k_hw_ini_mode_registers(ah,
1510 ARRAY_SIZE(rf2413_ini_mode_end),
1511 rf2413_ini_mode_end, mode);
1512
Nick Kossifidisa406c132009-02-09 06:08:51 +02001513 ath5k_hw_ini_registers(ah,
1514 ARRAY_SIZE(rf2413_ini_common_end),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001515 rf2413_ini_common_end, skip_pcu);
Nick Kossifidisa406c132009-02-09 06:08:51 +02001516
1517 /* Override settings from rf2413_ini_common_end */
1518 if (ah->ah_radio == AR5K_RF2316) {
1519 ath5k_hw_reg_write(ah, 0x00004000,
1520 AR5K_PHY_AGC);
1521 ath5k_hw_reg_write(ah, 0x081b7caa,
1522 0xa274);
1523 }
1524
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001525 ath5k_hw_ini_registers(ah,
1526 ARRAY_SIZE(rf5112_ini_bbgain),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001527 rf5112_ini_bbgain, skip_pcu);
Nick Kossifidisa406c132009-02-09 06:08:51 +02001528 break;
1529 case AR5K_RF2317:
Felix Fietkauc31b5c92010-12-02 10:27:11 +01001530
1531 ath5k_hw_ini_mode_registers(ah,
1532 ARRAY_SIZE(rf2413_ini_mode_end),
1533 rf2413_ini_mode_end, mode);
1534
1535 ath5k_hw_ini_registers(ah,
1536 ARRAY_SIZE(rf2425_ini_common_end),
1537 rf2425_ini_common_end, skip_pcu);
1538
1539 /* Override settings from rf2413_ini_mode_end */
1540 ath5k_hw_reg_write(ah, 0x00180a65, AR5K_PHY_GAIN);
1541
1542 /* Override settings from rf2413_ini_common_end */
1543 ath5k_hw_reg_write(ah, 0x00004000, AR5K_PHY_AGC);
1544 AR5K_REG_WRITE_BITS(ah, AR5K_PHY_TPC_RG5,
1545 AR5K_PHY_TPC_RG5_PD_GAIN_OVERLAP, 0xa);
1546 ath5k_hw_reg_write(ah, 0x800000a8, 0x8140);
1547 ath5k_hw_reg_write(ah, 0x000000ff, 0x9958);
1548
1549 ath5k_hw_ini_registers(ah,
1550 ARRAY_SIZE(rf5112_ini_bbgain),
1551 rf5112_ini_bbgain, skip_pcu);
1552 break;
Nick Kossifidisa406c132009-02-09 06:08:51 +02001553 case AR5K_RF2425:
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001554
1555 ath5k_hw_ini_mode_registers(ah,
1556 ARRAY_SIZE(rf2425_ini_mode_end),
1557 rf2425_ini_mode_end, mode);
1558
Nick Kossifidisa406c132009-02-09 06:08:51 +02001559 ath5k_hw_ini_registers(ah,
Nick Kossifidis504f3652009-03-15 22:13:39 +02001560 ARRAY_SIZE(rf2425_ini_common_end),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001561 rf2425_ini_common_end, skip_pcu);
Nick Kossifidisa406c132009-02-09 06:08:51 +02001562
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001563 ath5k_hw_ini_registers(ah,
1564 ARRAY_SIZE(rf5112_ini_bbgain),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001565 rf5112_ini_bbgain, skip_pcu);
Nick Kossifidisa406c132009-02-09 06:08:51 +02001566 break;
1567 default:
1568 return -EINVAL;
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001569
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001570 }
Nick Kossifidis136bfc72008-04-16 18:42:48 +03001571
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001572 /* For AR5211 */
1573 } else if (ah->ah_version == AR5K_AR5211) {
1574
Luis R. Rodriguez400ec452008-02-03 21:51:49 -05001575 /* AR5K_MODE_11B */
1576 if (mode > 2) {
Pavel Roskine0d687b2011-07-14 20:21:55 -04001577 ATH5K_ERR(ah,
Luis R. Rodriguez400ec452008-02-03 21:51:49 -05001578 "unsupported channel mode: %d\n", mode);
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001579 return -EINVAL;
1580 }
1581
1582 /* Mode-specific settings */
1583 ath5k_hw_ini_mode_registers(ah, ARRAY_SIZE(ar5211_ini_mode),
1584 ar5211_ini_mode, mode);
1585
1586 /*
1587 * Write initial settings common for all modes
1588 */
1589 ath5k_hw_ini_registers(ah, ARRAY_SIZE(ar5211_ini),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001590 ar5211_ini, skip_pcu);
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001591
1592 /* AR5211 only comes with 5111 */
1593
1594 /* Baseband gain table */
1595 ath5k_hw_ini_registers(ah, ARRAY_SIZE(rf5111_ini_bbgain),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001596 rf5111_ini_bbgain, skip_pcu);
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001597 /* For AR5210 (for mode settings check out ath5k_hw_reset_tx_queue) */
1598 } else if (ah->ah_version == AR5K_AR5210) {
1599 ath5k_hw_ini_registers(ah, ARRAY_SIZE(ar5210_ini),
Nick Kossifidis8c2b418a2010-11-23 21:51:38 +02001600 ar5210_ini, skip_pcu);
Jiri Slabyfa1c1142007-08-12 17:33:16 +02001601 }
1602
1603 return 0;
1604}