1
2
3
4
5
6
7
8
9
10
11 #ifndef __REG_H__
12 #define __REG_H__
13
14 #include <linux/bitops.h>
15
16 #define REGISTERS_BASE 0x00300000
17 #define DRPW_BASE 0x00310000
18
19 #define REGISTERS_DOWN_SIZE 0x00008800
20 #define REGISTERS_WORK_SIZE 0x0000b000
21
22 #define FW_STATUS_ADDR (0x14FC0 + 0xA000)
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 #define WL12XX_SLV_SOFT_RESET (REGISTERS_BASE + 0x0000)
39
40 #define WL1271_SLV_REG_DATA (REGISTERS_BASE + 0x0008)
41 #define WL1271_SLV_REG_ADATA (REGISTERS_BASE + 0x000c)
42 #define WL1271_SLV_MEM_DATA (REGISTERS_BASE + 0x0018)
43
44 #define WL12XX_REG_INTERRUPT_TRIG (REGISTERS_BASE + 0x0474)
45 #define WL12XX_REG_INTERRUPT_TRIG_H (REGISTERS_BASE + 0x0478)
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 #define WL12XX_REG_INTERRUPT_MASK (REGISTERS_BASE + 0x04DC)
76
77
78
79
80
81
82
83
84
85 #define ACX_REG_HINT_MASK_SET (REGISTERS_BASE + 0x04E0)
86
87
88
89
90
91
92
93
94
95 #define ACX_REG_HINT_MASK_CLR (REGISTERS_BASE + 0x04E4)
96
97
98
99
100
101
102
103
104
105
106 #define WL12XX_REG_INTERRUPT_NO_CLEAR (REGISTERS_BASE + 0x04E8)
107
108
109
110
111
112
113
114
115
116
117 #define ACX_REG_INTERRUPT_CLEAR (REGISTERS_BASE + 0x04F8)
118
119
120
121
122
123
124
125
126
127
128
129 #define WL12XX_REG_INTERRUPT_ACK (REGISTERS_BASE + 0x04F0)
130
131 #define WL12XX_REG_RX_DRIVER_COUNTER (REGISTERS_BASE + 0x0538)
132
133
134 #define SOR_CFG (REGISTERS_BASE + 0x0800)
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 #define WL12XX_REG_ECPU_CONTROL (REGISTERS_BASE + 0x0804)
157
158 #define WL12XX_HI_CFG (REGISTERS_BASE + 0x0808)
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175 #define ACX_REG_EE_START (REGISTERS_BASE + 0x080C)
176
177 #define WL12XX_OCP_POR_CTR (REGISTERS_BASE + 0x09B4)
178 #define WL12XX_OCP_DATA_WRITE (REGISTERS_BASE + 0x09B8)
179 #define WL12XX_OCP_DATA_READ (REGISTERS_BASE + 0x09BC)
180 #define WL12XX_OCP_CMD (REGISTERS_BASE + 0x09C0)
181
182 #define WL12XX_HOST_WR_ACCESS (REGISTERS_BASE + 0x09F8)
183
184 #define WL12XX_CHIP_ID_B (REGISTERS_BASE + 0x5674)
185
186 #define WL12XX_ENABLE (REGISTERS_BASE + 0x5450)
187
188
189 #define WL12XX_ELP_CFG_MODE (REGISTERS_BASE + 0x5804)
190 #define WL12XX_ELP_CMD (REGISTERS_BASE + 0x5808)
191 #define WL12XX_PLL_CAL_TIME (REGISTERS_BASE + 0x5810)
192 #define WL12XX_CLK_REQ_TIME (REGISTERS_BASE + 0x5814)
193 #define WL12XX_CLK_BUF_TIME (REGISTERS_BASE + 0x5818)
194
195 #define WL12XX_CFG_PLL_SYNC_CNT (REGISTERS_BASE + 0x5820)
196
197
198 #define WL12XX_SCR_PAD0 (REGISTERS_BASE + 0x5608)
199 #define WL12XX_SCR_PAD1 (REGISTERS_BASE + 0x560C)
200 #define WL12XX_SCR_PAD2 (REGISTERS_BASE + 0x5610)
201 #define WL12XX_SCR_PAD3 (REGISTERS_BASE + 0x5614)
202 #define WL12XX_SCR_PAD4 (REGISTERS_BASE + 0x5618)
203 #define WL12XX_SCR_PAD4_SET (REGISTERS_BASE + 0x561C)
204 #define WL12XX_SCR_PAD4_CLR (REGISTERS_BASE + 0x5620)
205 #define WL12XX_SCR_PAD5 (REGISTERS_BASE + 0x5624)
206 #define WL12XX_SCR_PAD5_SET (REGISTERS_BASE + 0x5628)
207 #define WL12XX_SCR_PAD5_CLR (REGISTERS_BASE + 0x562C)
208 #define WL12XX_SCR_PAD6 (REGISTERS_BASE + 0x5630)
209 #define WL12XX_SCR_PAD7 (REGISTERS_BASE + 0x5634)
210 #define WL12XX_SCR_PAD8 (REGISTERS_BASE + 0x5638)
211 #define WL12XX_SCR_PAD9 (REGISTERS_BASE + 0x563C)
212
213
214 #define WL12XX_SPARE_A1 (REGISTERS_BASE + 0x0994)
215 #define WL12XX_SPARE_A2 (REGISTERS_BASE + 0x0998)
216 #define WL12XX_SPARE_A3 (REGISTERS_BASE + 0x099C)
217 #define WL12XX_SPARE_A4 (REGISTERS_BASE + 0x09A0)
218 #define WL12XX_SPARE_A5 (REGISTERS_BASE + 0x09A4)
219 #define WL12XX_SPARE_A6 (REGISTERS_BASE + 0x09A8)
220 #define WL12XX_SPARE_A7 (REGISTERS_BASE + 0x09AC)
221 #define WL12XX_SPARE_A8 (REGISTERS_BASE + 0x09B0)
222 #define WL12XX_SPARE_B1 (REGISTERS_BASE + 0x5420)
223 #define WL12XX_SPARE_B2 (REGISTERS_BASE + 0x5424)
224 #define WL12XX_SPARE_B3 (REGISTERS_BASE + 0x5428)
225 #define WL12XX_SPARE_B4 (REGISTERS_BASE + 0x542C)
226 #define WL12XX_SPARE_B5 (REGISTERS_BASE + 0x5430)
227 #define WL12XX_SPARE_B6 (REGISTERS_BASE + 0x5434)
228 #define WL12XX_SPARE_B7 (REGISTERS_BASE + 0x5438)
229 #define WL12XX_SPARE_B8 (REGISTERS_BASE + 0x543C)
230
231 #define WL12XX_PLL_PARAMETERS (REGISTERS_BASE + 0x6040)
232 #define WL12XX_WU_COUNTER_PAUSE (REGISTERS_BASE + 0x6008)
233 #define WL12XX_WELP_ARM_COMMAND (REGISTERS_BASE + 0x6100)
234 #define WL12XX_DRPW_SCRATCH_START (DRPW_BASE + 0x002C)
235
236 #define WL12XX_CMD_MBOX_ADDRESS 0x407B4
237
238 #define ACX_REG_EEPROM_START_BIT BIT(1)
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255 #define WL12XX_REG_COMMAND_MAILBOX_PTR (WL12XX_SCR_PAD0)
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270 #define WL12XX_REG_EVENT_MAILBOX_PTR (WL12XX_SCR_PAD1)
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287 #define ACX_EE_CTL_REG EE_CTL
288 #define EE_WRITE 0x00000001ul
289 #define EE_READ 0x00000002ul
290
291
292
293
294
295
296
297 #define ACX_EE_ADDR_REG EE_ADDR
298
299
300
301
302
303
304
305
306 #define ACX_EE_DATA_REG EE_DATA
307
308
309
310
311
312
313
314
315
316
317 #define ACX_EE_CFG EE_CFG
318
319
320
321
322
323
324
325
326 #define ACX_GPIO_OUT_REG GPIO_OUT
327 #define ACX_MAX_GPIO_LINES 15
328
329
330
331
332
333
334
335
336
337 #define ACX_CONT_WIND_CFG_REG CONT_WIND_CFG
338 #define ACX_CONT_WIND_MIN_MASK 0x0000007f
339 #define ACX_CONT_WIND_MAX 0x03ff0000
340
341 #define REF_FREQ_19_2 0
342 #define REF_FREQ_26_0 1
343 #define REF_FREQ_38_4 2
344 #define REF_FREQ_40_0 3
345 #define REF_FREQ_33_6 4
346 #define REF_FREQ_NUM 5
347
348 #define LUT_PARAM_INTEGER_DIVIDER 0
349 #define LUT_PARAM_FRACTIONAL_DIVIDER 1
350 #define LUT_PARAM_ATTN_BB 2
351 #define LUT_PARAM_ALPHA_BB 3
352 #define LUT_PARAM_STOP_TIME_BB 4
353 #define LUT_PARAM_BB_PLL_LOOP_FILTER 5
354 #define LUT_PARAM_NUM 6
355
356 #define WL12XX_EEPROMLESS_IND (WL12XX_SCR_PAD4)
357 #define USE_EEPROM 0
358 #define NVS_DATA_BUNDARY_ALIGNMENT 4
359
360
361 #define FW_HDR_SIZE 8
362
363
364
365
366
367
368
369 #define SHORT_PREAMBLE_BIT BIT(0)
370 #define OFDM_RATE_BIT BIT(6)
371 #define PBCC_RATE_BIT BIT(7)
372
373 enum {
374 CCK_LONG = 0,
375 CCK_SHORT = SHORT_PREAMBLE_BIT,
376 PBCC_LONG = PBCC_RATE_BIT,
377 PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
378 OFDM = OFDM_RATE_BIT
379 };
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402 #define OCP_CMD_LOOP 32
403 #define OCP_CMD_WRITE 0x1
404 #define OCP_CMD_READ 0x2
405 #define OCP_READY_MASK BIT(18)
406 #define OCP_STATUS_MASK (BIT(16) | BIT(17))
407 #define OCP_STATUS_NO_RESP 0x00000
408 #define OCP_STATUS_OK 0x10000
409 #define OCP_STATUS_REQ_FAILED 0x20000
410 #define OCP_STATUS_RESP_ERROR 0x30000
411
412 #define OCP_REG_POLARITY 0x0064
413 #define OCP_REG_CLK_TYPE 0x0448
414 #define OCP_REG_CLK_POLARITY 0x0cb2
415 #define OCP_REG_CLK_PULL 0x0cb4
416
417 #define POLARITY_LOW BIT(1)
418 #define NO_PULL (BIT(14) | BIT(15))
419
420 #define FREF_CLK_TYPE_BITS 0xfffffe7f
421 #define CLK_REQ_PRCM 0x100
422 #define FREF_CLK_POLARITY_BITS 0xfffff8ff
423 #define CLK_REQ_OUTN_SEL 0x700
424
425 #define WU_COUNTER_PAUSE_VAL 0x3FF
426
427
428 #define SYS_CLK_CFG_REG 0x2200
429
430 #define MCS_PLL_CLK_SEL_FREF BIT(0)
431
432 #define WL_CLK_REQ_TYPE_FREF BIT(3)
433 #define WL_CLK_REQ_TYPE_PG2 (BIT(3) | BIT(2))
434
435 #define PRCM_CM_EN_MUX_WLAN_FREF BIT(4)
436
437 #define TCXO_ILOAD_INT_REG 0x2264
438 #define TCXO_CLK_DETECT_REG 0x2266
439
440 #define TCXO_DET_FAILED BIT(4)
441
442 #define FREF_ILOAD_INT_REG 0x2084
443 #define FREF_CLK_DETECT_REG 0x2086
444 #define FREF_CLK_DETECT_FAIL BIT(4)
445
446
447 #define WL_SPARE_REG 0x2320
448 #define WL_SPARE_VAL BIT(2)
449
450 #define WL_SPARE_MASK_8526 (BIT(6) | BIT(5) | BIT(3))
451
452 #define PLL_LOCK_COUNTERS_REG 0xD8C
453 #define PLL_LOCK_COUNTERS_COEX 0x0F
454 #define PLL_LOCK_COUNTERS_MCS 0xF0
455 #define MCS_PLL_OVERRIDE_REG 0xD90
456 #define MCS_PLL_CONFIG_REG 0xD92
457 #define MCS_SEL_IN_FREQ_MASK 0x0070
458 #define MCS_SEL_IN_FREQ_SHIFT 4
459 #define MCS_PLL_CONFIG_REG_VAL 0x73
460 #define MCS_PLL_ENABLE_HP (BIT(0) | BIT(1))
461
462 #define MCS_PLL_M_REG 0xD94
463 #define MCS_PLL_N_REG 0xD96
464 #define MCS_PLL_M_REG_VAL 0xC8
465 #define MCS_PLL_N_REG_VAL 0x07
466
467 #define SDIO_IO_DS 0xd14
468
469
470 enum {
471 HCI_IO_DS_8MA = 0,
472 HCI_IO_DS_4MA = 1,
473 HCI_IO_DS_6MA = 2,
474 HCI_IO_DS_2MA = 3,
475 };
476
477
478
479
480
481
482
483
484
485 #define WL12XX_INTR_TRIG_CMD BIT(0)
486
487
488
489
490
491
492
493 #define WL12XX_INTR_TRIG_EVENT_ACK BIT(1)
494
495
496
497
498
499 #define HI_CFG_UART_ENABLE 0x00000004
500 #define HI_CFG_RST232_ENABLE 0x00000008
501 #define HI_CFG_CLOCK_REQ_SELECT 0x00000010
502 #define HI_CFG_HOST_INT_ENABLE 0x00000020
503 #define HI_CFG_VLYNQ_OUTPUT_ENABLE 0x00000040
504 #define HI_CFG_HOST_INT_ACTIVE_LOW 0x00000080
505 #define HI_CFG_UART_TX_OUT_GPIO_15 0x00000100
506 #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200
507 #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400
508
509 #define HI_CFG_DEF_VAL \
510 (HI_CFG_UART_ENABLE | \
511 HI_CFG_RST232_ENABLE | \
512 HI_CFG_CLOCK_REQ_SELECT | \
513 HI_CFG_HOST_INT_ENABLE)
514
515 #define WL127X_REG_FUSE_DATA_2_1 0x050a
516 #define WL128X_REG_FUSE_DATA_2_1 0x2152
517 #define PG_VER_MASK 0x3c
518 #define PG_VER_OFFSET 2
519
520 #define WL127X_PG_MAJOR_VER_MASK 0x3
521 #define WL127X_PG_MAJOR_VER_OFFSET 0x0
522 #define WL127X_PG_MINOR_VER_MASK 0xc
523 #define WL127X_PG_MINOR_VER_OFFSET 0x2
524
525 #define WL128X_PG_MAJOR_VER_MASK 0xc
526 #define WL128X_PG_MAJOR_VER_OFFSET 0x2
527 #define WL128X_PG_MINOR_VER_MASK 0x3
528 #define WL128X_PG_MINOR_VER_OFFSET 0x0
529
530 #define WL127X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL127X_PG_MAJOR_VER_MASK) >> \
531 WL127X_PG_MAJOR_VER_OFFSET)
532 #define WL127X_PG_GET_MINOR(pg_ver) ((pg_ver & WL127X_PG_MINOR_VER_MASK) >> \
533 WL127X_PG_MINOR_VER_OFFSET)
534 #define WL128X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL128X_PG_MAJOR_VER_MASK) >> \
535 WL128X_PG_MAJOR_VER_OFFSET)
536 #define WL128X_PG_GET_MINOR(pg_ver) ((pg_ver & WL128X_PG_MINOR_VER_MASK) >> \
537 WL128X_PG_MINOR_VER_OFFSET)
538
539 #define WL12XX_REG_FUSE_BD_ADDR_1 0x00310eb4
540 #define WL12XX_REG_FUSE_BD_ADDR_2 0x00310eb8
541
542 #endif