Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /****************************************************************************/ |
2 | ||
3 | /* | |
4 | * m527xsim.h -- ColdFire 5270/5271 System Integration Module support. | |
5 | * | |
6 | * (C) Copyright 2004, Greg Ungerer (gerg@snapgear.com) | |
7 | */ | |
8 | ||
9 | /****************************************************************************/ | |
10 | #ifndef m527xsim_h | |
11 | #define m527xsim_h | |
12 | /****************************************************************************/ | |
13 | ||
733f31b7 GU |
14 | #define CPU_NAME "COLDFIRE(m527x)" |
15 | #define CPU_INSTR_PER_JIFFY 3 | |
ce3de78a | 16 | #define MCF_BUSCLK (MCF_CLK / 2) |
7fc82b65 | 17 | |
a12cf0a8 | 18 | #include <asm/m52xxacr.h> |
1da177e4 LT |
19 | |
20 | /* | |
21 | * Define the 5270/5271 SIM register set addresses. | |
22 | */ | |
254eef74 GU |
23 | #define MCFICM_INTC0 (MCF_IPSBAR + 0x0c00) /* Base for Interrupt Ctrl 0 */ |
24 | #define MCFICM_INTC1 (MCF_IPSBAR + 0x0d00) /* Base for Interrupt Ctrl 1 */ | |
25 | ||
1da177e4 LT |
26 | #define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */ |
27 | #define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */ | |
28 | #define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */ | |
29 | #define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */ | |
30 | #define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */ | |
31 | #define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */ | |
32 | #define MCFINTC_IRLR 0x18 /* */ | |
33 | #define MCFINTC_IACKL 0x19 /* */ | |
34 | #define MCFINTC_ICR0 0x40 /* Base ICR register */ | |
35 | ||
36 | #define MCFINT_VECBASE 64 /* Vector base number */ | |
37 | #define MCFINT_UART0 13 /* Interrupt number for UART0 */ | |
38 | #define MCFINT_UART1 14 /* Interrupt number for UART1 */ | |
39 | #define MCFINT_UART2 15 /* Interrupt number for UART2 */ | |
91d60417 | 40 | #define MCFINT_QSPI 18 /* Interrupt number for QSPI */ |
1da177e4 LT |
41 | #define MCFINT_PIT1 36 /* Interrupt number for PIT1 */ |
42 | ||
43 | /* | |
44 | * SDRAM configuration registers. | |
45 | */ | |
d871629b | 46 | #ifdef CONFIG_M5271 |
6a92e198 GU |
47 | #define MCFSIM_DCR (MCF_IPSBAR + 0x40) /* Control */ |
48 | #define MCFSIM_DACR0 (MCF_IPSBAR + 0x48) /* Base address 0 */ | |
49 | #define MCFSIM_DMR0 (MCF_IPSBAR + 0x4c) /* Address mask 0 */ | |
50 | #define MCFSIM_DACR1 (MCF_IPSBAR + 0x50) /* Base address 1 */ | |
51 | #define MCFSIM_DMR1 (MCF_IPSBAR + 0x54) /* Address mask 1 */ | |
d871629b GU |
52 | #endif |
53 | #ifdef CONFIG_M5275 | |
6a92e198 GU |
54 | #define MCFSIM_DMR (MCF_IPSBAR + 0x40) /* Mode */ |
55 | #define MCFSIM_DCR (MCF_IPSBAR + 0x44) /* Control */ | |
56 | #define MCFSIM_DCFG1 (MCF_IPSBAR + 0x48) /* Configuration 1 */ | |
57 | #define MCFSIM_DCFG2 (MCF_IPSBAR + 0x4c) /* Configuration 2 */ | |
58 | #define MCFSIM_DBAR0 (MCF_IPSBAR + 0x50) /* Base address 0 */ | |
59 | #define MCFSIM_DMR0 (MCF_IPSBAR + 0x54) /* Address mask 0 */ | |
60 | #define MCFSIM_DBAR1 (MCF_IPSBAR + 0x58) /* Base address 1 */ | |
61 | #define MCFSIM_DMR1 (MCF_IPSBAR + 0x5c) /* Address mask 1 */ | |
1da177e4 LT |
62 | #endif |
63 | ||
babc08b7 GU |
64 | /* |
65 | * DMA unit base addresses. | |
66 | */ | |
67 | #define MCFDMA_BASE0 (MCF_IPSBAR + 0x100) | |
68 | #define MCFDMA_BASE1 (MCF_IPSBAR + 0x140) | |
69 | #define MCFDMA_BASE2 (MCF_IPSBAR + 0x180) | |
70 | #define MCFDMA_BASE3 (MCF_IPSBAR + 0x1C0) | |
71 | ||
57015421 GU |
72 | /* |
73 | * UART module. | |
74 | */ | |
9a6b0c73 GU |
75 | #define MCFUART_BASE1 (MCF_IPSBAR + 0x200) |
76 | #define MCFUART_BASE2 (MCF_IPSBAR + 0x240) | |
77 | #define MCFUART_BASE3 (MCF_IPSBAR + 0x280) | |
78 | ||
79 | /* | |
80 | * FEC ethernet module. | |
81 | */ | |
82 | #define MCFFEC_BASE0 (MCF_IPSBAR + 0x1000) | |
83 | #define MCFFEC_SIZE0 0x800 | |
84 | #define MCFFEC_BASE1 (MCF_IPSBAR + 0x1800) | |
85 | #define MCFFEC_SIZE1 0x800 | |
f1554da3 | 86 | |
87 | #ifdef CONFIG_M5271 | |
88 | #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000) | |
89 | #define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001) | |
90 | #define MCFGPIO_PODR_DATAL (MCF_IPSBAR + 0x100002) | |
91 | #define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100003) | |
92 | #define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100004) | |
93 | #define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100005) | |
94 | #define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x100006) | |
95 | #define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x100007) | |
96 | #define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100008) | |
97 | #define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100009) | |
98 | #define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000A) | |
99 | #define MCFGPIO_PODR_TIMER (MCF_IPSBAR + 0x10000B) | |
100 | ||
101 | #define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100010) | |
102 | #define MCFGPIO_PDDR_DATAH (MCF_IPSBAR + 0x100011) | |
103 | #define MCFGPIO_PDDR_DATAL (MCF_IPSBAR + 0x100012) | |
104 | #define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100013) | |
105 | #define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100014) | |
106 | #define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100015) | |
107 | #define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x100016) | |
108 | #define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100017) | |
109 | #define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100018) | |
110 | #define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x100019) | |
111 | #define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x10001A) | |
112 | #define MCFGPIO_PDDR_TIMER (MCF_IPSBAR + 0x10001B) | |
113 | ||
114 | #define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x100020) | |
115 | #define MCFGPIO_PPDSDR_DATAH (MCF_IPSBAR + 0x100021) | |
116 | #define MCFGPIO_PPDSDR_DATAL (MCF_IPSBAR + 0x100022) | |
117 | #define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x100023) | |
118 | #define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x100024) | |
119 | #define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100025) | |
120 | #define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100026) | |
121 | #define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100027) | |
122 | #define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100028) | |
123 | #define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100029) | |
124 | #define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x10002A) | |
125 | #define MCFGPIO_PPDSDR_TIMER (MCF_IPSBAR + 0x10002B) | |
126 | ||
127 | #define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100030) | |
128 | #define MCFGPIO_PCLRR_DATAH (MCF_IPSBAR + 0x100031) | |
129 | #define MCFGPIO_PCLRR_DATAL (MCF_IPSBAR + 0x100032) | |
130 | #define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100033) | |
131 | #define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100034) | |
132 | #define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x100035) | |
133 | #define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100036) | |
134 | #define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100037) | |
135 | #define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x100038) | |
136 | #define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100039) | |
137 | #define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x10003A) | |
138 | #define MCFGPIO_PCLRR_TIMER (MCF_IPSBAR + 0x10003B) | |
139 | ||
140 | /* | |
141 | * Generic GPIO support | |
142 | */ | |
143 | #define MCFGPIO_PODR MCFGPIO_PODR_ADDR | |
144 | #define MCFGPIO_PDDR MCFGPIO_PDDR_ADDR | |
145 | #define MCFGPIO_PPDR MCFGPIO_PPDSDR_ADDR | |
146 | #define MCFGPIO_SETR MCFGPIO_PPDSDR_ADDR | |
147 | #define MCFGPIO_CLRR MCFGPIO_PCLRR_ADDR | |
148 | ||
149 | #define MCFGPIO_PIN_MAX 100 | |
150 | #define MCFGPIO_IRQ_MAX 8 | |
151 | #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE | |
91d60417 SK |
152 | |
153 | #define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10004A) | |
154 | #define MCFGPIO_PAR_TIMER (MCF_IPSBAR + 0x10004C) | |
f1554da3 | 155 | #endif |
156 | ||
157 | #ifdef CONFIG_M5275 | |
158 | #define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004) | |
159 | #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100005) | |
160 | #define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100008) | |
161 | #define MCFGPIO_PODR_FEC0H (MCF_IPSBAR + 0x10000A) | |
162 | #define MCFGPIO_PODR_FEC0L (MCF_IPSBAR + 0x10000B) | |
163 | #define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x10000C) | |
164 | #define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000D) | |
165 | #define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x10000E) | |
166 | #define MCFGPIO_PODR_TIMERH (MCF_IPSBAR + 0x10000F) | |
167 | #define MCFGPIO_PODR_TIMERL (MCF_IPSBAR + 0x100010) | |
168 | #define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100011) | |
169 | #define MCFGPIO_PODR_FEC1H (MCF_IPSBAR + 0x100012) | |
170 | #define MCFGPIO_PODR_FEC1L (MCF_IPSBAR + 0x100013) | |
171 | #define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100014) | |
172 | #define MCFGPIO_PODR_IRQ (MCF_IPSBAR + 0x100015) | |
173 | #define MCFGPIO_PODR_USBH (MCF_IPSBAR + 0x100016) | |
174 | #define MCFGPIO_PODR_USBL (MCF_IPSBAR + 0x100017) | |
175 | #define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100018) | |
176 | ||
177 | #define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100020) | |
178 | #define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100021) | |
179 | #define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100024) | |
180 | #define MCFGPIO_PDDR_FEC0H (MCF_IPSBAR + 0x100026) | |
181 | #define MCFGPIO_PDDR_FEC0L (MCF_IPSBAR + 0x100027) | |
182 | #define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100028) | |
183 | #define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x100029) | |
184 | #define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x10002A) | |
185 | #define MCFGPIO_PDDR_TIMERH (MCF_IPSBAR + 0x10002B) | |
186 | #define MCFGPIO_PDDR_TIMERL (MCF_IPSBAR + 0x10002C) | |
187 | #define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x10002D) | |
188 | #define MCFGPIO_PDDR_FEC1H (MCF_IPSBAR + 0x10002E) | |
189 | #define MCFGPIO_PDDR_FEC1L (MCF_IPSBAR + 0x10002F) | |
190 | #define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100030) | |
191 | #define MCFGPIO_PDDR_IRQ (MCF_IPSBAR + 0x100031) | |
192 | #define MCFGPIO_PDDR_USBH (MCF_IPSBAR + 0x100032) | |
193 | #define MCFGPIO_PDDR_USBL (MCF_IPSBAR + 0x100033) | |
194 | #define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100034) | |
195 | ||
196 | #define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x10003C) | |
197 | #define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x10003D) | |
198 | #define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100040) | |
199 | #define MCFGPIO_PPDSDR_FEC0H (MCF_IPSBAR + 0x100042) | |
200 | #define MCFGPIO_PPDSDR_FEC0L (MCF_IPSBAR + 0x100043) | |
201 | #define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100044) | |
202 | #define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x100045) | |
203 | #define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100046) | |
204 | #define MCFGPIO_PPDSDR_TIMERH (MCF_IPSBAR + 0x100047) | |
205 | #define MCFGPIO_PPDSDR_TIMERL (MCF_IPSBAR + 0x100048) | |
206 | #define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100049) | |
207 | #define MCFGPIO_PPDSDR_FEC1H (MCF_IPSBAR + 0x10004A) | |
208 | #define MCFGPIO_PPDSDR_FEC1L (MCF_IPSBAR + 0x10004B) | |
209 | #define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x10004C) | |
210 | #define MCFGPIO_PPDSDR_IRQ (MCF_IPSBAR + 0x10004D) | |
211 | #define MCFGPIO_PPDSDR_USBH (MCF_IPSBAR + 0x10004E) | |
212 | #define MCFGPIO_PPDSDR_USBL (MCF_IPSBAR + 0x10004F) | |
213 | #define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100050) | |
214 | ||
215 | #define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100058) | |
216 | #define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100059) | |
217 | #define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x10005C) | |
218 | #define MCFGPIO_PCLRR_FEC0H (MCF_IPSBAR + 0x10005E) | |
219 | #define MCFGPIO_PCLRR_FEC0L (MCF_IPSBAR + 0x10005F) | |
220 | #define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100060) | |
221 | #define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x100061) | |
222 | #define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100062) | |
223 | #define MCFGPIO_PCLRR_TIMERH (MCF_IPSBAR + 0x100063) | |
224 | #define MCFGPIO_PCLRR_TIMERL (MCF_IPSBAR + 0x100064) | |
225 | #define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100065) | |
226 | #define MCFGPIO_PCLRR_FEC1H (MCF_IPSBAR + 0x100066) | |
227 | #define MCFGPIO_PCLRR_FEC1L (MCF_IPSBAR + 0x100067) | |
228 | #define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100068) | |
229 | #define MCFGPIO_PCLRR_IRQ (MCF_IPSBAR + 0x100069) | |
230 | #define MCFGPIO_PCLRR_USBH (MCF_IPSBAR + 0x10006A) | |
231 | #define MCFGPIO_PCLRR_USBL (MCF_IPSBAR + 0x10006B) | |
232 | #define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x10006C) | |
233 | ||
234 | ||
235 | /* | |
236 | * Generic GPIO support | |
237 | */ | |
238 | #define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL | |
239 | #define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL | |
240 | #define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL | |
241 | #define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL | |
242 | #define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL | |
243 | ||
244 | #define MCFGPIO_PIN_MAX 148 | |
245 | #define MCFGPIO_IRQ_MAX 8 | |
246 | #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE | |
91d60417 SK |
247 | |
248 | #define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10007E) | |
f1554da3 | 249 | #endif |
250 | ||
251 | /* | |
f317c71a | 252 | * PIT timer base addresses. |
f1554da3 | 253 | */ |
f317c71a GU |
254 | #define MCFPIT_BASE1 (MCF_IPSBAR + 0x150000) |
255 | #define MCFPIT_BASE2 (MCF_IPSBAR + 0x160000) | |
256 | #define MCFPIT_BASE3 (MCF_IPSBAR + 0x170000) | |
257 | #define MCFPIT_BASE4 (MCF_IPSBAR + 0x180000) | |
f1554da3 | 258 | |
f317c71a GU |
259 | /* |
260 | * EPort | |
261 | */ | |
57b48143 | 262 | #define MCFEPORT_EPPAR (MCF_IPSBAR + 0x130000) |
f1554da3 | 263 | #define MCFEPORT_EPDDR (MCF_IPSBAR + 0x130002) |
57b48143 | 264 | #define MCFEPORT_EPIER (MCF_IPSBAR + 0x130003) |
f1554da3 | 265 | #define MCFEPORT_EPDR (MCF_IPSBAR + 0x130004) |
266 | #define MCFEPORT_EPPDR (MCF_IPSBAR + 0x130005) | |
57b48143 | 267 | #define MCFEPORT_EPFR (MCF_IPSBAR + 0x130006) |
f1554da3 | 268 | |
d871629b GU |
269 | /* |
270 | * GPIO pins setups to enable the UARTs. | |
271 | */ | |
272 | #ifdef CONFIG_M5271 | |
273 | #define MCF_GPIO_PAR_UART 0x100048 /* PAR UART address */ | |
274 | #define UART0_ENABLE_MASK 0x000f | |
275 | #define UART1_ENABLE_MASK 0x0ff0 | |
276 | #define UART2_ENABLE_MASK 0x3000 | |
277 | #endif | |
278 | #ifdef CONFIG_M5275 | |
279 | #define MCF_GPIO_PAR_UART 0x10007c /* PAR UART address */ | |
280 | #define UART0_ENABLE_MASK 0x000f | |
281 | #define UART1_ENABLE_MASK 0x00f0 | |
282 | #define UART2_ENABLE_MASK 0x3f00 | |
283 | #endif | |
284 | ||
4c0b008d | 285 | /* |
25985edc | 286 | * Reset Control Unit (relative to IPSBAR). |
4c0b008d GU |
287 | */ |
288 | #define MCF_RCR 0x110000 | |
289 | #define MCF_RSR 0x110001 | |
290 | ||
291 | #define MCF_RCR_SWRESET 0x80 /* Software reset bit */ | |
292 | #define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ | |
293 | ||
1da177e4 LT |
294 | /****************************************************************************/ |
295 | #endif /* m527xsim_h */ |