blob: 8a5a1ab57d018855257a39554139d38b8c0d832c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/****************************************************************************/
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
Greg Ungerer733f31b2010-11-02 17:40:37 +100014#define CPU_NAME "COLDFIRE(m527x)"
15#define CPU_INSTR_PER_JIFFY 3
Greg Ungerer7fc82b62010-11-02 17:13:27 +100016
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18/*
19 * Define the 5270/5271 SIM register set addresses.
20 */
21#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
22#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 1 */
23#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
24#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
25#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
26#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
27#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
28#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
29#define MCFINTC_IRLR 0x18 /* */
30#define MCFINTC_IACKL 0x19 /* */
31#define MCFINTC_ICR0 0x40 /* Base ICR register */
32
33#define MCFINT_VECBASE 64 /* Vector base number */
34#define MCFINT_UART0 13 /* Interrupt number for UART0 */
35#define MCFINT_UART1 14 /* Interrupt number for UART1 */
36#define MCFINT_UART2 15 /* Interrupt number for UART2 */
Steven King91d60412010-01-22 12:43:03 -080037#define MCFINT_QSPI 18 /* Interrupt number for QSPI */
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#define MCFINT_PIT1 36 /* Interrupt number for PIT1 */
39
40/*
41 * SDRAM configuration registers.
42 */
Greg Ungererd8716292005-09-12 11:18:10 +100043#ifdef CONFIG_M5271
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#define MCFSIM_DCR 0x40 /* SDRAM control */
45#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
46#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
47#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
48#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
Greg Ungererd8716292005-09-12 11:18:10 +100049#endif
50#ifdef CONFIG_M5275
Linus Torvalds1da177e2005-04-16 15:20:36 -070051#define MCFSIM_DMR 0x40 /* SDRAM mode */
52#define MCFSIM_DCR 0x44 /* SDRAM control */
53#define MCFSIM_DCFG1 0x48 /* SDRAM configuration 1 */
54#define MCFSIM_DCFG2 0x4c /* SDRAM configuration 2 */
55#define MCFSIM_DBAR0 0x50 /* SDRAM base address 0 */
56#define MCFSIM_DMR0 0x54 /* SDRAM address mask 0 */
57#define MCFSIM_DBAR1 0x58 /* SDRAM base address 1 */
58#define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */
59#endif
60
Greg Ungerer57015422010-11-03 12:50:30 +100061/*
62 * UART module.
63 */
64#define MCFUART_BASE1 0x200 /* Base address of UART1 */
65#define MCFUART_BASE2 0x240 /* Base address of UART2 */
66#define MCFUART_BASE3 0x280 /* Base address of UART3 */
sfking@fdwdc.comf1554da2009-06-19 18:11:06 -070067
68#ifdef CONFIG_M5271
69#define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000)
70#define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001)
71#define MCFGPIO_PODR_DATAL (MCF_IPSBAR + 0x100002)
72#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100003)
73#define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100004)
74#define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100005)
75#define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x100006)
76#define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x100007)
77#define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100008)
78#define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100009)
79#define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000A)
80#define MCFGPIO_PODR_TIMER (MCF_IPSBAR + 0x10000B)
81
82#define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100010)
83#define MCFGPIO_PDDR_DATAH (MCF_IPSBAR + 0x100011)
84#define MCFGPIO_PDDR_DATAL (MCF_IPSBAR + 0x100012)
85#define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100013)
86#define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100014)
87#define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100015)
88#define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x100016)
89#define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100017)
90#define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100018)
91#define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x100019)
92#define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x10001A)
93#define MCFGPIO_PDDR_TIMER (MCF_IPSBAR + 0x10001B)
94
95#define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x100020)
96#define MCFGPIO_PPDSDR_DATAH (MCF_IPSBAR + 0x100021)
97#define MCFGPIO_PPDSDR_DATAL (MCF_IPSBAR + 0x100022)
98#define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x100023)
99#define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x100024)
100#define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100025)
101#define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100026)
102#define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100027)
103#define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100028)
104#define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100029)
105#define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x10002A)
106#define MCFGPIO_PPDSDR_TIMER (MCF_IPSBAR + 0x10002B)
107
108#define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100030)
109#define MCFGPIO_PCLRR_DATAH (MCF_IPSBAR + 0x100031)
110#define MCFGPIO_PCLRR_DATAL (MCF_IPSBAR + 0x100032)
111#define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100033)
112#define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100034)
113#define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x100035)
114#define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100036)
115#define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100037)
116#define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x100038)
117#define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100039)
118#define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x10003A)
119#define MCFGPIO_PCLRR_TIMER (MCF_IPSBAR + 0x10003B)
120
121/*
122 * Generic GPIO support
123 */
124#define MCFGPIO_PODR MCFGPIO_PODR_ADDR
125#define MCFGPIO_PDDR MCFGPIO_PDDR_ADDR
126#define MCFGPIO_PPDR MCFGPIO_PPDSDR_ADDR
127#define MCFGPIO_SETR MCFGPIO_PPDSDR_ADDR
128#define MCFGPIO_CLRR MCFGPIO_PCLRR_ADDR
129
130#define MCFGPIO_PIN_MAX 100
131#define MCFGPIO_IRQ_MAX 8
132#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
Steven King91d60412010-01-22 12:43:03 -0800133
134#define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10004A)
135#define MCFGPIO_PAR_TIMER (MCF_IPSBAR + 0x10004C)
sfking@fdwdc.comf1554da2009-06-19 18:11:06 -0700136#endif
137
138#ifdef CONFIG_M5275
139#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004)
140#define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100005)
141#define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100008)
142#define MCFGPIO_PODR_FEC0H (MCF_IPSBAR + 0x10000A)
143#define MCFGPIO_PODR_FEC0L (MCF_IPSBAR + 0x10000B)
144#define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x10000C)
145#define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000D)
146#define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x10000E)
147#define MCFGPIO_PODR_TIMERH (MCF_IPSBAR + 0x10000F)
148#define MCFGPIO_PODR_TIMERL (MCF_IPSBAR + 0x100010)
149#define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100011)
150#define MCFGPIO_PODR_FEC1H (MCF_IPSBAR + 0x100012)
151#define MCFGPIO_PODR_FEC1L (MCF_IPSBAR + 0x100013)
152#define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100014)
153#define MCFGPIO_PODR_IRQ (MCF_IPSBAR + 0x100015)
154#define MCFGPIO_PODR_USBH (MCF_IPSBAR + 0x100016)
155#define MCFGPIO_PODR_USBL (MCF_IPSBAR + 0x100017)
156#define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100018)
157
158#define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100020)
159#define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100021)
160#define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100024)
161#define MCFGPIO_PDDR_FEC0H (MCF_IPSBAR + 0x100026)
162#define MCFGPIO_PDDR_FEC0L (MCF_IPSBAR + 0x100027)
163#define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100028)
164#define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x100029)
165#define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x10002A)
166#define MCFGPIO_PDDR_TIMERH (MCF_IPSBAR + 0x10002B)
167#define MCFGPIO_PDDR_TIMERL (MCF_IPSBAR + 0x10002C)
168#define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x10002D)
169#define MCFGPIO_PDDR_FEC1H (MCF_IPSBAR + 0x10002E)
170#define MCFGPIO_PDDR_FEC1L (MCF_IPSBAR + 0x10002F)
171#define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100030)
172#define MCFGPIO_PDDR_IRQ (MCF_IPSBAR + 0x100031)
173#define MCFGPIO_PDDR_USBH (MCF_IPSBAR + 0x100032)
174#define MCFGPIO_PDDR_USBL (MCF_IPSBAR + 0x100033)
175#define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100034)
176
177#define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x10003C)
178#define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x10003D)
179#define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100040)
180#define MCFGPIO_PPDSDR_FEC0H (MCF_IPSBAR + 0x100042)
181#define MCFGPIO_PPDSDR_FEC0L (MCF_IPSBAR + 0x100043)
182#define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100044)
183#define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x100045)
184#define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100046)
185#define MCFGPIO_PPDSDR_TIMERH (MCF_IPSBAR + 0x100047)
186#define MCFGPIO_PPDSDR_TIMERL (MCF_IPSBAR + 0x100048)
187#define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100049)
188#define MCFGPIO_PPDSDR_FEC1H (MCF_IPSBAR + 0x10004A)
189#define MCFGPIO_PPDSDR_FEC1L (MCF_IPSBAR + 0x10004B)
190#define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x10004C)
191#define MCFGPIO_PPDSDR_IRQ (MCF_IPSBAR + 0x10004D)
192#define MCFGPIO_PPDSDR_USBH (MCF_IPSBAR + 0x10004E)
193#define MCFGPIO_PPDSDR_USBL (MCF_IPSBAR + 0x10004F)
194#define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100050)
195
196#define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100058)
197#define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100059)
198#define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x10005C)
199#define MCFGPIO_PCLRR_FEC0H (MCF_IPSBAR + 0x10005E)
200#define MCFGPIO_PCLRR_FEC0L (MCF_IPSBAR + 0x10005F)
201#define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100060)
202#define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x100061)
203#define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100062)
204#define MCFGPIO_PCLRR_TIMERH (MCF_IPSBAR + 0x100063)
205#define MCFGPIO_PCLRR_TIMERL (MCF_IPSBAR + 0x100064)
206#define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100065)
207#define MCFGPIO_PCLRR_FEC1H (MCF_IPSBAR + 0x100066)
208#define MCFGPIO_PCLRR_FEC1L (MCF_IPSBAR + 0x100067)
209#define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100068)
210#define MCFGPIO_PCLRR_IRQ (MCF_IPSBAR + 0x100069)
211#define MCFGPIO_PCLRR_USBH (MCF_IPSBAR + 0x10006A)
212#define MCFGPIO_PCLRR_USBL (MCF_IPSBAR + 0x10006B)
213#define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x10006C)
214
215
216/*
217 * Generic GPIO support
218 */
219#define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL
220#define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL
221#define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL
222#define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL
223#define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL
224
225#define MCFGPIO_PIN_MAX 148
226#define MCFGPIO_IRQ_MAX 8
227#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
Steven King91d60412010-01-22 12:43:03 -0800228
229#define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10007E)
sfking@fdwdc.comf1554da2009-06-19 18:11:06 -0700230#endif
231
232/*
233 * EPort
234 */
235
236#define MCFEPORT_EPDDR (MCF_IPSBAR + 0x130002)
237#define MCFEPORT_EPDR (MCF_IPSBAR + 0x130004)
238#define MCFEPORT_EPPDR (MCF_IPSBAR + 0x130005)
239
240
Steven King91d60412010-01-22 12:43:03 -0800241
Greg Ungererd8716292005-09-12 11:18:10 +1000242/*
243 * GPIO pins setups to enable the UARTs.
244 */
245#ifdef CONFIG_M5271
246#define MCF_GPIO_PAR_UART 0x100048 /* PAR UART address */
247#define UART0_ENABLE_MASK 0x000f
248#define UART1_ENABLE_MASK 0x0ff0
249#define UART2_ENABLE_MASK 0x3000
250#endif
251#ifdef CONFIG_M5275
252#define MCF_GPIO_PAR_UART 0x10007c /* PAR UART address */
253#define UART0_ENABLE_MASK 0x000f
254#define UART1_ENABLE_MASK 0x00f0
255#define UART2_ENABLE_MASK 0x3f00
256#endif
257
Greg Ungerer4c0b0082009-04-30 23:06:45 +1000258/*
259 * Reset Controll Unit (relative to IPSBAR).
260 */
261#define MCF_RCR 0x110000
262#define MCF_RSR 0x110001
263
264#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
265#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
266
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267/****************************************************************************/
268#endif /* m527xsim_h */