18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *	m54xxsim.h -- ColdFire 547x/548x System Integration Unit support.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef	m54xxsim_h
78c2ecf20Sopenharmony_ci#define m54xxsim_h
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#define	CPU_NAME		"COLDFIRE(m54xx)"
108c2ecf20Sopenharmony_ci#define	CPU_INSTR_PER_JIFFY	2
118c2ecf20Sopenharmony_ci#define	MCF_BUSCLK		(MCF_CLK / 2)
128c2ecf20Sopenharmony_ci#define	MACHINE			MACH_M54XX
138c2ecf20Sopenharmony_ci#define	FPUTYPE			FPU_COLDFIRE
148c2ecf20Sopenharmony_ci#define	IOMEMBASE		MCF_MBAR
158c2ecf20Sopenharmony_ci#define	IOMEMSIZE		0x01000000
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#include <asm/m54xxacr.h>
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define MCFINT_VECBASE		64
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*
228c2ecf20Sopenharmony_ci *      Interrupt Controller Registers
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci#define MCFICM_INTC0		(MCF_MBAR + 0x700) 	/* Base for Interrupt Ctrl 0 */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#define MCFINTC_IPRH		0x00		/* Interrupt pending 32-63 */
278c2ecf20Sopenharmony_ci#define MCFINTC_IPRL		0x04		/* Interrupt pending 1-31 */
288c2ecf20Sopenharmony_ci#define MCFINTC_IMRH		0x08		/* Interrupt mask 32-63 */
298c2ecf20Sopenharmony_ci#define MCFINTC_IMRL		0x0c		/* Interrupt mask 1-31 */
308c2ecf20Sopenharmony_ci#define MCFINTC_INTFRCH		0x10		/* Interrupt force 32-63 */
318c2ecf20Sopenharmony_ci#define MCFINTC_INTFRCL		0x14		/* Interrupt force 1-31 */
328c2ecf20Sopenharmony_ci#define MCFINTC_IRLR		0x18		/* */
338c2ecf20Sopenharmony_ci#define MCFINTC_IACKL		0x19		/* */
348c2ecf20Sopenharmony_ci#define MCFINTC_ICR0		0x40		/* Base ICR register */
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/*
378c2ecf20Sopenharmony_ci *	UART module.
388c2ecf20Sopenharmony_ci */
398c2ecf20Sopenharmony_ci#define MCFUART_BASE0		(MCF_MBAR + 0x8600)	/* Base address UART0 */
408c2ecf20Sopenharmony_ci#define MCFUART_BASE1		(MCF_MBAR + 0x8700)	/* Base address UART1 */
418c2ecf20Sopenharmony_ci#define MCFUART_BASE2		(MCF_MBAR + 0x8800)	/* Base address UART2 */
428c2ecf20Sopenharmony_ci#define MCFUART_BASE3		(MCF_MBAR + 0x8900)	/* Base address UART3 */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/*
458c2ecf20Sopenharmony_ci *	Define system peripheral IRQ usage.
468c2ecf20Sopenharmony_ci */
478c2ecf20Sopenharmony_ci#define MCF_IRQ_TIMER		(MCFINT_VECBASE + 54)	/* Slice Timer 0 */
488c2ecf20Sopenharmony_ci#define MCF_IRQ_PROFILER	(MCFINT_VECBASE + 53)	/* Slice Timer 1 */
498c2ecf20Sopenharmony_ci#define MCF_IRQ_I2C0		(MCFINT_VECBASE + 40)
508c2ecf20Sopenharmony_ci#define MCF_IRQ_UART0		(MCFINT_VECBASE + 35)
518c2ecf20Sopenharmony_ci#define MCF_IRQ_UART1		(MCFINT_VECBASE + 34)
528c2ecf20Sopenharmony_ci#define MCF_IRQ_UART2		(MCFINT_VECBASE + 33)
538c2ecf20Sopenharmony_ci#define MCF_IRQ_UART3		(MCFINT_VECBASE + 32)
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/*
568c2ecf20Sopenharmony_ci *	Slice Timer support.
578c2ecf20Sopenharmony_ci */
588c2ecf20Sopenharmony_ci#define MCFSLT_TIMER0		(MCF_MBAR + 0x900)	/* Base addr TIMER0 */
598c2ecf20Sopenharmony_ci#define MCFSLT_TIMER1		(MCF_MBAR + 0x910)	/* Base addr TIMER1 */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/*
628c2ecf20Sopenharmony_ci *	Generic GPIO support
638c2ecf20Sopenharmony_ci */
648c2ecf20Sopenharmony_ci#define MCFGPIO_PODR		(MCF_MBAR + 0xA00)
658c2ecf20Sopenharmony_ci#define MCFGPIO_PDDR		(MCF_MBAR + 0xA10)
668c2ecf20Sopenharmony_ci#define MCFGPIO_PPDR		(MCF_MBAR + 0xA20)
678c2ecf20Sopenharmony_ci#define MCFGPIO_SETR		(MCF_MBAR + 0xA20)
688c2ecf20Sopenharmony_ci#define MCFGPIO_CLRR		(MCF_MBAR + 0xA30)
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define MCFGPIO_PIN_MAX		136	/* 128 gpio + 8 eport */
718c2ecf20Sopenharmony_ci#define MCFGPIO_IRQ_MAX		8
728c2ecf20Sopenharmony_ci#define MCFGPIO_IRQ_VECBASE	MCFINT_VECBASE
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/*
758c2ecf20Sopenharmony_ci *	EDGE Port support.
768c2ecf20Sopenharmony_ci */
778c2ecf20Sopenharmony_ci#define	MCFEPORT_EPPAR		(MCF_MBAR + 0xf00)	/* Pin assignment */
788c2ecf20Sopenharmony_ci#define	MCFEPORT_EPDDR		(MCF_MBAR + 0xf04)	/* Data direction */
798c2ecf20Sopenharmony_ci#define	MCFEPORT_EPIER		(MCF_MBAR + 0xf05)	/* Interrupt enable */
808c2ecf20Sopenharmony_ci#define	MCFEPORT_EPDR		(MCF_MBAR + 0xf08)	/* Port data (w) */
818c2ecf20Sopenharmony_ci#define	MCFEPORT_EPPDR		(MCF_MBAR + 0xf09)	/* Port data (r) */
828c2ecf20Sopenharmony_ci#define	MCFEPORT_EPFR		(MCF_MBAR + 0xf0c)	/* Flags */
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci/*
858c2ecf20Sopenharmony_ci *	Pin Assignment register definitions
868c2ecf20Sopenharmony_ci */
878c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_FBCTL	(MCF_MBAR + 0xA40)
888c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_FBCS	(MCF_MBAR + 0xA42)
898c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_DMA		(MCF_MBAR + 0xA43)
908c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_FECI2CIRQ	(MCF_MBAR + 0xA44)
918c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_PCIBG	(MCF_MBAR + 0xA48)	/* PCI bus grant */
928c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_PCIBR	(MCF_MBAR + 0xA4A)	/* PCI */
938c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_PSC0	(MCF_MBAR + 0xA4F)
948c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_PSC1	(MCF_MBAR + 0xA4E)
958c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_PSC2	(MCF_MBAR + 0xA4D)
968c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_PSC3	(MCF_MBAR + 0xA4C)
978c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_DSPI	(MCF_MBAR + 0xA50)
988c2ecf20Sopenharmony_ci#define MCFGPIO_PAR_TIMER	(MCF_MBAR + 0xA52)
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define MCF_PAR_SDA		(0x0008)
1018c2ecf20Sopenharmony_ci#define MCF_PAR_SCL		(0x0004)
1028c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_TXD		(0x04)
1038c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_RXD		(0x08)
1048c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_CTS_GPIO	(0x00)
1058c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_CTS_BCLK	(0x80)
1068c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_CTS_CTS	(0xC0)
1078c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_RTS_GPIO    (0x00)
1088c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_RTS_FSYNC	(0x20)
1098c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_RTS_RTS	(0x30)
1108c2ecf20Sopenharmony_ci#define MCF_PAR_PSC_CANRX	(0x40)
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define MCF_PAR_FECI2CIRQ	(MCF_MBAR + 0x00000a44)	/* FEC/I2C/IRQ */
1138c2ecf20Sopenharmony_ci#define MCF_PAR_FECI2CIRQ_SDA	(1 << 3)
1148c2ecf20Sopenharmony_ci#define MCF_PAR_FECI2CIRQ_SCL	(1 << 2)
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci/*
1178c2ecf20Sopenharmony_ci * I2C module.
1188c2ecf20Sopenharmony_ci */
1198c2ecf20Sopenharmony_ci#define MCFI2C_BASE0		(MCF_MBAR + 0x8f00)
1208c2ecf20Sopenharmony_ci#define MCFI2C_SIZE0		0x40
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci#endif	/* m54xxsim_h */
123