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