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