162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/****************************************************************************/
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci/*
562306a36Sopenharmony_ci *  m520xsim.h -- ColdFire 5207/5208 System Integration Module support.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci *  (C) Copyright 2005, Intec Automation (mike@steroidmicros.com)
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci/****************************************************************************/
1162306a36Sopenharmony_ci#ifndef m520xsim_h
1262306a36Sopenharmony_ci#define m520xsim_h
1362306a36Sopenharmony_ci/****************************************************************************/
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#define	CPU_NAME		"COLDFIRE(m520x)"
1662306a36Sopenharmony_ci#define	CPU_INSTR_PER_JIFFY	3
1762306a36Sopenharmony_ci#define	MCF_BUSCLK		(MCF_CLK / 2)
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#include <asm/m52xxacr.h>
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/*
2262306a36Sopenharmony_ci *  Define the 520x SIM register set addresses.
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci#define MCFICM_INTC0        0xFC048000  /* Base for Interrupt Ctrl 0 */
2562306a36Sopenharmony_ci#define MCFINTC_IPRH        0x00        /* Interrupt pending 32-63 */
2662306a36Sopenharmony_ci#define MCFINTC_IPRL        0x04        /* Interrupt pending 1-31 */
2762306a36Sopenharmony_ci#define MCFINTC_IMRH        0x08        /* Interrupt mask 32-63 */
2862306a36Sopenharmony_ci#define MCFINTC_IMRL        0x0c        /* Interrupt mask 1-31 */
2962306a36Sopenharmony_ci#define MCFINTC_INTFRCH     0x10        /* Interrupt force 32-63 */
3062306a36Sopenharmony_ci#define MCFINTC_INTFRCL     0x14        /* Interrupt force 1-31 */
3162306a36Sopenharmony_ci#define MCFINTC_SIMR        0x1c        /* Set interrupt mask 0-63 */
3262306a36Sopenharmony_ci#define MCFINTC_CIMR        0x1d        /* Clear interrupt mask 0-63 */
3362306a36Sopenharmony_ci#define MCFINTC_ICR0        0x40        /* Base ICR register */
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci/*
3662306a36Sopenharmony_ci *  The common interrupt controller code just wants to know the absolute
3762306a36Sopenharmony_ci *  address to the SIMR and CIMR registers (not offsets into IPSBAR).
3862306a36Sopenharmony_ci *  The 520x family only has a single INTC unit.
3962306a36Sopenharmony_ci */
4062306a36Sopenharmony_ci#define MCFINTC0_SIMR       (MCFICM_INTC0 + MCFINTC_SIMR)
4162306a36Sopenharmony_ci#define MCFINTC0_CIMR       (MCFICM_INTC0 + MCFINTC_CIMR)
4262306a36Sopenharmony_ci#define	MCFINTC0_ICR0       (MCFICM_INTC0 + MCFINTC_ICR0)
4362306a36Sopenharmony_ci#define MCFINTC1_SIMR       (0)
4462306a36Sopenharmony_ci#define MCFINTC1_CIMR       (0)
4562306a36Sopenharmony_ci#define	MCFINTC1_ICR0       (0)
4662306a36Sopenharmony_ci#define MCFINTC2_SIMR       (0)
4762306a36Sopenharmony_ci#define MCFINTC2_CIMR       (0)
4862306a36Sopenharmony_ci#define MCFINTC2_ICR0       (0)
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci#define MCFINT_VECBASE      64
5162306a36Sopenharmony_ci#define MCFINT_UART0        26          /* Interrupt number for UART0 */
5262306a36Sopenharmony_ci#define MCFINT_UART1        27          /* Interrupt number for UART1 */
5362306a36Sopenharmony_ci#define MCFINT_UART2        28          /* Interrupt number for UART2 */
5462306a36Sopenharmony_ci#define MCFINT_I2C0         30          /* Interrupt number for I2C */
5562306a36Sopenharmony_ci#define MCFINT_QSPI         31          /* Interrupt number for QSPI */
5662306a36Sopenharmony_ci#define MCFINT_FECRX0	    36		/* Interrupt number for FEC RX */
5762306a36Sopenharmony_ci#define MCFINT_FECTX0	    40		/* Interrupt number for FEC RX */
5862306a36Sopenharmony_ci#define MCFINT_FECENTC0	    42		/* Interrupt number for FEC RX */
5962306a36Sopenharmony_ci#define MCFINT_PIT1         4           /* Interrupt number for PIT1 (PIT0 in processor) */
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#define MCF_IRQ_UART0	    (MCFINT_VECBASE + MCFINT_UART0)
6262306a36Sopenharmony_ci#define MCF_IRQ_UART1	    (MCFINT_VECBASE + MCFINT_UART1)
6362306a36Sopenharmony_ci#define MCF_IRQ_UART2	    (MCFINT_VECBASE + MCFINT_UART2)
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci#define MCF_IRQ_FECRX0	    (MCFINT_VECBASE + MCFINT_FECRX0)
6662306a36Sopenharmony_ci#define MCF_IRQ_FECTX0	    (MCFINT_VECBASE + MCFINT_FECTX0)
6762306a36Sopenharmony_ci#define MCF_IRQ_FECENTC0    (MCFINT_VECBASE + MCFINT_FECENTC0)
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define	MCF_IRQ_QSPI	    (MCFINT_VECBASE + MCFINT_QSPI)
7062306a36Sopenharmony_ci#define MCF_IRQ_PIT1        (MCFINT_VECBASE + MCFINT_PIT1)
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#define MCF_IRQ_I2C0        (MCFINT_VECBASE + MCFINT_I2C0)
7362306a36Sopenharmony_ci/*
7462306a36Sopenharmony_ci *  SDRAM configuration registers.
7562306a36Sopenharmony_ci */
7662306a36Sopenharmony_ci#define MCFSIM_SDMR         0xFC0a8000	/* SDRAM Mode/Extended Mode Register */
7762306a36Sopenharmony_ci#define MCFSIM_SDCR         0xFC0a8004	/* SDRAM Control Register */
7862306a36Sopenharmony_ci#define MCFSIM_SDCFG1       0xFC0a8008	/* SDRAM Configuration Register 1 */
7962306a36Sopenharmony_ci#define MCFSIM_SDCFG2       0xFC0a800c	/* SDRAM Configuration Register 2 */
8062306a36Sopenharmony_ci#define MCFSIM_SDCS0        0xFC0a8110	/* SDRAM Chip Select 0 Configuration */
8162306a36Sopenharmony_ci#define MCFSIM_SDCS1        0xFC0a8114	/* SDRAM Chip Select 1 Configuration */
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci/*
8462306a36Sopenharmony_ci * EPORT and GPIO registers.
8562306a36Sopenharmony_ci */
8662306a36Sopenharmony_ci#define MCFEPORT_EPPAR			0xFC088000
8762306a36Sopenharmony_ci#define MCFEPORT_EPDDR			0xFC088002
8862306a36Sopenharmony_ci#define MCFEPORT_EPIER			0xFC088003
8962306a36Sopenharmony_ci#define MCFEPORT_EPDR			0xFC088004
9062306a36Sopenharmony_ci#define MCFEPORT_EPPDR			0xFC088005
9162306a36Sopenharmony_ci#define MCFEPORT_EPFR			0xFC088006
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci#define MCFGPIO_PODR_BUSCTL		0xFC0A4000
9462306a36Sopenharmony_ci#define MCFGPIO_PODR_BE			0xFC0A4001
9562306a36Sopenharmony_ci#define MCFGPIO_PODR_CS			0xFC0A4002
9662306a36Sopenharmony_ci#define MCFGPIO_PODR_FECI2C		0xFC0A4003
9762306a36Sopenharmony_ci#define MCFGPIO_PODR_QSPI		0xFC0A4004
9862306a36Sopenharmony_ci#define MCFGPIO_PODR_TIMER		0xFC0A4005
9962306a36Sopenharmony_ci#define MCFGPIO_PODR_UART		0xFC0A4006
10062306a36Sopenharmony_ci#define MCFGPIO_PODR_FECH		0xFC0A4007
10162306a36Sopenharmony_ci#define MCFGPIO_PODR_FECL		0xFC0A4008
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci#define MCFGPIO_PDDR_BUSCTL		0xFC0A400C
10462306a36Sopenharmony_ci#define MCFGPIO_PDDR_BE			0xFC0A400D
10562306a36Sopenharmony_ci#define MCFGPIO_PDDR_CS			0xFC0A400E
10662306a36Sopenharmony_ci#define MCFGPIO_PDDR_FECI2C		0xFC0A400F
10762306a36Sopenharmony_ci#define MCFGPIO_PDDR_QSPI		0xFC0A4010
10862306a36Sopenharmony_ci#define MCFGPIO_PDDR_TIMER		0xFC0A4011
10962306a36Sopenharmony_ci#define MCFGPIO_PDDR_UART		0xFC0A4012
11062306a36Sopenharmony_ci#define MCFGPIO_PDDR_FECH		0xFC0A4013
11162306a36Sopenharmony_ci#define MCFGPIO_PDDR_FECL		0xFC0A4014
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_CS		0xFC0A401A
11462306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_FECI2C		0xFC0A401B
11562306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_QSPI		0xFC0A401C
11662306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_TIMER		0xFC0A401D
11762306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_UART		0xFC0A401E
11862306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_FECH		0xFC0A401F
11962306a36Sopenharmony_ci#define MCFGPIO_PPDSDR_FECL		0xFC0A4020
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci#define MCFGPIO_PCLRR_BUSCTL		0xFC0A4024
12262306a36Sopenharmony_ci#define MCFGPIO_PCLRR_BE		0xFC0A4025
12362306a36Sopenharmony_ci#define MCFGPIO_PCLRR_CS		0xFC0A4026
12462306a36Sopenharmony_ci#define MCFGPIO_PCLRR_FECI2C		0xFC0A4027
12562306a36Sopenharmony_ci#define MCFGPIO_PCLRR_QSPI		0xFC0A4028
12662306a36Sopenharmony_ci#define MCFGPIO_PCLRR_TIMER		0xFC0A4029
12762306a36Sopenharmony_ci#define MCFGPIO_PCLRR_UART		0xFC0A402A
12862306a36Sopenharmony_ci#define MCFGPIO_PCLRR_FECH		0xFC0A402B
12962306a36Sopenharmony_ci#define MCFGPIO_PCLRR_FECL		0xFC0A402C
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci/*
13262306a36Sopenharmony_ci * Generic GPIO support
13362306a36Sopenharmony_ci */
13462306a36Sopenharmony_ci#define MCFGPIO_PODR			MCFGPIO_PODR_CS
13562306a36Sopenharmony_ci#define MCFGPIO_PDDR			MCFGPIO_PDDR_CS
13662306a36Sopenharmony_ci#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_CS
13762306a36Sopenharmony_ci#define MCFGPIO_SETR			MCFGPIO_PPDSDR_CS
13862306a36Sopenharmony_ci#define MCFGPIO_CLRR			MCFGPIO_PCLRR_CS
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci#define MCFGPIO_PIN_MAX			80
14162306a36Sopenharmony_ci#define MCFGPIO_IRQ_MAX			8
14262306a36Sopenharmony_ci#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci#define MCF_GPIO_PAR_UART		0xFC0A4036
14562306a36Sopenharmony_ci#define MCF_GPIO_PAR_FECI2C		0xFC0A4033
14662306a36Sopenharmony_ci#define MCF_GPIO_PAR_QSPI		0xFC0A4034
14762306a36Sopenharmony_ci#define MCF_GPIO_PAR_FEC		0xFC0A4038
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_URXD0         (0x0001)
15062306a36Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_UTXD0         (0x0002)
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_URXD1         (0x0040)
15362306a36Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_UTXD1         (0x0080)
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2   (0x02)
15662306a36Sopenharmony_ci#define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2   (0x04)
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci/*
15962306a36Sopenharmony_ci *  PIT timer module.
16062306a36Sopenharmony_ci */
16162306a36Sopenharmony_ci#define	MCFPIT_BASE1		0xFC080000	/* Base address of TIMER1 */
16262306a36Sopenharmony_ci#define	MCFPIT_BASE2		0xFC084000	/* Base address of TIMER2 */
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci/*
16562306a36Sopenharmony_ci *  UART module.
16662306a36Sopenharmony_ci */
16762306a36Sopenharmony_ci#define MCFUART_BASE0		0xFC060000	/* Base address of UART0 */
16862306a36Sopenharmony_ci#define MCFUART_BASE1		0xFC064000	/* Base address of UART1 */
16962306a36Sopenharmony_ci#define MCFUART_BASE2		0xFC068000	/* Base address of UART2 */
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci/*
17262306a36Sopenharmony_ci *  FEC module.
17362306a36Sopenharmony_ci */
17462306a36Sopenharmony_ci#define	MCFFEC_BASE0		0xFC030000	/* Base of FEC ethernet */
17562306a36Sopenharmony_ci#define	MCFFEC_SIZE0		0x800		/* Register set size */
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci/*
17862306a36Sopenharmony_ci *  QSPI module.
17962306a36Sopenharmony_ci */
18062306a36Sopenharmony_ci#define	MCFQSPI_BASE		0xFC05C000	/* Base of QSPI module */
18162306a36Sopenharmony_ci#define	MCFQSPI_SIZE		0x40		/* Register set size */
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci#define	MCFQSPI_CS0		46
18462306a36Sopenharmony_ci#define	MCFQSPI_CS1		47
18562306a36Sopenharmony_ci#define	MCFQSPI_CS2		27
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_ci/*
18862306a36Sopenharmony_ci *  Reset Control Unit.
18962306a36Sopenharmony_ci */
19062306a36Sopenharmony_ci#define	MCF_RCR			0xFC0A0000
19162306a36Sopenharmony_ci#define	MCF_RSR			0xFC0A0001
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ci#define	MCF_RCR_SWRESET		0x80		/* Software reset bit */
19462306a36Sopenharmony_ci#define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci/*
19762306a36Sopenharmony_ci *  Power Management.
19862306a36Sopenharmony_ci */
19962306a36Sopenharmony_ci#define MCFPM_WCR		0xfc040013
20062306a36Sopenharmony_ci#define MCFPM_PPMSR0		0xfc04002c
20162306a36Sopenharmony_ci#define MCFPM_PPMCR0		0xfc04002d
20262306a36Sopenharmony_ci#define MCFPM_PPMHR0		0xfc040030
20362306a36Sopenharmony_ci#define MCFPM_PPMLR0		0xfc040034
20462306a36Sopenharmony_ci#define MCFPM_LPCR		0xfc0a0007
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ci/*
20762306a36Sopenharmony_ci * I2C module.
20862306a36Sopenharmony_ci */
20962306a36Sopenharmony_ci#define MCFI2C_BASE0		0xFC058000
21062306a36Sopenharmony_ci#define MCFI2C_SIZE0		0x40
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_ci/****************************************************************************/
21362306a36Sopenharmony_ci#endif  /* m520xsim_h */
214