1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include <asm/addrspace.h>
21 #include <linux/types.h>
22
23 #ifndef _ASM_MSP_REGS_H
24 #define _ASM_MSP_REGS_H
25
26
27
28
29
30
31
32
33
34
35
36
37 #define MSP_SLP_BASE 0x1c000000
38
39 #define MSP_RST_BASE (MSP_SLP_BASE + 0x10)
40
41 #define MSP_RST_SIZE 0x0C
42
43 #define MSP_WTIMER_BASE (MSP_SLP_BASE + 0x04C)
44
45 #define MSP_ITIMER_BASE (MSP_SLP_BASE + 0x054)
46
47 #define MSP_UART0_BASE (MSP_SLP_BASE + 0x100)
48
49 #define MSP_BCPY_CTRL_BASE (MSP_SLP_BASE + 0x120)
50
51 #define MSP_BCPY_DESC_BASE (MSP_SLP_BASE + 0x160)
52
53
54
55
56
57
58
59 #define MSP_PCI_BASE 0x19000000
60
61
62
63
64
65
66 #define MSP_MSB_BASE 0x18000000
67
68 #define MSP_PER_BASE (MSP_MSB_BASE + 0x400000)
69
70 #define MSP_MAC0_BASE (MSP_MSB_BASE + 0x600000)
71
72 #define MSP_MAC1_BASE (MSP_MSB_BASE + 0x700000)
73
74 #define MSP_MAC_SIZE 0xE0
75
76 #define MSP_SEC_BASE (MSP_MSB_BASE + 0x800000)
77
78 #define MSP_MAC2_BASE (MSP_MSB_BASE + 0x900000)
79
80 #define MSP_ADSL2_BASE (MSP_MSB_BASE + 0xA80000)
81
82 #define MSP_USB0_BASE (MSP_MSB_BASE + 0xB00000)
83
84 #define MSP_USB1_BASE (MSP_MSB_BASE + 0x300000)
85
86 #define MSP_CPUIF_BASE (MSP_MSB_BASE + 0xC00000)
87
88
89
90 #define MSP_UART1_BASE (MSP_PER_BASE + 0x030)
91
92 #define MSP_SPI_BASE (MSP_PER_BASE + 0x058)
93
94 #define MSP_TWI_BASE (MSP_PER_BASE + 0x090)
95
96 #define MSP_PTIMER_BASE (MSP_PER_BASE + 0x0F0)
97
98
99
100
101
102
103
104 #define MSP_MEM_CFG_BASE 0x17f00000
105
106 #define MSP_MEM_INDIRECT_CTL_10 0x10
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146 #ifdef __ASSEMBLER__
147 #define regptr(addr) (KSEG1ADDR(addr))
148 #else
149 #define regptr(addr) ((volatile u32 *const)(KSEG1ADDR(addr)))
150 #endif
151
152
153
154
155
156
157
158
159 #define DEV_ID_REG regptr(MSP_SLP_BASE + 0x00)
160
161 #define FWR_ID_REG regptr(MSP_SLP_BASE + 0x04)
162
163 #define SYS_ID_REG0 regptr(MSP_SLP_BASE + 0x08)
164
165 #define SYS_ID_REG1 regptr(MSP_SLP_BASE + 0x0C)
166
167
168
169 #define RST_STS_REG regptr(MSP_SLP_BASE + 0x10)
170
171 #define RST_SET_REG regptr(MSP_SLP_BASE + 0x14)
172
173 #define RST_CLR_REG regptr(MSP_SLP_BASE + 0x18)
174
175
176
177 #define PCI_SLP_REG regptr(MSP_SLP_BASE + 0x1C)
178
179 #define URT_SLP_REG regptr(MSP_SLP_BASE + 0x20)
180
181
182
183 #define PLL1_SLP_REG regptr(MSP_SLP_BASE + 0x2C)
184
185 #define PLL0_SLP_REG regptr(MSP_SLP_BASE + 0x30)
186
187 #define MIPS_SLP_REG regptr(MSP_SLP_BASE + 0x34)
188
189 #define VE_SLP_REG regptr(MSP_SLP_BASE + 0x38)
190
191
192 #define MSB_SLP_REG regptr(MSP_SLP_BASE + 0x40)
193
194 #define SMAC_SLP_REG regptr(MSP_SLP_BASE + 0x44)
195
196 #define PERF_SLP_REG regptr(MSP_SLP_BASE + 0x48)
197
198
199
200 #define SLP_INT_STS_REG regptr(MSP_SLP_BASE + 0x70)
201
202 #define SLP_INT_MSK_REG regptr(MSP_SLP_BASE + 0x74)
203
204 #define SE_MBOX_REG regptr(MSP_SLP_BASE + 0x78)
205
206 #define VE_MBOX_REG regptr(MSP_SLP_BASE + 0x7C)
207
208
209
210 #define CS0_CNFG_REG regptr(MSP_SLP_BASE + 0x80)
211
212 #define CS0_ADDR_REG regptr(MSP_SLP_BASE + 0x84)
213
214 #define CS0_MASK_REG regptr(MSP_SLP_BASE + 0x88)
215
216 #define CS0_ACCESS_REG regptr(MSP_SLP_BASE + 0x8C)
217
218
219 #define CS1_CNFG_REG regptr(MSP_SLP_BASE + 0x90)
220
221 #define CS1_ADDR_REG regptr(MSP_SLP_BASE + 0x94)
222
223 #define CS1_MASK_REG regptr(MSP_SLP_BASE + 0x98)
224
225 #define CS1_ACCESS_REG regptr(MSP_SLP_BASE + 0x9C)
226
227
228 #define CS2_CNFG_REG regptr(MSP_SLP_BASE + 0xA0)
229
230 #define CS2_ADDR_REG regptr(MSP_SLP_BASE + 0xA4)
231
232 #define CS2_MASK_REG regptr(MSP_SLP_BASE + 0xA8)
233
234 #define CS2_ACCESS_REG regptr(MSP_SLP_BASE + 0xAC)
235
236
237 #define CS3_CNFG_REG regptr(MSP_SLP_BASE + 0xB0)
238
239 #define CS3_ADDR_REG regptr(MSP_SLP_BASE + 0xB4)
240
241 #define CS3_MASK_REG regptr(MSP_SLP_BASE + 0xB8)
242
243 #define CS3_ACCESS_REG regptr(MSP_SLP_BASE + 0xBC)
244
245
246 #define CS4_CNFG_REG regptr(MSP_SLP_BASE + 0xC0)
247
248 #define CS4_ADDR_REG regptr(MSP_SLP_BASE + 0xC4)
249
250 #define CS4_MASK_REG regptr(MSP_SLP_BASE + 0xC8)
251
252 #define CS4_ACCESS_REG regptr(MSP_SLP_BASE + 0xCC)
253
254
255 #define CS5_CNFG_REG regptr(MSP_SLP_BASE + 0xD0)
256
257 #define CS5_ADDR_REG regptr(MSP_SLP_BASE + 0xD4)
258
259 #define CS5_MASK_REG regptr(MSP_SLP_BASE + 0xD8)
260
261 #define CS5_ACCESS_REG regptr(MSP_SLP_BASE + 0xDC)
262
263
264
265 #define ELB_1PC_EN_REG regptr(MSP_SLP_BASE + 0xEC)
266
267
268
269 #define ELB_CLK_CFG_REG regptr(MSP_SLP_BASE + 0xFC)
270
271
272
273 #define UART0_STATUS_REG regptr(MSP_UART0_BASE + 0x0c0)
274
275 #define UART1_STATUS_REG regptr(MSP_UART1_BASE + 0x170)
276
277
278
279 #define PERF_MON_CTRL_REG regptr(MSP_SLP_BASE + 0x140)
280
281 #define PERF_MON_CLR_REG regptr(MSP_SLP_BASE + 0x144)
282
283 #define PERF_MON_CNTH_REG regptr(MSP_SLP_BASE + 0x148)
284
285 #define PERF_MON_CNTL_REG regptr(MSP_SLP_BASE + 0x14C)
286
287
288
289 #define SYS_CTRL_REG regptr(MSP_SLP_BASE + 0x150)
290
291 #define SYS_ERR1_REG regptr(MSP_SLP_BASE + 0x154)
292
293 #define SYS_ERR2_REG regptr(MSP_SLP_BASE + 0x158)
294
295 #define SYS_INT_CFG_REG regptr(MSP_SLP_BASE + 0x15C)
296
297
298
299 #define VE_MEM_REG regptr(MSP_SLP_BASE + 0x17C)
300
301
302
303 #define CPU_ERR1_REG regptr(MSP_SLP_BASE + 0x180)
304
305 #define CPU_ERR2_REG regptr(MSP_SLP_BASE + 0x184)
306
307
308
309 #define EXTENDED_GPIO1_REG regptr(MSP_SLP_BASE + 0x188)
310 #define EXTENDED_GPIO2_REG regptr(MSP_SLP_BASE + 0x18c)
311 #define EXTENDED_GPIO_REG EXTENDED_GPIO1_REG
312
313
314
315 #define SLP_ERR_STS_REG regptr(MSP_SLP_BASE + 0x190)
316
317 #define SLP_ERR_MSK_REG regptr(MSP_SLP_BASE + 0x194)
318
319 #define SLP_ELB_ERST_REG regptr(MSP_SLP_BASE + 0x198)
320
321 #define SLP_BOOT_STS_REG regptr(MSP_SLP_BASE + 0x19C)
322
323
324
325 #define CS0_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A0)
326
327 #define CS1_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A4)
328
329 #define CS2_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A8)
330
331 #define CS3_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1AC)
332
333
334 #define CS5_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1B4)
335
336
337
338 #define PLL_LOCK_REG regptr(MSP_SLP_BASE + 0x200)
339
340 #define PLL_ARST_REG regptr(MSP_SLP_BASE + 0x204)
341
342 #define PLL0_ADJ_REG regptr(MSP_SLP_BASE + 0x208)
343
344 #define PLL1_ADJ_REG regptr(MSP_SLP_BASE + 0x20C)
345
346
347
348
349
350
351
352
353
354 #define PER_CTRL_REG regptr(MSP_PER_BASE + 0x50)
355
356 #define PER_STS_REG regptr(MSP_PER_BASE + 0x54)
357
358
359
360 #define SMPI_TX_SZ_REG regptr(MSP_PER_BASE + 0x58)
361
362 #define SMPI_RX_SZ_REG regptr(MSP_PER_BASE + 0x5C)
363
364 #define SMPI_CTL_REG regptr(MSP_PER_BASE + 0x60)
365
366 #define SMPI_MS_REG regptr(MSP_PER_BASE + 0x64)
367
368 #define SMPI_CORE_DATA_REG regptr(MSP_PER_BASE + 0xC0)
369
370 #define SMPI_CORE_CTRL_REG regptr(MSP_PER_BASE + 0xC4)
371
372 #define SMPI_CORE_STAT_REG regptr(MSP_PER_BASE + 0xC8)
373
374 #define SMPI_CORE_SSEL_REG regptr(MSP_PER_BASE + 0xCC)
375
376 #define SMPI_FIFO_REG regptr(MSP_PER_BASE + 0xD0)
377
378
379
380 #define PER_ERR_STS_REG regptr(MSP_PER_BASE + 0x70)
381
382 #define PER_ERR_MSK_REG regptr(MSP_PER_BASE + 0x74)
383
384 #define PER_HDR1_REG regptr(MSP_PER_BASE + 0x78)
385
386 #define PER_HDR2_REG regptr(MSP_PER_BASE + 0x7C)
387
388
389
390 #define PER_INT_STS_REG regptr(MSP_PER_BASE + 0x80)
391
392 #define PER_INT_MSK_REG regptr(MSP_PER_BASE + 0x84)
393
394 #define GPIO_INT_STS_REG regptr(MSP_PER_BASE + 0x88)
395
396 #define GPIO_INT_MSK_REG regptr(MSP_PER_BASE + 0x8C)
397
398
399
400 #define POLO_GPIO_DAT1_REG regptr(MSP_PER_BASE + 0x0E0)
401
402 #define POLO_GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x0E4)
403
404 #define POLO_GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x0E8)
405
406 #define POLO_GPIO_OD1_REG regptr(MSP_PER_BASE + 0x0EC)
407
408 #define POLO_GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x170)
409
410 #define POLO_GPIO_DAT2_REG regptr(MSP_PER_BASE + 0x174)
411
412 #define POLO_GPIO_DAT3_REG regptr(MSP_PER_BASE + 0x178)
413
414 #define POLO_GPIO_DAT4_REG regptr(MSP_PER_BASE + 0x17C)
415
416 #define POLO_GPIO_DAT5_REG regptr(MSP_PER_BASE + 0x180)
417
418 #define POLO_GPIO_DAT6_REG regptr(MSP_PER_BASE + 0x184)
419
420 #define POLO_GPIO_DAT7_REG regptr(MSP_PER_BASE + 0x188)
421
422 #define POLO_GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
423
424 #define POLO_GPIO_CFG5_REG regptr(MSP_PER_BASE + 0x190)
425
426 #define POLO_GPIO_CFG6_REG regptr(MSP_PER_BASE + 0x194)
427
428 #define POLO_GPIO_CFG7_REG regptr(MSP_PER_BASE + 0x198)
429
430 #define POLO_GPIO_OD2_REG regptr(MSP_PER_BASE + 0x19C)
431
432
433
434 #define GPIO_DATA1_REG regptr(MSP_PER_BASE + 0x170)
435
436 #define GPIO_DATA2_REG regptr(MSP_PER_BASE + 0x174)
437
438 #define GPIO_DATA3_REG regptr(MSP_PER_BASE + 0x178)
439
440 #define GPIO_DATA4_REG regptr(MSP_PER_BASE + 0x17C)
441
442 #define GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x180)
443
444 #define GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x184)
445
446 #define GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x188)
447
448 #define GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
449
450 #define GPIO_OD_REG regptr(MSP_PER_BASE + 0x190)
451
452
453
454
455
456
457
458 #define PCI_FLUSH_REG regptr(MSP_CPUIF_BASE + 0x00)
459
460 #define OCP_ERR1_REG regptr(MSP_CPUIF_BASE + 0x04)
461
462 #define OCP_ERR2_REG regptr(MSP_CPUIF_BASE + 0x08)
463
464 #define OCP_STS_REG regptr(MSP_CPUIF_BASE + 0x0C)
465
466 #define CPUIF_PM_REG regptr(MSP_CPUIF_BASE + 0x10)
467
468 #define CPUIF_CFG_REG regptr(MSP_CPUIF_BASE + 0x10)
469
470
471
472 #define MSP_CIC_BASE (MSP_CPUIF_BASE + 0x8000)
473
474 #define CIC_EXT_CFG_REG regptr(MSP_CIC_BASE + 0x00)
475
476 #define CIC_STS_REG regptr(MSP_CIC_BASE + 0x04)
477
478 #define CIC_VPE0_MSK_REG regptr(MSP_CIC_BASE + 0x08)
479
480 #define CIC_VPE1_MSK_REG regptr(MSP_CIC_BASE + 0x0C)
481
482 #define CIC_TC0_MSK_REG regptr(MSP_CIC_BASE + 0x10)
483
484 #define CIC_TC1_MSK_REG regptr(MSP_CIC_BASE + 0x14)
485
486 #define CIC_TC2_MSK_REG regptr(MSP_CIC_BASE + 0x18)
487
488 #define CIC_TC3_MSK_REG regptr(MSP_CIC_BASE + 0x18)
489
490 #define CIC_TC4_MSK_REG regptr(MSP_CIC_BASE + 0x18)
491
492 #define CIC_PCIMSI_STS_REG regptr(MSP_CIC_BASE + 0x18)
493 #define CIC_PCIMSI_MSK_REG regptr(MSP_CIC_BASE + 0x18)
494 #define CIC_PCIFLSH_REG regptr(MSP_CIC_BASE + 0x18)
495 #define CIC_VPE0_SWINT_REG regptr(MSP_CIC_BASE + 0x08)
496
497
498
499
500
501
502
503 #define MEM_CFG1_REG regptr(MSP_MEM_CFG_BASE + 0x00)
504 #define MEM_SS_ADDR regptr(MSP_MEM_CFG_BASE + 0x00)
505 #define MEM_SS_DATA regptr(MSP_MEM_CFG_BASE + 0x04)
506 #define MEM_SS_WRITE regptr(MSP_MEM_CFG_BASE + 0x08)
507
508
509
510
511
512
513 #define PCI_BASE_REG regptr(MSP_PCI_BASE + 0x00)
514 #define PCI_CONFIG_SPACE_REG regptr(MSP_PCI_BASE + 0x800)
515 #define PCI_JTAG_DEVID_REG regptr(MSP_SLP_BASE + 0x13c)
516
517
518
519
520
521
522
523
524
525
526
527
528 #define DEV_ID_PCI_DIS (1 << 26)
529 #define DEV_ID_PCI_HOST (1 << 20)
530 #define DEV_ID_SINGLE_PC (1 << 19)
531 #define DEV_ID_FAMILY (0xff << 8)
532 #define POLO_ZEUS_SUB_FAMILY (0x7 << 16)
533
534 #define MSPFPGA_ID (0x00 << 8)
535 #define MSP5000_ID (0x50 << 8)
536 #define MSP4F00_ID (0x4f << 8)
537 #define MSP4E00_ID (0x4f << 8)
538 #define MSP4200_ID (0x42 << 8)
539 #define MSP4000_ID (0x40 << 8)
540 #define MSP2XXX_ID (0x20 << 8)
541 #define MSPZEUS_ID (0x10 << 8)
542
543 #define MSP2004_SUB_ID (0x0 << 16)
544 #define MSP2005_SUB_ID (0x1 << 16)
545 #define MSP2006_SUB_ID (0x1 << 16)
546 #define MSP2007_SUB_ID (0x2 << 16)
547 #define MSP2010_SUB_ID (0x3 << 16)
548 #define MSP2015_SUB_ID (0x4 << 16)
549 #define MSP2020_SUB_ID (0x5 << 16)
550 #define MSP2100_SUB_ID (0x6 << 16)
551
552
553
554
555
556
557 #define MSP_GR_RST (0x01 << 0)
558 #define MSP_MR_RST (0x01 << 1)
559 #define MSP_PD_RST (0x01 << 2)
560 #define MSP_PP_RST (0x01 << 3)
561
562 #define MSP_EA_RST (0x01 << 6)
563 #define MSP_EB_RST (0x01 << 7)
564 #define MSP_SE_RST (0x01 << 8)
565 #define MSP_PB_RST (0x01 << 9)
566 #define MSP_EC_RST (0x01 << 10)
567 #define MSP_TW_RST (0x01 << 11)
568 #define MSP_SPI_RST (0x01 << 12)
569 #define MSP_U1_RST (0x01 << 13)
570 #define MSP_U0_RST (0x01 << 14)
571
572
573
574
575
576
577 #define MSP_BASE_BAUD 25000000
578 #define MSP_UART_REG_LEN 0x20
579
580
581
582
583
584
585 #define PCCARD_32 0x02
586 #define SINGLE_PCCARD 0x01
587
588
589
590
591
592
593
594
595 #define EXT_INT_POL(eirq) (1 << (eirq + 8))
596 #define EXT_INT_EDGE(eirq) (1 << eirq)
597
598 #define CIC_EXT_SET_TRIGGER_LEVEL(reg, eirq) (reg &= ~EXT_INT_EDGE(eirq))
599 #define CIC_EXT_SET_TRIGGER_EDGE(reg, eirq) (reg |= EXT_INT_EDGE(eirq))
600 #define CIC_EXT_SET_ACTIVE_HI(reg, eirq) (reg |= EXT_INT_POL(eirq))
601 #define CIC_EXT_SET_ACTIVE_LO(reg, eirq) (reg &= ~EXT_INT_POL(eirq))
602 #define CIC_EXT_SET_ACTIVE_RISING CIC_EXT_SET_ACTIVE_HI
603 #define CIC_EXT_SET_ACTIVE_FALLING CIC_EXT_SET_ACTIVE_LO
604
605 #define CIC_EXT_IS_TRIGGER_LEVEL(reg, eirq) \
606 ((reg & EXT_INT_EDGE(eirq)) == 0)
607 #define CIC_EXT_IS_TRIGGER_EDGE(reg, eirq) (reg & EXT_INT_EDGE(eirq))
608 #define CIC_EXT_IS_ACTIVE_HI(reg, eirq) (reg & EXT_INT_POL(eirq))
609 #define CIC_EXT_IS_ACTIVE_LO(reg, eirq) \
610 ((reg & EXT_INT_POL(eirq)) == 0)
611 #define CIC_EXT_IS_ACTIVE_RISING CIC_EXT_IS_ACTIVE_HI
612 #define CIC_EXT_IS_ACTIVE_FALLING CIC_EXT_IS_ACTIVE_LO
613
614
615
616
617
618
619
620
621 #define DDRC_CFG(n) (n)
622 #define DDRC_DEBUG(n) (0x04 + n)
623 #define DDRC_CTL(n) (0x40 + n)
624
625
626 #define DDRC_INDIRECT_WRITE(reg, mask, value) \
627 ({ \
628 *MEM_SS_ADDR = (((mask) & 0xf) << 8) | ((reg) & 0xff); \
629 *MEM_SS_DATA = (value); \
630 *MEM_SS_WRITE = 1; \
631 })
632
633
634
635
636
637
638 #define SPI_MPI_RX_BUSY 0x00008000
639 #define SPI_MPI_FIFO_EMPTY 0x00004000
640 #define SPI_MPI_TX_BUSY 0x00002000
641 #define SPI_MPI_FIFO_FULL 0x00001000
642
643
644
645
646
647
648 #define SPI_MPI_RX_START 0x00000004
649 #define SPI_MPI_FLUSH_Q 0x00000002
650 #define SPI_MPI_TX_START 0x00000001
651
652 #endif