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