18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/****************************************************************************/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci/*
58c2ecf20Sopenharmony_ci *  m520xsim.h -- ColdFire 5207/5208 System Integration Module support.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci *  (C) Copyright 2005, Intec Automation (mike@steroidmicros.com)
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/****************************************************************************/
118c2ecf20Sopenharmony_ci#ifndef m520xsim_h
128c2ecf20Sopenharmony_ci#define m520xsim_h
138c2ecf20Sopenharmony_ci/****************************************************************************/
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define	CPU_NAME		"COLDFIRE(m520x)"
168c2ecf20Sopenharmony_ci#define	CPU_INSTR_PER_JIFFY	3
178c2ecf20Sopenharmony_ci#define	MCF_BUSCLK		(MCF_CLK / 2)
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#include <asm/m52xxacr.h>
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*
228c2ecf20Sopenharmony_ci *  Define the 520x SIM register set addresses.
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci#define MCFICM_INTC0        0xFC048000  /* Base for Interrupt Ctrl 0 */
258c2ecf20Sopenharmony_ci#define MCFINTC_IPRH        0x00        /* Interrupt pending 32-63 */
268c2ecf20Sopenharmony_ci#define MCFINTC_IPRL        0x04        /* Interrupt pending 1-31 */
278c2ecf20Sopenharmony_ci#define MCFINTC_IMRH        0x08        /* Interrupt mask 32-63 */
288c2ecf20Sopenharmony_ci#define MCFINTC_IMRL        0x0c        /* Interrupt mask 1-31 */
298c2ecf20Sopenharmony_ci#define MCFINTC_INTFRCH     0x10        /* Interrupt force 32-63 */
308c2ecf20Sopenharmony_ci#define MCFINTC_INTFRCL     0x14        /* Interrupt force 1-31 */
318c2ecf20Sopenharmony_ci#define MCFINTC_SIMR        0x1c        /* Set interrupt mask 0-63 */
328c2ecf20Sopenharmony_ci#define MCFINTC_CIMR        0x1d        /* Clear interrupt mask 0-63 */
338c2ecf20Sopenharmony_ci#define MCFINTC_ICR0        0x40        /* Base ICR register */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/*
368c2ecf20Sopenharmony_ci *  The common interrupt controller code just wants to know the absolute
378c2ecf20Sopenharmony_ci *  address to the SIMR and CIMR registers (not offsets into IPSBAR).
388c2ecf20Sopenharmony_ci *  The 520x family only has a single INTC unit.
398c2ecf20Sopenharmony_ci */
408c2ecf20Sopenharmony_ci#define MCFINTC0_SIMR       (MCFICM_INTC0 + MCFINTC_SIMR)
418c2ecf20Sopenharmony_ci#define MCFINTC0_CIMR       (MCFICM_INTC0 + MCFINTC_CIMR)
428c2ecf20Sopenharmony_ci#define	MCFINTC0_ICR0       (MCFICM_INTC0 + MCFINTC_ICR0)
438c2ecf20Sopenharmony_ci#define MCFINTC1_SIMR       (0)
448c2ecf20Sopenharmony_ci#define MCFINTC1_CIMR       (0)
458c2ecf20Sopenharmony_ci#define	MCFINTC1_ICR0       (0)
468c2ecf20Sopenharmony_ci#define MCFINTC2_SIMR       (0)
478c2ecf20Sopenharmony_ci#define MCFINTC2_CIMR       (0)
488c2ecf20Sopenharmony_ci#define MCFINTC2_ICR0       (0)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define MCFINT_VECBASE      64
518c2ecf20Sopenharmony_ci#define MCFINT_UART0        26          /* Interrupt number for UART0 */
528c2ecf20Sopenharmony_ci#define MCFINT_UART1        27          /* Interrupt number for UART1 */
538c2ecf20Sopenharmony_ci#define MCFINT_UART2        28          /* Interrupt number for UART2 */
548c2ecf20Sopenharmony_ci#define MCFINT_I2C0         30          /* Interrupt number for I2C */
558c2ecf20Sopenharmony_ci#define MCFINT_QSPI         31          /* Interrupt number for QSPI */
568c2ecf20Sopenharmony_ci#define MCFINT_FECRX0	    36		/* Interrupt number for FEC RX */
578c2ecf20Sopenharmony_ci#define MCFINT_FECTX0	    40		/* Interrupt number for FEC RX */
588c2ecf20Sopenharmony_ci#define MCFINT_FECENTC0	    42		/* Interrupt number for FEC RX */
598c2ecf20Sopenharmony_ci#define MCFINT_PIT1         4           /* Interrupt number for PIT1 (PIT0 in processor) */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define MCF_IRQ_UART0	    (MCFINT_VECBASE + MCFINT_UART0)
628c2ecf20Sopenharmony_ci#define MCF_IRQ_UART1	    (MCFINT_VECBASE + MCFINT_UART1)
638c2ecf20Sopenharmony_ci#define MCF_IRQ_UART2	    (MCFINT_VECBASE + MCFINT_UART2)
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define MCF_IRQ_FECRX0	    (MCFINT_VECBASE + MCFINT_FECRX0)
668c2ecf20Sopenharmony_ci#define MCF_IRQ_FECTX0	    (MCFINT_VECBASE + MCFINT_FECTX0)
678c2ecf20Sopenharmony_ci#define MCF_IRQ_FECENTC0    (MCFINT_VECBASE + MCFINT_FECENTC0)
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define	MCF_IRQ_QSPI	    (MCFINT_VECBASE + MCFINT_QSPI)
708c2ecf20Sopenharmony_ci#define MCF_IRQ_PIT1        (MCFINT_VECBASE + MCFINT_PIT1)
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#define MCF_IRQ_I2C0        (MCFINT_VECBASE + MCFINT_I2C0)
738c2ecf20Sopenharmony_ci/*
748c2ecf20Sopenharmony_ci *  SDRAM configuration registers.
758c2ecf20Sopenharmony_ci */
768c2ecf20Sopenharmony_ci#define MCFSIM_SDMR         0xFC0a8000	/* SDRAM Mode/Extended Mode Register */
778c2ecf20Sopenharmony_ci#define MCFSIM_SDCR         0xFC0a8004	/* SDRAM Control Register */
788c2ecf20Sopenharmony_ci#define MCFSIM_SDCFG1       0xFC0a8008	/* SDRAM Configuration Register 1 */
798c2ecf20Sopenharmony_ci#define MCFSIM_SDCFG2       0xFC0a800c	/* SDRAM Configuration Register 2 */
808c2ecf20Sopenharmony_ci#define MCFSIM_SDCS0        0xFC0a8110	/* SDRAM Chip Select 0 Configuration */
818c2ecf20Sopenharmony_ci#define MCFSIM_SDCS1        0xFC0a8114	/* SDRAM Chip Select 1 Configuration */
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/*
848c2ecf20Sopenharmony_ci * EPORT and GPIO registers.
858c2ecf20Sopenharmony_ci */
868c2ecf20Sopenharmony_ci#define MCFEPORT_EPPAR			0xFC088000
878c2ecf20Sopenharmony_ci#define MCFEPORT_EPDDR			0xFC088002
888c2ecf20Sopenharmony_ci#define MCFEPORT_EPIER			0xFC088003
898c2ecf20Sopenharmony_ci#define MCFEPORT_EPDR			0xFC088004
908c2ecf20Sopenharmony_ci#define MCFEPORT_EPPDR			0xFC088005
918c2ecf20Sopenharmony_ci#define MCFEPORT_EPFR			0xFC088006
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_BUSCTL		0xFC0A4000
948c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_BE			0xFC0A4001
958c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_CS			0xFC0A4002
968c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_FECI2C		0xFC0A4003
978c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_QSPI		0xFC0A4004
988c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_TIMER		0xFC0A4005
998c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_UART		0xFC0A4006
1008c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_FECH		0xFC0A4007
1018c2ecf20Sopenharmony_ci#define MCFGPIO_PODR_FECL		0xFC0A4008
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_BUSCTL		0xFC0A400C
1048c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_BE			0xFC0A400D
1058c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_CS			0xFC0A400E
1068c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_FECI2C		0xFC0A400F
1078c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_QSPI		0xFC0A4010
1088c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_TIMER		0xFC0A4011
1098c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_UART		0xFC0A4012
1108c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_FECH		0xFC0A4013
1118c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR_FECL		0xFC0A4014
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_CS		0xFC0A401A
1148c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_FECI2C		0xFC0A401B
1158c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_QSPI		0xFC0A401C
1168c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_TIMER		0xFC0A401D
1178c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_UART		0xFC0A401E
1188c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_FECH		0xFC0A401F
1198c2ecf20Sopenharmony_ci#define MCFGPIO_PPDSDR_FECL		0xFC0A4020
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_BUSCTL		0xFC0A4024
1228c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_BE		0xFC0A4025
1238c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_CS		0xFC0A4026
1248c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_FECI2C		0xFC0A4027
1258c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_QSPI		0xFC0A4028
1268c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_TIMER		0xFC0A4029
1278c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_UART		0xFC0A402A
1288c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_FECH		0xFC0A402B
1298c2ecf20Sopenharmony_ci#define MCFGPIO_PCLRR_FECL		0xFC0A402C
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/*
1328c2ecf20Sopenharmony_ci * Generic GPIO support
1338c2ecf20Sopenharmony_ci */
1348c2ecf20Sopenharmony_ci#define MCFGPIO_PODR			MCFGPIO_PODR_CS
1358c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR			MCFGPIO_PDDR_CS
1368c2ecf20Sopenharmony_ci#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_CS
1378c2ecf20Sopenharmony_ci#define MCFGPIO_SETR			MCFGPIO_PPDSDR_CS
1388c2ecf20Sopenharmony_ci#define MCFGPIO_CLRR			MCFGPIO_PCLRR_CS
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci#define MCFGPIO_PIN_MAX			80
1418c2ecf20Sopenharmony_ci#define MCFGPIO_IRQ_MAX			8
1428c2ecf20Sopenharmony_ci#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_UART		0xFC0A4036
1458c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_FECI2C		0xFC0A4033
1468c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_QSPI		0xFC0A4034
1478c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_FEC		0xFC0A4038
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_URXD0         (0x0001)
1508c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_UTXD0         (0x0002)
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_URXD1         (0x0040)
1538c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_UART_PAR_UTXD1         (0x0080)
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2   (0x02)
1568c2ecf20Sopenharmony_ci#define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2   (0x04)
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci/*
1598c2ecf20Sopenharmony_ci *  PIT timer module.
1608c2ecf20Sopenharmony_ci */
1618c2ecf20Sopenharmony_ci#define	MCFPIT_BASE1		0xFC080000	/* Base address of TIMER1 */
1628c2ecf20Sopenharmony_ci#define	MCFPIT_BASE2		0xFC084000	/* Base address of TIMER2 */
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci/*
1658c2ecf20Sopenharmony_ci *  UART module.
1668c2ecf20Sopenharmony_ci */
1678c2ecf20Sopenharmony_ci#define MCFUART_BASE0		0xFC060000	/* Base address of UART0 */
1688c2ecf20Sopenharmony_ci#define MCFUART_BASE1		0xFC064000	/* Base address of UART1 */
1698c2ecf20Sopenharmony_ci#define MCFUART_BASE2		0xFC068000	/* Base address of UART2 */
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci/*
1728c2ecf20Sopenharmony_ci *  FEC module.
1738c2ecf20Sopenharmony_ci */
1748c2ecf20Sopenharmony_ci#define	MCFFEC_BASE0		0xFC030000	/* Base of FEC ethernet */
1758c2ecf20Sopenharmony_ci#define	MCFFEC_SIZE0		0x800		/* Register set size */
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci/*
1788c2ecf20Sopenharmony_ci *  QSPI module.
1798c2ecf20Sopenharmony_ci */
1808c2ecf20Sopenharmony_ci#define	MCFQSPI_BASE		0xFC05C000	/* Base of QSPI module */
1818c2ecf20Sopenharmony_ci#define	MCFQSPI_SIZE		0x40		/* Register set size */
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define	MCFQSPI_CS0		46
1848c2ecf20Sopenharmony_ci#define	MCFQSPI_CS1		47
1858c2ecf20Sopenharmony_ci#define	MCFQSPI_CS2		27
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci/*
1888c2ecf20Sopenharmony_ci *  Reset Control Unit.
1898c2ecf20Sopenharmony_ci */
1908c2ecf20Sopenharmony_ci#define	MCF_RCR			0xFC0A0000
1918c2ecf20Sopenharmony_ci#define	MCF_RSR			0xFC0A0001
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define	MCF_RCR_SWRESET		0x80		/* Software reset bit */
1948c2ecf20Sopenharmony_ci#define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci/*
1978c2ecf20Sopenharmony_ci *  Power Management.
1988c2ecf20Sopenharmony_ci */
1998c2ecf20Sopenharmony_ci#define MCFPM_WCR		0xfc040013
2008c2ecf20Sopenharmony_ci#define MCFPM_PPMSR0		0xfc04002c
2018c2ecf20Sopenharmony_ci#define MCFPM_PPMCR0		0xfc04002d
2028c2ecf20Sopenharmony_ci#define MCFPM_PPMHR0		0xfc040030
2038c2ecf20Sopenharmony_ci#define MCFPM_PPMLR0		0xfc040034
2048c2ecf20Sopenharmony_ci#define MCFPM_LPCR		0xfc0a0007
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci/*
2078c2ecf20Sopenharmony_ci * I2C module.
2088c2ecf20Sopenharmony_ci */
2098c2ecf20Sopenharmony_ci#define MCFI2C_BASE0		0xFC058000
2108c2ecf20Sopenharmony_ci#define MCFI2C_SIZE0		0x40
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci/****************************************************************************/
2138c2ecf20Sopenharmony_ci#endif  /* m520xsim_h */
214