1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 *	m5441xsim.h -- Coldfire 5441x register definitions
4 *
5 *	(C) Copyright 2012, Steven King <sfking@fdwdc.com>
6*/
7
8#ifndef m5441xsim_h
9#define m5441xsim_h
10
11#define CPU_NAME		"COLDFIRE(m5441x)"
12#define CPU_INSTR_PER_JIFFY	2
13#define MCF_BUSCLK		(MCF_CLK / 2)
14#define MACHINE			MACH_M5441X
15#define FPUTYPE			0
16#define IOMEMBASE		0xe0000000
17#define IOMEMSIZE		0x20000000
18
19#include <asm/m54xxacr.h>
20
21/*
22 *  Reset Controller Module.
23 */
24
25#define	MCF_RCR			0xec090000
26#define	MCF_RSR			0xec090001
27
28#define	MCF_RCR_SWRESET		0x80		/* Software reset bit */
29#define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */
30
31/*
32 *  Interrupt Controller Modules.
33 */
34/* the 5441x have 3 interrupt controllers, each control 64 interrupts */
35#define MCFINT_VECBASE		64
36#define MCFINT0_VECBASE		MCFINT_VECBASE
37#define MCFINT1_VECBASE		(MCFINT0_VECBASE + 64)
38#define MCFINT2_VECBASE		(MCFINT1_VECBASE + 64)
39
40/* interrupt controller 0 */
41#define MCFINTC0_SIMR		0xfc04801c
42#define MCFINTC0_CIMR		0xfc04801d
43#define	MCFINTC0_ICR0		0xfc048040
44/* interrupt controller 1 */
45#define MCFINTC1_SIMR		0xfc04c01c
46#define MCFINTC1_CIMR		0xfc04c01d
47#define	MCFINTC1_ICR0		0xfc04c040
48/* interrupt controller 2 */
49#define MCFINTC2_SIMR		0xfc05001c
50#define MCFINTC2_CIMR		0xfc05001d
51#define	MCFINTC2_ICR0		0xfc050040
52
53/* on interrupt controller 0 */
54#define MCFINT0_EPORT0		1
55#define MCFINT0_UART0		26
56#define MCFINT0_UART1		27
57#define MCFINT0_UART2		28
58#define MCFINT0_UART3		29
59#define MCFINT0_I2C0		30
60#define MCFINT0_DSPI0		31
61
62#define MCFINT0_TIMER0		32
63#define MCFINT0_TIMER1		33
64#define MCFINT0_TIMER2		34
65#define MCFINT0_TIMER3		35
66
67#define MCFINT0_FECRX0		36
68#define MCFINT0_FECTX0		40
69#define MCFINT0_FECENTC0	42
70
71#define MCFINT0_FECRX1		49
72#define MCFINT0_FECTX1		53
73#define MCFINT0_FECENTC1	55
74
75/* on interrupt controller 1 */
76#define MCFINT1_FLEXCAN0_IFL	0
77#define MCFINT1_FLEXCAN0_BOFF	1
78#define MCFINT1_FLEXCAN0_ERR	3
79#define MCFINT1_FLEXCAN1_IFL	4
80#define MCFINT1_FLEXCAN1_BOFF	5
81#define MCFINT1_FLEXCAN1_ERR	7
82#define MCFINT1_UART4		48
83#define MCFINT1_UART5		49
84#define MCFINT1_UART6		50
85#define MCFINT1_UART7		51
86#define MCFINT1_UART8		52
87#define MCFINT1_UART9		53
88#define MCFINT1_DSPI1		54
89#define MCFINT1_DSPI2		55
90#define MCFINT1_DSPI3		56
91#define MCFINT1_I2C1		57
92#define MCFINT1_I2C2		58
93#define MCFINT1_I2C3		59
94#define MCFINT1_I2C4		60
95#define MCFINT1_I2C5		61
96
97/* on interrupt controller 2 */
98#define MCFINT2_PIT0		13
99#define MCFINT2_PIT1		14
100#define MCFINT2_PIT2		15
101#define MCFINT2_PIT3		16
102#define MCFINT2_RTC		26
103
104/*
105 *  PIT timer module.
106 */
107#define	MCFPIT_BASE0		0xFC080000	/* Base address of TIMER0 */
108#define	MCFPIT_BASE1		0xFC084000	/* Base address of TIMER1 */
109#define	MCFPIT_BASE2		0xFC088000	/* Base address of TIMER2 */
110#define	MCFPIT_BASE3		0xFC08C000	/* Base address of TIMER3 */
111
112
113#define MCF_IRQ_PIT1		(MCFINT2_VECBASE + MCFINT2_PIT1)
114
115/*
116 * Power Management
117 */
118#define MCFPM_WCR		0xfc040013
119#define MCFPM_PPMSR0		0xfc04002c
120#define MCFPM_PPMCR0		0xfc04002d
121#define MCFPM_PPMSR1		0xfc04002e
122#define MCFPM_PPMCR1		0xfc04002f
123#define MCFPM_PPMHR0		0xfc040030
124#define MCFPM_PPMLR0		0xfc040034
125#define MCFPM_PPMHR1		0xfc040038
126#define MCFPM_PPMLR1		0xfc04003c
127#define MCFPM_LPCR		0xec090007
128/*
129 *  UART module.
130 */
131#define MCFUART_BASE0		0xfc060000	/* Base address of UART0 */
132#define MCFUART_BASE1		0xfc064000	/* Base address of UART1 */
133#define MCFUART_BASE2		0xfc068000	/* Base address of UART2 */
134#define MCFUART_BASE3		0xfc06c000	/* Base address of UART3 */
135#define MCFUART_BASE4		0xec060000	/* Base address of UART4 */
136#define MCFUART_BASE5		0xec064000	/* Base address of UART5 */
137#define MCFUART_BASE6		0xec068000	/* Base address of UART6 */
138#define MCFUART_BASE7		0xec06c000	/* Base address of UART7 */
139#define MCFUART_BASE8		0xec070000	/* Base address of UART8 */
140#define MCFUART_BASE9		0xec074000	/* Base address of UART9 */
141
142#define MCF_IRQ_UART0		(MCFINT0_VECBASE + MCFINT0_UART0)
143#define MCF_IRQ_UART1		(MCFINT0_VECBASE + MCFINT0_UART1)
144#define MCF_IRQ_UART2		(MCFINT0_VECBASE + MCFINT0_UART2)
145#define MCF_IRQ_UART3		(MCFINT0_VECBASE + MCFINT0_UART3)
146#define MCF_IRQ_UART4		(MCFINT1_VECBASE + MCFINT1_UART4)
147#define MCF_IRQ_UART5		(MCFINT1_VECBASE + MCFINT1_UART5)
148#define MCF_IRQ_UART6		(MCFINT1_VECBASE + MCFINT1_UART6)
149#define MCF_IRQ_UART7		(MCFINT1_VECBASE + MCFINT1_UART7)
150#define MCF_IRQ_UART8		(MCFINT1_VECBASE + MCFINT1_UART8)
151#define MCF_IRQ_UART9		(MCFINT1_VECBASE + MCFINT1_UART9)
152/*
153 *  FEC modules.
154 */
155#define MCFFEC_BASE0		0xfc0d4000
156#define MCFFEC_SIZE0		0x800
157#define MCF_IRQ_FECRX0		(MCFINT0_VECBASE + MCFINT0_FECRX0)
158#define MCF_IRQ_FECTX0		(MCFINT0_VECBASE + MCFINT0_FECTX0)
159#define MCF_IRQ_FECENTC0	(MCFINT0_VECBASE + MCFINT0_FECENTC0)
160
161#define MCFFEC_BASE1		0xfc0d8000
162#define MCFFEC_SIZE1		0x800
163#define MCF_IRQ_FECRX1		(MCFINT0_VECBASE + MCFINT0_FECRX1)
164#define MCF_IRQ_FECTX1		(MCFINT0_VECBASE + MCFINT0_FECTX1)
165#define MCF_IRQ_FECENTC1	(MCFINT0_VECBASE + MCFINT0_FECENTC1)
166/*
167 *  I2C modules.
168 */
169#define MCFI2C_BASE0		0xfc058000
170#define MCFI2C_SIZE0		0x20
171#define MCFI2C_BASE1		0xfc038000
172#define MCFI2C_SIZE1		0x20
173#define MCFI2C_BASE2		0xec010000
174#define MCFI2C_SIZE2		0x20
175#define MCFI2C_BASE3		0xec014000
176#define MCFI2C_SIZE3		0x20
177#define MCFI2C_BASE4		0xec018000
178#define MCFI2C_SIZE4		0x20
179#define MCFI2C_BASE5		0xec01c000
180#define MCFI2C_SIZE5		0x20
181
182#define MCF_IRQ_I2C0		(MCFINT0_VECBASE + MCFINT0_I2C0)
183#define MCF_IRQ_I2C1		(MCFINT1_VECBASE + MCFINT1_I2C1)
184#define MCF_IRQ_I2C2		(MCFINT1_VECBASE + MCFINT1_I2C2)
185#define MCF_IRQ_I2C3		(MCFINT1_VECBASE + MCFINT1_I2C3)
186#define MCF_IRQ_I2C4		(MCFINT1_VECBASE + MCFINT1_I2C4)
187#define MCF_IRQ_I2C5		(MCFINT1_VECBASE + MCFINT1_I2C5)
188/*
189 *  EPORT Module.
190 */
191#define MCFEPORT_EPPAR		0xfc090000
192#define MCFEPORT_EPIER		0xfc090003
193#define MCFEPORT_EPFR		0xfc090006
194/*
195 *  RTC Module.
196 */
197#define MCFRTC_BASE		0xfc0a8000
198#define MCFRTC_SIZE		(0xfc0a8840 - 0xfc0a8000)
199#define MCF_IRQ_RTC		(MCFINT2_VECBASE + MCFINT2_RTC)
200
201/*
202 *  GPIO Module.
203 */
204#define MCFGPIO_PODR_A		0xec094000
205#define MCFGPIO_PODR_B		0xec094001
206#define MCFGPIO_PODR_C		0xec094002
207#define MCFGPIO_PODR_D		0xec094003
208#define MCFGPIO_PODR_E		0xec094004
209#define MCFGPIO_PODR_F		0xec094005
210#define MCFGPIO_PODR_G		0xec094006
211#define MCFGPIO_PODR_H		0xec094007
212#define MCFGPIO_PODR_I		0xec094008
213#define MCFGPIO_PODR_J		0xec094009
214#define MCFGPIO_PODR_K		0xec09400a
215
216#define MCFGPIO_PDDR_A		0xec09400c
217#define MCFGPIO_PDDR_B		0xec09400d
218#define MCFGPIO_PDDR_C		0xec09400e
219#define MCFGPIO_PDDR_D		0xec09400f
220#define MCFGPIO_PDDR_E		0xec094010
221#define MCFGPIO_PDDR_F		0xec094011
222#define MCFGPIO_PDDR_G		0xec094012
223#define MCFGPIO_PDDR_H		0xec094013
224#define MCFGPIO_PDDR_I		0xec094014
225#define MCFGPIO_PDDR_J		0xec094015
226#define MCFGPIO_PDDR_K		0xec094016
227
228#define MCFGPIO_PPDSDR_A	0xec094018
229#define MCFGPIO_PPDSDR_B	0xec094019
230#define MCFGPIO_PPDSDR_C	0xec09401a
231#define MCFGPIO_PPDSDR_D	0xec09401b
232#define MCFGPIO_PPDSDR_E	0xec09401c
233#define MCFGPIO_PPDSDR_F	0xec09401d
234#define MCFGPIO_PPDSDR_G	0xec09401e
235#define MCFGPIO_PPDSDR_H	0xec09401f
236#define MCFGPIO_PPDSDR_I	0xec094020
237#define MCFGPIO_PPDSDR_J	0xec094021
238#define MCFGPIO_PPDSDR_K	0xec094022
239
240#define MCFGPIO_PCLRR_A		0xec094024
241#define MCFGPIO_PCLRR_B		0xec094025
242#define MCFGPIO_PCLRR_C		0xec094026
243#define MCFGPIO_PCLRR_D		0xec094027
244#define MCFGPIO_PCLRR_E		0xec094028
245#define MCFGPIO_PCLRR_F		0xec094029
246#define MCFGPIO_PCLRR_G		0xec09402a
247#define MCFGPIO_PCLRR_H		0xec09402b
248#define MCFGPIO_PCLRR_I		0xec09402c
249#define MCFGPIO_PCLRR_J		0xec09402d
250#define MCFGPIO_PCLRR_K		0xec09402e
251
252#define MCFGPIO_PAR_FBCTL	0xec094048
253#define MCFGPIO_PAR_BE		0xec094049
254#define MCFGPIO_PAR_CS		0xec09404a
255#define MCFGPIO_PAR_CANI2C	0xec09404b
256#define MCFGPIO_PAR_IRQ0H	0xec09404c
257#define MCFGPIO_PAR_IRQ0L	0xec09404d
258#define MCFGPIO_PAR_DSPIOWH	0xec09404e
259#define MCFGPIO_PAR_DSPIOWL	0xec09404f
260#define MCFGPIO_PAR_TIMER	0xec094050
261#define MCFGPIO_PAR_UART2	0xec094051
262#define MCFGPIO_PAR_UART1	0xec094052
263#define MCFGPIO_PAR_UART0	0xec094053
264#define MCFGPIO_PAR_SDHCH	0xec094054
265#define MCFGPIO_PAR_SDHCL	0xec094055
266#define MCFGPIO_PAR_SIMP0H	0xec094056
267#define MCFGPIO_PAR_SIMP0L	0xec094057
268#define MCFGPIO_PAR_SSI0H	0xec094058
269#define MCFGPIO_PAR_SSI0L	0xec094059
270#define MCFGPIO_PAR_DEBUGH1	0xec09405a
271#define MCFGPIO_PAR_DEBUGH0	0xec09405b
272#define MCFGPIO_PAR_DEBUGl	0xec09405c
273#define MCFGPIO_PAR_FEC		0xec09405e
274
275/* generalization for generic gpio support */
276#define MCFGPIO_PODR		MCFGPIO_PODR_A
277#define MCFGPIO_PDDR		MCFGPIO_PDDR_A
278#define MCFGPIO_PPDR		MCFGPIO_PPDSDR_A
279#define MCFGPIO_SETR		MCFGPIO_PPDSDR_A
280#define MCFGPIO_CLRR		MCFGPIO_PCLRR_A
281
282#define MCFGPIO_IRQ_MIN		17
283#define MCFGPIO_IRQ_MAX		24
284#define MCFGPIO_IRQ_VECBASE	(MCFINT_VECBASE - MCFGPIO_IRQ_MIN)
285#define MCFGPIO_PIN_MAX		87
286
287/*
288 * Phase Locked Loop (PLL)
289 */
290#define MCF_PLL_CR		0xFC0C0000
291#define MCF_PLL_DR		0xFC0C0004
292#define MCF_PLL_SR		0xFC0C0008
293
294/*
295 *  DSPI module.
296 */
297#define MCFDSPI_BASE0		0xfc05c000
298#define MCFDSPI_BASE1		0xfC03c000
299#define MCF_IRQ_DSPI0		(MCFINT0_VECBASE + MCFINT0_DSPI0)
300#define MCF_IRQ_DSPI1		(MCFINT1_VECBASE + MCFINT1_DSPI1)
301/*
302 *  eDMA module.
303 */
304#define MCFEDMA_BASE		0xfc044000
305#define MCFEDMA_SIZE		0x4000
306#define MCFINT0_EDMA_INTR0	8
307#define MCFINT0_EDMA_ERR	24
308#define MCFEDMA_EDMA_INTR16	8
309#define MCFEDMA_EDMA_INTR56	0
310#define MCFEDMA_IRQ_INTR0	(MCFINT0_VECBASE + MCFINT0_EDMA_INTR0)
311#define MCFEDMA_IRQ_INTR16	(MCFINT1_VECBASE + MCFEDMA_EDMA_INTR16)
312#define MCFEDMA_IRQ_INTR56	(MCFINT2_VECBASE + MCFEDMA_EDMA_INTR56)
313#define MCFEDMA_IRQ_ERR	(MCFINT0_VECBASE + MCFINT0_EDMA_ERR)
314/*
315 *  esdhc module.
316 */
317#define MCFSDHC_BASE		0xfc0cc000
318#define MCFSDHC_SIZE		256
319#define MCFINT2_SDHC		31
320#define MCF_IRQ_SDHC		(MCFINT2_VECBASE + MCFINT2_SDHC)
321#define MCFSDHC_CLK		(MCFSDHC_BASE + 0x2c)
322
323/*
324 * Flexcan module
325 */
326#define MCFFLEXCAN_BASE0	0xfc020000
327#define MCFFLEXCAN_BASE1	0xfc024000
328#define MCFFLEXCAN_SIZE		0x4000
329#define MCF_IRQ_IFL0		(MCFINT1_VECBASE + MCFINT1_FLEXCAN0_IFL)
330#define MCF_IRQ_BOFF0		(MCFINT1_VECBASE + MCFINT1_FLEXCAN0_BOFF)
331#define MCF_IRQ_ERR0		(MCFINT1_VECBASE + MCFINT1_FLEXCAN0_ERR)
332#define MCF_IRQ_IFL1		(MCFINT1_VECBASE + MCFINT1_FLEXCAN1_IFL)
333#define MCF_IRQ_BOFF1		(MCFINT1_VECBASE + MCFINT1_FLEXCAN1_BOFF)
334#define MCF_IRQ_ERR1		(MCFINT1_VECBASE + MCFINT1_FLEXCAN1_ERR)
335
336#endif /* m5441xsim_h */
337