18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * MPC8xx Internal Memory Map
38c2ecf20Sopenharmony_ci * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * The I/O on the MPC860 is comprised of blocks of special registers
68c2ecf20Sopenharmony_ci * and the dual port ram for the Communication Processor Module.
78c2ecf20Sopenharmony_ci * Within this space are functional units such as the SIU, memory
88c2ecf20Sopenharmony_ci * controller, system timers, and other control functions.  It is
98c2ecf20Sopenharmony_ci * a combination that I found difficult to separate into logical
108c2ecf20Sopenharmony_ci * functional files.....but anyone else is welcome to try.  -- Dan
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#ifdef __KERNEL__
138c2ecf20Sopenharmony_ci#ifndef __IMMAP_8XX__
148c2ecf20Sopenharmony_ci#define __IMMAP_8XX__
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/* System configuration registers.
178c2ecf20Sopenharmony_ci*/
188c2ecf20Sopenharmony_citypedef	struct sys_conf {
198c2ecf20Sopenharmony_ci	uint	sc_siumcr;
208c2ecf20Sopenharmony_ci	uint	sc_sypcr;
218c2ecf20Sopenharmony_ci	uint	sc_swt;
228c2ecf20Sopenharmony_ci	char	res1[2];
238c2ecf20Sopenharmony_ci	ushort	sc_swsr;
248c2ecf20Sopenharmony_ci	uint	sc_sipend;
258c2ecf20Sopenharmony_ci	uint	sc_simask;
268c2ecf20Sopenharmony_ci	uint	sc_siel;
278c2ecf20Sopenharmony_ci	uint	sc_sivec;
288c2ecf20Sopenharmony_ci	uint	sc_tesr;
298c2ecf20Sopenharmony_ci	char	res2[0xc];
308c2ecf20Sopenharmony_ci	uint	sc_sdcr;
318c2ecf20Sopenharmony_ci	char	res3[0x4c];
328c2ecf20Sopenharmony_ci} sysconf8xx_t;
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* PCMCIA configuration registers.
358c2ecf20Sopenharmony_ci*/
368c2ecf20Sopenharmony_citypedef struct pcmcia_conf {
378c2ecf20Sopenharmony_ci	uint	pcmc_pbr0;
388c2ecf20Sopenharmony_ci	uint	pcmc_por0;
398c2ecf20Sopenharmony_ci	uint	pcmc_pbr1;
408c2ecf20Sopenharmony_ci	uint	pcmc_por1;
418c2ecf20Sopenharmony_ci	uint	pcmc_pbr2;
428c2ecf20Sopenharmony_ci	uint	pcmc_por2;
438c2ecf20Sopenharmony_ci	uint	pcmc_pbr3;
448c2ecf20Sopenharmony_ci	uint	pcmc_por3;
458c2ecf20Sopenharmony_ci	uint	pcmc_pbr4;
468c2ecf20Sopenharmony_ci	uint	pcmc_por4;
478c2ecf20Sopenharmony_ci	uint	pcmc_pbr5;
488c2ecf20Sopenharmony_ci	uint	pcmc_por5;
498c2ecf20Sopenharmony_ci	uint	pcmc_pbr6;
508c2ecf20Sopenharmony_ci	uint	pcmc_por6;
518c2ecf20Sopenharmony_ci	uint	pcmc_pbr7;
528c2ecf20Sopenharmony_ci	uint	pcmc_por7;
538c2ecf20Sopenharmony_ci	char	res1[0x20];
548c2ecf20Sopenharmony_ci	uint	pcmc_pgcra;
558c2ecf20Sopenharmony_ci	uint	pcmc_pgcrb;
568c2ecf20Sopenharmony_ci	uint	pcmc_pscr;
578c2ecf20Sopenharmony_ci	char	res2[4];
588c2ecf20Sopenharmony_ci	uint	pcmc_pipr;
598c2ecf20Sopenharmony_ci	char	res3[4];
608c2ecf20Sopenharmony_ci	uint	pcmc_per;
618c2ecf20Sopenharmony_ci	char	res4[4];
628c2ecf20Sopenharmony_ci} pcmconf8xx_t;
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/* Memory controller registers.
658c2ecf20Sopenharmony_ci*/
668c2ecf20Sopenharmony_citypedef struct	mem_ctlr {
678c2ecf20Sopenharmony_ci	uint	memc_br0;
688c2ecf20Sopenharmony_ci	uint	memc_or0;
698c2ecf20Sopenharmony_ci	uint	memc_br1;
708c2ecf20Sopenharmony_ci	uint	memc_or1;
718c2ecf20Sopenharmony_ci	uint	memc_br2;
728c2ecf20Sopenharmony_ci	uint	memc_or2;
738c2ecf20Sopenharmony_ci	uint	memc_br3;
748c2ecf20Sopenharmony_ci	uint	memc_or3;
758c2ecf20Sopenharmony_ci	uint	memc_br4;
768c2ecf20Sopenharmony_ci	uint	memc_or4;
778c2ecf20Sopenharmony_ci	uint	memc_br5;
788c2ecf20Sopenharmony_ci	uint	memc_or5;
798c2ecf20Sopenharmony_ci	uint	memc_br6;
808c2ecf20Sopenharmony_ci	uint	memc_or6;
818c2ecf20Sopenharmony_ci	uint	memc_br7;
828c2ecf20Sopenharmony_ci	uint	memc_or7;
838c2ecf20Sopenharmony_ci	char	res1[0x24];
848c2ecf20Sopenharmony_ci	uint	memc_mar;
858c2ecf20Sopenharmony_ci	uint	memc_mcr;
868c2ecf20Sopenharmony_ci	char	res2[4];
878c2ecf20Sopenharmony_ci	uint	memc_mamr;
888c2ecf20Sopenharmony_ci	uint	memc_mbmr;
898c2ecf20Sopenharmony_ci	ushort	memc_mstat;
908c2ecf20Sopenharmony_ci	ushort	memc_mptpr;
918c2ecf20Sopenharmony_ci	uint	memc_mdr;
928c2ecf20Sopenharmony_ci	char	res3[0x80];
938c2ecf20Sopenharmony_ci} memctl8xx_t;
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci/*-----------------------------------------------------------------------
968c2ecf20Sopenharmony_ci * BR - Memory Controller: Base Register					16-9
978c2ecf20Sopenharmony_ci */
988c2ecf20Sopenharmony_ci#define BR_BA_MSK	0xffff8000	/* Base Address Mask			*/
998c2ecf20Sopenharmony_ci#define BR_AT_MSK	0x00007000	/* Address Type Mask			*/
1008c2ecf20Sopenharmony_ci#define BR_PS_MSK	0x00000c00	/* Port Size Mask			*/
1018c2ecf20Sopenharmony_ci#define BR_PS_32	0x00000000	/* 32 bit port size			*/
1028c2ecf20Sopenharmony_ci#define BR_PS_16	0x00000800	/* 16 bit port size			*/
1038c2ecf20Sopenharmony_ci#define BR_PS_8		0x00000400	/*  8 bit port size			*/
1048c2ecf20Sopenharmony_ci#define BR_PARE		0x00000200	/* Parity Enable			*/
1058c2ecf20Sopenharmony_ci#define BR_WP		0x00000100	/* Write Protect			*/
1068c2ecf20Sopenharmony_ci#define BR_MS_MSK	0x000000c0	/* Machine Select Mask			*/
1078c2ecf20Sopenharmony_ci#define BR_MS_GPCM	0x00000000	/* G.P.C.M. Machine Select		*/
1088c2ecf20Sopenharmony_ci#define BR_MS_UPMA	0x00000080	/* U.P.M.A Machine Select		*/
1098c2ecf20Sopenharmony_ci#define BR_MS_UPMB	0x000000c0	/* U.P.M.B Machine Select		*/
1108c2ecf20Sopenharmony_ci#define BR_V		0x00000001	/* Bank Valid				*/
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/*-----------------------------------------------------------------------
1138c2ecf20Sopenharmony_ci * OR - Memory Controller: Option Register				16-11
1148c2ecf20Sopenharmony_ci */
1158c2ecf20Sopenharmony_ci#define OR_AM_MSK	0xffff8000	/* Address Mask Mask			*/
1168c2ecf20Sopenharmony_ci#define OR_ATM_MSK	0x00007000	/* Address Type Mask Mask		*/
1178c2ecf20Sopenharmony_ci#define OR_CSNT_SAM	0x00000800	/* Chip Select Negation Time/ Start	*/
1188c2ecf20Sopenharmony_ci					/* Address Multiplex			*/
1198c2ecf20Sopenharmony_ci#define OR_ACS_MSK	0x00000600	/* Address to Chip Select Setup mask	*/
1208c2ecf20Sopenharmony_ci#define OR_ACS_DIV1	0x00000000	/* CS is output at the same time	*/
1218c2ecf20Sopenharmony_ci#define OR_ACS_DIV4	0x00000400	/* CS is output 1/4 a clock later	*/
1228c2ecf20Sopenharmony_ci#define OR_ACS_DIV2	0x00000600	/* CS is output 1/2 a clock later	*/
1238c2ecf20Sopenharmony_ci#define OR_G5LA		0x00000400	/* Output #GPL5 on #GPL_A5		*/
1248c2ecf20Sopenharmony_ci#define OR_G5LS		0x00000200	/* Drive #GPL high on falling edge of...*/
1258c2ecf20Sopenharmony_ci#define OR_BI		0x00000100	/* Burst inhibit			*/
1268c2ecf20Sopenharmony_ci#define OR_SCY_MSK	0x000000f0	/* Cycle Length in Clocks		*/
1278c2ecf20Sopenharmony_ci#define OR_SCY_0_CLK	0x00000000	/* 0 clock cycles wait states		*/
1288c2ecf20Sopenharmony_ci#define OR_SCY_1_CLK	0x00000010	/* 1 clock cycles wait states		*/
1298c2ecf20Sopenharmony_ci#define OR_SCY_2_CLK	0x00000020	/* 2 clock cycles wait states		*/
1308c2ecf20Sopenharmony_ci#define OR_SCY_3_CLK	0x00000030	/* 3 clock cycles wait states		*/
1318c2ecf20Sopenharmony_ci#define OR_SCY_4_CLK	0x00000040	/* 4 clock cycles wait states		*/
1328c2ecf20Sopenharmony_ci#define OR_SCY_5_CLK	0x00000050	/* 5 clock cycles wait states		*/
1338c2ecf20Sopenharmony_ci#define OR_SCY_6_CLK	0x00000060	/* 6 clock cycles wait states		*/
1348c2ecf20Sopenharmony_ci#define OR_SCY_7_CLK	0x00000070	/* 7 clock cycles wait states		*/
1358c2ecf20Sopenharmony_ci#define OR_SCY_8_CLK	0x00000080	/* 8 clock cycles wait states		*/
1368c2ecf20Sopenharmony_ci#define OR_SCY_9_CLK	0x00000090	/* 9 clock cycles wait states		*/
1378c2ecf20Sopenharmony_ci#define OR_SCY_10_CLK	0x000000a0	/* 10 clock cycles wait states		*/
1388c2ecf20Sopenharmony_ci#define OR_SCY_11_CLK	0x000000b0	/* 11 clock cycles wait states		*/
1398c2ecf20Sopenharmony_ci#define OR_SCY_12_CLK	0x000000c0	/* 12 clock cycles wait states		*/
1408c2ecf20Sopenharmony_ci#define OR_SCY_13_CLK	0x000000d0	/* 13 clock cycles wait states		*/
1418c2ecf20Sopenharmony_ci#define OR_SCY_14_CLK	0x000000e0	/* 14 clock cycles wait states		*/
1428c2ecf20Sopenharmony_ci#define OR_SCY_15_CLK	0x000000f0	/* 15 clock cycles wait states		*/
1438c2ecf20Sopenharmony_ci#define OR_SETA		0x00000008	/* External Transfer Acknowledge	*/
1448c2ecf20Sopenharmony_ci#define OR_TRLX		0x00000004	/* Timing Relaxed			*/
1458c2ecf20Sopenharmony_ci#define OR_EHTR		0x00000002	/* Extended Hold Time on Read		*/
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci/* System Integration Timers.
1488c2ecf20Sopenharmony_ci*/
1498c2ecf20Sopenharmony_citypedef struct	sys_int_timers {
1508c2ecf20Sopenharmony_ci	ushort	sit_tbscr;
1518c2ecf20Sopenharmony_ci	char	res0[0x02];
1528c2ecf20Sopenharmony_ci	uint	sit_tbreff0;
1538c2ecf20Sopenharmony_ci	uint	sit_tbreff1;
1548c2ecf20Sopenharmony_ci	char	res1[0x14];
1558c2ecf20Sopenharmony_ci	ushort	sit_rtcsc;
1568c2ecf20Sopenharmony_ci	char	res2[0x02];
1578c2ecf20Sopenharmony_ci	uint	sit_rtc;
1588c2ecf20Sopenharmony_ci	uint	sit_rtsec;
1598c2ecf20Sopenharmony_ci	uint	sit_rtcal;
1608c2ecf20Sopenharmony_ci	char	res3[0x10];
1618c2ecf20Sopenharmony_ci	ushort	sit_piscr;
1628c2ecf20Sopenharmony_ci	char	res4[2];
1638c2ecf20Sopenharmony_ci	uint	sit_pitc;
1648c2ecf20Sopenharmony_ci	uint	sit_pitr;
1658c2ecf20Sopenharmony_ci	char	res5[0x34];
1668c2ecf20Sopenharmony_ci} sit8xx_t;
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#define TBSCR_TBIRQ_MASK	((ushort)0xff00)
1698c2ecf20Sopenharmony_ci#define TBSCR_REFA		((ushort)0x0080)
1708c2ecf20Sopenharmony_ci#define TBSCR_REFB		((ushort)0x0040)
1718c2ecf20Sopenharmony_ci#define TBSCR_REFAE		((ushort)0x0008)
1728c2ecf20Sopenharmony_ci#define TBSCR_REFBE		((ushort)0x0004)
1738c2ecf20Sopenharmony_ci#define TBSCR_TBF		((ushort)0x0002)
1748c2ecf20Sopenharmony_ci#define TBSCR_TBE		((ushort)0x0001)
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci#define RTCSC_RTCIRQ_MASK	((ushort)0xff00)
1778c2ecf20Sopenharmony_ci#define RTCSC_SEC		((ushort)0x0080)
1788c2ecf20Sopenharmony_ci#define RTCSC_ALR		((ushort)0x0040)
1798c2ecf20Sopenharmony_ci#define RTCSC_38K		((ushort)0x0010)
1808c2ecf20Sopenharmony_ci#define RTCSC_SIE		((ushort)0x0008)
1818c2ecf20Sopenharmony_ci#define RTCSC_ALE		((ushort)0x0004)
1828c2ecf20Sopenharmony_ci#define RTCSC_RTF		((ushort)0x0002)
1838c2ecf20Sopenharmony_ci#define RTCSC_RTE		((ushort)0x0001)
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define PISCR_PIRQ_MASK		((ushort)0xff00)
1868c2ecf20Sopenharmony_ci#define PISCR_PS		((ushort)0x0080)
1878c2ecf20Sopenharmony_ci#define PISCR_PIE		((ushort)0x0004)
1888c2ecf20Sopenharmony_ci#define PISCR_PTF		((ushort)0x0002)
1898c2ecf20Sopenharmony_ci#define PISCR_PTE		((ushort)0x0001)
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci/* Clocks and Reset.
1928c2ecf20Sopenharmony_ci*/
1938c2ecf20Sopenharmony_citypedef struct clk_and_reset {
1948c2ecf20Sopenharmony_ci	uint	car_sccr;
1958c2ecf20Sopenharmony_ci	uint	car_plprcr;
1968c2ecf20Sopenharmony_ci	uint	car_rsr;
1978c2ecf20Sopenharmony_ci	char	res[0x74];        /* Reserved area                  */
1988c2ecf20Sopenharmony_ci} car8xx_t;
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci/* System Integration Timers keys.
2018c2ecf20Sopenharmony_ci*/
2028c2ecf20Sopenharmony_citypedef struct sitk {
2038c2ecf20Sopenharmony_ci	uint	sitk_tbscrk;
2048c2ecf20Sopenharmony_ci	uint	sitk_tbreff0k;
2058c2ecf20Sopenharmony_ci	uint	sitk_tbreff1k;
2068c2ecf20Sopenharmony_ci	uint	sitk_tbk;
2078c2ecf20Sopenharmony_ci	char	res1[0x10];
2088c2ecf20Sopenharmony_ci	uint	sitk_rtcsck;
2098c2ecf20Sopenharmony_ci	uint	sitk_rtck;
2108c2ecf20Sopenharmony_ci	uint	sitk_rtseck;
2118c2ecf20Sopenharmony_ci	uint	sitk_rtcalk;
2128c2ecf20Sopenharmony_ci	char	res2[0x10];
2138c2ecf20Sopenharmony_ci	uint	sitk_piscrk;
2148c2ecf20Sopenharmony_ci	uint	sitk_pitck;
2158c2ecf20Sopenharmony_ci	char	res3[0x38];
2168c2ecf20Sopenharmony_ci} sitk8xx_t;
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci/* Clocks and reset keys.
2198c2ecf20Sopenharmony_ci*/
2208c2ecf20Sopenharmony_citypedef struct cark {
2218c2ecf20Sopenharmony_ci	uint	cark_sccrk;
2228c2ecf20Sopenharmony_ci	uint	cark_plprcrk;
2238c2ecf20Sopenharmony_ci	uint	cark_rsrk;
2248c2ecf20Sopenharmony_ci	char	res[0x474];
2258c2ecf20Sopenharmony_ci} cark8xx_t;
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci/* The key to unlock registers maintained by keep-alive power.
2288c2ecf20Sopenharmony_ci*/
2298c2ecf20Sopenharmony_ci#define KAPWR_KEY	((unsigned int)0x55ccaa33)
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci/* Video interface.  MPC823 Only.
2328c2ecf20Sopenharmony_ci*/
2338c2ecf20Sopenharmony_citypedef struct vid823 {
2348c2ecf20Sopenharmony_ci	ushort	vid_vccr;
2358c2ecf20Sopenharmony_ci	ushort	res1;
2368c2ecf20Sopenharmony_ci	u_char	vid_vsr;
2378c2ecf20Sopenharmony_ci	u_char	res2;
2388c2ecf20Sopenharmony_ci	u_char	vid_vcmr;
2398c2ecf20Sopenharmony_ci	u_char	res3;
2408c2ecf20Sopenharmony_ci	uint	vid_vbcb;
2418c2ecf20Sopenharmony_ci	uint	res4;
2428c2ecf20Sopenharmony_ci	uint	vid_vfcr0;
2438c2ecf20Sopenharmony_ci	uint	vid_vfaa0;
2448c2ecf20Sopenharmony_ci	uint	vid_vfba0;
2458c2ecf20Sopenharmony_ci	uint	vid_vfcr1;
2468c2ecf20Sopenharmony_ci	uint	vid_vfaa1;
2478c2ecf20Sopenharmony_ci	uint	vid_vfba1;
2488c2ecf20Sopenharmony_ci	u_char	res5[0x18];
2498c2ecf20Sopenharmony_ci} vid823_t;
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci/* LCD interface.  823 Only.
2528c2ecf20Sopenharmony_ci*/
2538c2ecf20Sopenharmony_citypedef struct lcd {
2548c2ecf20Sopenharmony_ci	uint	lcd_lccr;
2558c2ecf20Sopenharmony_ci	uint	lcd_lchcr;
2568c2ecf20Sopenharmony_ci	uint	lcd_lcvcr;
2578c2ecf20Sopenharmony_ci	char	res1[4];
2588c2ecf20Sopenharmony_ci	uint	lcd_lcfaa;
2598c2ecf20Sopenharmony_ci	uint	lcd_lcfba;
2608c2ecf20Sopenharmony_ci	char	lcd_lcsr;
2618c2ecf20Sopenharmony_ci	char	res2[0x7];
2628c2ecf20Sopenharmony_ci} lcd823_t;
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci/* I2C
2658c2ecf20Sopenharmony_ci*/
2668c2ecf20Sopenharmony_citypedef struct i2c {
2678c2ecf20Sopenharmony_ci	u_char	i2c_i2mod;
2688c2ecf20Sopenharmony_ci	char	res1[3];
2698c2ecf20Sopenharmony_ci	u_char	i2c_i2add;
2708c2ecf20Sopenharmony_ci	char	res2[3];
2718c2ecf20Sopenharmony_ci	u_char	i2c_i2brg;
2728c2ecf20Sopenharmony_ci	char	res3[3];
2738c2ecf20Sopenharmony_ci	u_char	i2c_i2com;
2748c2ecf20Sopenharmony_ci	char	res4[3];
2758c2ecf20Sopenharmony_ci	u_char	i2c_i2cer;
2768c2ecf20Sopenharmony_ci	char	res5[3];
2778c2ecf20Sopenharmony_ci	u_char	i2c_i2cmr;
2788c2ecf20Sopenharmony_ci	char	res6[0x8b];
2798c2ecf20Sopenharmony_ci} i2c8xx_t;
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci/* DMA control/status registers.
2828c2ecf20Sopenharmony_ci*/
2838c2ecf20Sopenharmony_citypedef struct sdma_csr {
2848c2ecf20Sopenharmony_ci	char	res1[4];
2858c2ecf20Sopenharmony_ci	uint	sdma_sdar;
2868c2ecf20Sopenharmony_ci	u_char	sdma_sdsr;
2878c2ecf20Sopenharmony_ci	char	res3[3];
2888c2ecf20Sopenharmony_ci	u_char	sdma_sdmr;
2898c2ecf20Sopenharmony_ci	char	res4[3];
2908c2ecf20Sopenharmony_ci	u_char	sdma_idsr1;
2918c2ecf20Sopenharmony_ci	char	res5[3];
2928c2ecf20Sopenharmony_ci	u_char	sdma_idmr1;
2938c2ecf20Sopenharmony_ci	char	res6[3];
2948c2ecf20Sopenharmony_ci	u_char	sdma_idsr2;
2958c2ecf20Sopenharmony_ci	char	res7[3];
2968c2ecf20Sopenharmony_ci	u_char	sdma_idmr2;
2978c2ecf20Sopenharmony_ci	char	res8[0x13];
2988c2ecf20Sopenharmony_ci} sdma8xx_t;
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci/* Communication Processor Module Interrupt Controller.
3018c2ecf20Sopenharmony_ci*/
3028c2ecf20Sopenharmony_citypedef struct cpm_ic {
3038c2ecf20Sopenharmony_ci	ushort	cpic_civr;
3048c2ecf20Sopenharmony_ci	char	res[0xe];
3058c2ecf20Sopenharmony_ci	uint	cpic_cicr;
3068c2ecf20Sopenharmony_ci	uint	cpic_cipr;
3078c2ecf20Sopenharmony_ci	uint	cpic_cimr;
3088c2ecf20Sopenharmony_ci	uint	cpic_cisr;
3098c2ecf20Sopenharmony_ci} cpic8xx_t;
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci/* Input/Output Port control/status registers.
3128c2ecf20Sopenharmony_ci*/
3138c2ecf20Sopenharmony_citypedef struct io_port {
3148c2ecf20Sopenharmony_ci	ushort	iop_padir;
3158c2ecf20Sopenharmony_ci	ushort	iop_papar;
3168c2ecf20Sopenharmony_ci	ushort	iop_paodr;
3178c2ecf20Sopenharmony_ci	ushort	iop_padat;
3188c2ecf20Sopenharmony_ci	char	res1[8];
3198c2ecf20Sopenharmony_ci	ushort	iop_pcdir;
3208c2ecf20Sopenharmony_ci	ushort	iop_pcpar;
3218c2ecf20Sopenharmony_ci	ushort	iop_pcso;
3228c2ecf20Sopenharmony_ci	ushort	iop_pcdat;
3238c2ecf20Sopenharmony_ci	ushort	iop_pcint;
3248c2ecf20Sopenharmony_ci	char	res2[6];
3258c2ecf20Sopenharmony_ci	ushort	iop_pddir;
3268c2ecf20Sopenharmony_ci	ushort	iop_pdpar;
3278c2ecf20Sopenharmony_ci	char	res3[2];
3288c2ecf20Sopenharmony_ci	ushort	iop_pddat;
3298c2ecf20Sopenharmony_ci	uint	utmode;
3308c2ecf20Sopenharmony_ci	char	res4[4];
3318c2ecf20Sopenharmony_ci} iop8xx_t;
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci/* Communication Processor Module Timers
3348c2ecf20Sopenharmony_ci*/
3358c2ecf20Sopenharmony_citypedef struct cpm_timers {
3368c2ecf20Sopenharmony_ci	ushort	cpmt_tgcr;
3378c2ecf20Sopenharmony_ci	char	res1[0xe];
3388c2ecf20Sopenharmony_ci	ushort	cpmt_tmr1;
3398c2ecf20Sopenharmony_ci	ushort	cpmt_tmr2;
3408c2ecf20Sopenharmony_ci	ushort	cpmt_trr1;
3418c2ecf20Sopenharmony_ci	ushort	cpmt_trr2;
3428c2ecf20Sopenharmony_ci	ushort	cpmt_tcr1;
3438c2ecf20Sopenharmony_ci	ushort	cpmt_tcr2;
3448c2ecf20Sopenharmony_ci	ushort	cpmt_tcn1;
3458c2ecf20Sopenharmony_ci	ushort	cpmt_tcn2;
3468c2ecf20Sopenharmony_ci	ushort	cpmt_tmr3;
3478c2ecf20Sopenharmony_ci	ushort	cpmt_tmr4;
3488c2ecf20Sopenharmony_ci	ushort	cpmt_trr3;
3498c2ecf20Sopenharmony_ci	ushort	cpmt_trr4;
3508c2ecf20Sopenharmony_ci	ushort	cpmt_tcr3;
3518c2ecf20Sopenharmony_ci	ushort	cpmt_tcr4;
3528c2ecf20Sopenharmony_ci	ushort	cpmt_tcn3;
3538c2ecf20Sopenharmony_ci	ushort	cpmt_tcn4;
3548c2ecf20Sopenharmony_ci	ushort	cpmt_ter1;
3558c2ecf20Sopenharmony_ci	ushort	cpmt_ter2;
3568c2ecf20Sopenharmony_ci	ushort	cpmt_ter3;
3578c2ecf20Sopenharmony_ci	ushort	cpmt_ter4;
3588c2ecf20Sopenharmony_ci	char	res2[8];
3598c2ecf20Sopenharmony_ci} cpmtimer8xx_t;
3608c2ecf20Sopenharmony_ci
3618c2ecf20Sopenharmony_ci/* Finally, the Communication Processor stuff.....
3628c2ecf20Sopenharmony_ci*/
3638c2ecf20Sopenharmony_citypedef struct scc {		/* Serial communication channels */
3648c2ecf20Sopenharmony_ci	uint	scc_gsmrl;
3658c2ecf20Sopenharmony_ci	uint	scc_gsmrh;
3668c2ecf20Sopenharmony_ci	ushort	scc_psmr;
3678c2ecf20Sopenharmony_ci	char	res1[2];
3688c2ecf20Sopenharmony_ci	ushort	scc_todr;
3698c2ecf20Sopenharmony_ci	ushort	scc_dsr;
3708c2ecf20Sopenharmony_ci	ushort	scc_scce;
3718c2ecf20Sopenharmony_ci	char	res2[2];
3728c2ecf20Sopenharmony_ci	ushort	scc_sccm;
3738c2ecf20Sopenharmony_ci	char	res3;
3748c2ecf20Sopenharmony_ci	u_char	scc_sccs;
3758c2ecf20Sopenharmony_ci	char	res4[8];
3768c2ecf20Sopenharmony_ci} scc_t;
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_citypedef struct smc {		/* Serial management channels */
3798c2ecf20Sopenharmony_ci	char	res1[2];
3808c2ecf20Sopenharmony_ci	ushort	smc_smcmr;
3818c2ecf20Sopenharmony_ci	char	res2[2];
3828c2ecf20Sopenharmony_ci	u_char	smc_smce;
3838c2ecf20Sopenharmony_ci	char	res3[3];
3848c2ecf20Sopenharmony_ci	u_char	smc_smcm;
3858c2ecf20Sopenharmony_ci	char	res4[5];
3868c2ecf20Sopenharmony_ci} smc_t;
3878c2ecf20Sopenharmony_ci
3888c2ecf20Sopenharmony_ci/* MPC860T Fast Ethernet Controller.  It isn't part of the CPM, but
3898c2ecf20Sopenharmony_ci * it fits within the address space.
3908c2ecf20Sopenharmony_ci */
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_citypedef struct fec {
3938c2ecf20Sopenharmony_ci	uint	fec_addr_low;		/* lower 32 bits of station address	*/
3948c2ecf20Sopenharmony_ci	ushort	fec_addr_high;		/* upper 16 bits of station address	*/
3958c2ecf20Sopenharmony_ci	ushort	res1;			/* reserved				*/
3968c2ecf20Sopenharmony_ci	uint	fec_grp_hash_table_high;	/* upper 32-bits of hash table		*/
3978c2ecf20Sopenharmony_ci	uint	fec_grp_hash_table_low;	/* lower 32-bits of hash table		*/
3988c2ecf20Sopenharmony_ci	uint	fec_r_des_start;	/* beginning of Rx descriptor ring	*/
3998c2ecf20Sopenharmony_ci	uint	fec_x_des_start;	/* beginning of Tx descriptor ring	*/
4008c2ecf20Sopenharmony_ci	uint	fec_r_buff_size;	/* Rx buffer size			*/
4018c2ecf20Sopenharmony_ci	uint	res2[9];		/* reserved				*/
4028c2ecf20Sopenharmony_ci	uint	fec_ecntrl;		/* ethernet control register		*/
4038c2ecf20Sopenharmony_ci	uint	fec_ievent;		/* interrupt event register		*/
4048c2ecf20Sopenharmony_ci	uint	fec_imask;		/* interrupt mask register		*/
4058c2ecf20Sopenharmony_ci	uint	fec_ivec;		/* interrupt level and vector status	*/
4068c2ecf20Sopenharmony_ci	uint	fec_r_des_active;	/* Rx ring updated flag			*/
4078c2ecf20Sopenharmony_ci	uint	fec_x_des_active;	/* Tx ring updated flag			*/
4088c2ecf20Sopenharmony_ci	uint	res3[10];		/* reserved				*/
4098c2ecf20Sopenharmony_ci	uint	fec_mii_data;		/* MII data register			*/
4108c2ecf20Sopenharmony_ci	uint	fec_mii_speed;		/* MII speed control register		*/
4118c2ecf20Sopenharmony_ci	uint	res4[17];		/* reserved				*/
4128c2ecf20Sopenharmony_ci	uint	fec_r_bound;		/* end of RAM (read-only)		*/
4138c2ecf20Sopenharmony_ci	uint	fec_r_fstart;		/* Rx FIFO start address		*/
4148c2ecf20Sopenharmony_ci	uint	res5[6];		/* reserved				*/
4158c2ecf20Sopenharmony_ci	uint	fec_x_fstart;		/* Tx FIFO start address		*/
4168c2ecf20Sopenharmony_ci	uint	res6[17];		/* reserved				*/
4178c2ecf20Sopenharmony_ci	uint	fec_fun_code;		/* fec SDMA function code		*/
4188c2ecf20Sopenharmony_ci	uint	res7[3];		/* reserved				*/
4198c2ecf20Sopenharmony_ci	uint	fec_r_cntrl;		/* Rx control register			*/
4208c2ecf20Sopenharmony_ci	uint	fec_r_hash;		/* Rx hash register			*/
4218c2ecf20Sopenharmony_ci	uint	res8[14];		/* reserved				*/
4228c2ecf20Sopenharmony_ci	uint	fec_x_cntrl;		/* Tx control register			*/
4238c2ecf20Sopenharmony_ci	uint	res9[0x1e];		/* reserved				*/
4248c2ecf20Sopenharmony_ci} fec_t;
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci/* The FEC and LCD color map share the same address space....
4278c2ecf20Sopenharmony_ci * I guess we will never see an 823T :-).
4288c2ecf20Sopenharmony_ci */
4298c2ecf20Sopenharmony_ciunion fec_lcd {
4308c2ecf20Sopenharmony_ci	fec_t	fl_un_fec;
4318c2ecf20Sopenharmony_ci	u_char	fl_un_cmap[0x200];
4328c2ecf20Sopenharmony_ci};
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_citypedef struct comm_proc {
4358c2ecf20Sopenharmony_ci	/* General control and status registers.
4368c2ecf20Sopenharmony_ci	*/
4378c2ecf20Sopenharmony_ci	ushort	cp_cpcr;
4388c2ecf20Sopenharmony_ci	u_char	res1[2];
4398c2ecf20Sopenharmony_ci	ushort	cp_rccr;
4408c2ecf20Sopenharmony_ci	u_char	res2;
4418c2ecf20Sopenharmony_ci	u_char	cp_rmds;
4428c2ecf20Sopenharmony_ci	u_char	res3[4];
4438c2ecf20Sopenharmony_ci	ushort	cp_cpmcr1;
4448c2ecf20Sopenharmony_ci	ushort	cp_cpmcr2;
4458c2ecf20Sopenharmony_ci	ushort	cp_cpmcr3;
4468c2ecf20Sopenharmony_ci	ushort	cp_cpmcr4;
4478c2ecf20Sopenharmony_ci	u_char	res4[2];
4488c2ecf20Sopenharmony_ci	ushort	cp_rter;
4498c2ecf20Sopenharmony_ci	u_char	res5[2];
4508c2ecf20Sopenharmony_ci	ushort	cp_rtmr;
4518c2ecf20Sopenharmony_ci	u_char	res6[0x14];
4528c2ecf20Sopenharmony_ci
4538c2ecf20Sopenharmony_ci	/* Baud rate generators.
4548c2ecf20Sopenharmony_ci	*/
4558c2ecf20Sopenharmony_ci	uint	cp_brgc1;
4568c2ecf20Sopenharmony_ci	uint	cp_brgc2;
4578c2ecf20Sopenharmony_ci	uint	cp_brgc3;
4588c2ecf20Sopenharmony_ci	uint	cp_brgc4;
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci	/* Serial Communication Channels.
4618c2ecf20Sopenharmony_ci	*/
4628c2ecf20Sopenharmony_ci	scc_t	cp_scc[4];
4638c2ecf20Sopenharmony_ci
4648c2ecf20Sopenharmony_ci	/* Serial Management Channels.
4658c2ecf20Sopenharmony_ci	*/
4668c2ecf20Sopenharmony_ci	smc_t	cp_smc[2];
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_ci	/* Serial Peripheral Interface.
4698c2ecf20Sopenharmony_ci	*/
4708c2ecf20Sopenharmony_ci	ushort	cp_spmode;
4718c2ecf20Sopenharmony_ci	u_char	res7[4];
4728c2ecf20Sopenharmony_ci	u_char	cp_spie;
4738c2ecf20Sopenharmony_ci	u_char	res8[3];
4748c2ecf20Sopenharmony_ci	u_char	cp_spim;
4758c2ecf20Sopenharmony_ci	u_char	res9[2];
4768c2ecf20Sopenharmony_ci	u_char	cp_spcom;
4778c2ecf20Sopenharmony_ci	u_char	res10[2];
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci	/* Parallel Interface Port.
4808c2ecf20Sopenharmony_ci	*/
4818c2ecf20Sopenharmony_ci	u_char	res11[2];
4828c2ecf20Sopenharmony_ci	ushort	cp_pipc;
4838c2ecf20Sopenharmony_ci	u_char	res12[2];
4848c2ecf20Sopenharmony_ci	ushort	cp_ptpr;
4858c2ecf20Sopenharmony_ci	uint	cp_pbdir;
4868c2ecf20Sopenharmony_ci	uint	cp_pbpar;
4878c2ecf20Sopenharmony_ci	u_char	res13[2];
4888c2ecf20Sopenharmony_ci	ushort	cp_pbodr;
4898c2ecf20Sopenharmony_ci	uint	cp_pbdat;
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci	/* Port E - MPC87x/88x only.
4928c2ecf20Sopenharmony_ci	 */
4938c2ecf20Sopenharmony_ci	uint	cp_pedir;
4948c2ecf20Sopenharmony_ci	uint	cp_pepar;
4958c2ecf20Sopenharmony_ci	uint	cp_peso;
4968c2ecf20Sopenharmony_ci	uint	cp_peodr;
4978c2ecf20Sopenharmony_ci	uint	cp_pedat;
4988c2ecf20Sopenharmony_ci
4998c2ecf20Sopenharmony_ci	/* Communications Processor Timing Register -
5008c2ecf20Sopenharmony_ci	   Contains RMII Timing for the FECs on MPC87x/88x only.
5018c2ecf20Sopenharmony_ci	*/
5028c2ecf20Sopenharmony_ci	uint	cp_cptr;
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci	/* Serial Interface and Time Slot Assignment.
5058c2ecf20Sopenharmony_ci	*/
5068c2ecf20Sopenharmony_ci	uint	cp_simode;
5078c2ecf20Sopenharmony_ci	u_char	cp_sigmr;
5088c2ecf20Sopenharmony_ci	u_char	res15;
5098c2ecf20Sopenharmony_ci	u_char	cp_sistr;
5108c2ecf20Sopenharmony_ci	u_char	cp_sicmr;
5118c2ecf20Sopenharmony_ci	u_char	res16[4];
5128c2ecf20Sopenharmony_ci	uint	cp_sicr;
5138c2ecf20Sopenharmony_ci	uint	cp_sirp;
5148c2ecf20Sopenharmony_ci	u_char	res17[0xc];
5158c2ecf20Sopenharmony_ci
5168c2ecf20Sopenharmony_ci	/* 256 bytes of MPC823 video controller RAM array.
5178c2ecf20Sopenharmony_ci	*/
5188c2ecf20Sopenharmony_ci	u_char	cp_vcram[0x100];
5198c2ecf20Sopenharmony_ci	u_char	cp_siram[0x200];
5208c2ecf20Sopenharmony_ci
5218c2ecf20Sopenharmony_ci	/* The fast ethernet controller is not really part of the CPM,
5228c2ecf20Sopenharmony_ci	 * but it resides in the address space.
5238c2ecf20Sopenharmony_ci	 * The LCD color map is also here.
5248c2ecf20Sopenharmony_ci	 */
5258c2ecf20Sopenharmony_ci	union	fec_lcd	fl_un;
5268c2ecf20Sopenharmony_ci#define cp_fec		fl_un.fl_un_fec
5278c2ecf20Sopenharmony_ci#define lcd_cmap	fl_un.fl_un_cmap
5288c2ecf20Sopenharmony_ci	char	res18[0xE00];
5298c2ecf20Sopenharmony_ci
5308c2ecf20Sopenharmony_ci	/* The DUET family has a second FEC here */
5318c2ecf20Sopenharmony_ci	fec_t	cp_fec2;
5328c2ecf20Sopenharmony_ci#define cp_fec1	cp_fec	/* consistency macro */
5338c2ecf20Sopenharmony_ci
5348c2ecf20Sopenharmony_ci	/* Dual Ported RAM follows.
5358c2ecf20Sopenharmony_ci	 * There are many different formats for this memory area
5368c2ecf20Sopenharmony_ci	 * depending upon the devices used and options chosen.
5378c2ecf20Sopenharmony_ci	 * Some processors don't have all of it populated.
5388c2ecf20Sopenharmony_ci	 */
5398c2ecf20Sopenharmony_ci	u_char	cp_dpmem[0x1C00];	/* BD / Data / ucode */
5408c2ecf20Sopenharmony_ci	u_char	cp_dparam[0x400];	/* Parameter RAM */
5418c2ecf20Sopenharmony_ci} cpm8xx_t;
5428c2ecf20Sopenharmony_ci
5438c2ecf20Sopenharmony_ci/* Internal memory map.
5448c2ecf20Sopenharmony_ci*/
5458c2ecf20Sopenharmony_citypedef struct immap {
5468c2ecf20Sopenharmony_ci	sysconf8xx_t	im_siu_conf;	/* SIU Configuration */
5478c2ecf20Sopenharmony_ci	pcmconf8xx_t	im_pcmcia;	/* PCMCIA Configuration */
5488c2ecf20Sopenharmony_ci	memctl8xx_t	im_memctl;	/* Memory Controller */
5498c2ecf20Sopenharmony_ci	sit8xx_t	im_sit;		/* System integration timers */
5508c2ecf20Sopenharmony_ci	car8xx_t	im_clkrst;	/* Clocks and reset */
5518c2ecf20Sopenharmony_ci	sitk8xx_t	im_sitk;	/* Sys int timer keys */
5528c2ecf20Sopenharmony_ci	cark8xx_t	im_clkrstk;	/* Clocks and reset keys */
5538c2ecf20Sopenharmony_ci	vid823_t	im_vid;		/* Video (823 only) */
5548c2ecf20Sopenharmony_ci	lcd823_t	im_lcd;		/* LCD (823 only) */
5558c2ecf20Sopenharmony_ci	i2c8xx_t	im_i2c;		/* I2C control/status */
5568c2ecf20Sopenharmony_ci	sdma8xx_t	im_sdma;	/* SDMA control/status */
5578c2ecf20Sopenharmony_ci	cpic8xx_t	im_cpic;	/* CPM Interrupt Controller */
5588c2ecf20Sopenharmony_ci	iop8xx_t	im_ioport;	/* IO Port control/status */
5598c2ecf20Sopenharmony_ci	cpmtimer8xx_t	im_cpmtimer;	/* CPM timers */
5608c2ecf20Sopenharmony_ci	cpm8xx_t	im_cpm;		/* Communication processor */
5618c2ecf20Sopenharmony_ci} immap_t;
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_ci#endif /* __IMMAP_8XX__ */
5648c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
565