Path: blob/master/arch/powerpc/include/asm/8xx_immap.h
15117 views
/*1* MPC8xx Internal Memory Map2* Copyright (c) 1997 Dan Malek ([email protected])3*4* The I/O on the MPC860 is comprised of blocks of special registers5* and the dual port ram for the Communication Processor Module.6* Within this space are functional units such as the SIU, memory7* controller, system timers, and other control functions. It is8* a combination that I found difficult to separate into logical9* functional files.....but anyone else is welcome to try. -- Dan10*/11#ifdef __KERNEL__12#ifndef __IMMAP_8XX__13#define __IMMAP_8XX__1415/* System configuration registers.16*/17typedef struct sys_conf {18uint sc_siumcr;19uint sc_sypcr;20uint sc_swt;21char res1[2];22ushort sc_swsr;23uint sc_sipend;24uint sc_simask;25uint sc_siel;26uint sc_sivec;27uint sc_tesr;28char res2[0xc];29uint sc_sdcr;30char res3[0x4c];31} sysconf8xx_t;3233/* PCMCIA configuration registers.34*/35typedef struct pcmcia_conf {36uint pcmc_pbr0;37uint pcmc_por0;38uint pcmc_pbr1;39uint pcmc_por1;40uint pcmc_pbr2;41uint pcmc_por2;42uint pcmc_pbr3;43uint pcmc_por3;44uint pcmc_pbr4;45uint pcmc_por4;46uint pcmc_pbr5;47uint pcmc_por5;48uint pcmc_pbr6;49uint pcmc_por6;50uint pcmc_pbr7;51uint pcmc_por7;52char res1[0x20];53uint pcmc_pgcra;54uint pcmc_pgcrb;55uint pcmc_pscr;56char res2[4];57uint pcmc_pipr;58char res3[4];59uint pcmc_per;60char res4[4];61} pcmconf8xx_t;6263/* Memory controller registers.64*/65typedef struct mem_ctlr {66uint memc_br0;67uint memc_or0;68uint memc_br1;69uint memc_or1;70uint memc_br2;71uint memc_or2;72uint memc_br3;73uint memc_or3;74uint memc_br4;75uint memc_or4;76uint memc_br5;77uint memc_or5;78uint memc_br6;79uint memc_or6;80uint memc_br7;81uint memc_or7;82char res1[0x24];83uint memc_mar;84uint memc_mcr;85char res2[4];86uint memc_mamr;87uint memc_mbmr;88ushort memc_mstat;89ushort memc_mptpr;90uint memc_mdr;91char res3[0x80];92} memctl8xx_t;9394/*-----------------------------------------------------------------------95* BR - Memory Controller: Base Register 16-996*/97#define BR_BA_MSK 0xffff8000 /* Base Address Mask */98#define BR_AT_MSK 0x00007000 /* Address Type Mask */99#define BR_PS_MSK 0x00000c00 /* Port Size Mask */100#define BR_PS_32 0x00000000 /* 32 bit port size */101#define BR_PS_16 0x00000800 /* 16 bit port size */102#define BR_PS_8 0x00000400 /* 8 bit port size */103#define BR_PARE 0x00000200 /* Parity Enable */104#define BR_WP 0x00000100 /* Write Protect */105#define BR_MS_MSK 0x000000c0 /* Machine Select Mask */106#define BR_MS_GPCM 0x00000000 /* G.P.C.M. Machine Select */107#define BR_MS_UPMA 0x00000080 /* U.P.M.A Machine Select */108#define BR_MS_UPMB 0x000000c0 /* U.P.M.B Machine Select */109#define BR_V 0x00000001 /* Bank Valid */110111/*-----------------------------------------------------------------------112* OR - Memory Controller: Option Register 16-11113*/114#define OR_AM_MSK 0xffff8000 /* Address Mask Mask */115#define OR_ATM_MSK 0x00007000 /* Address Type Mask Mask */116#define OR_CSNT_SAM 0x00000800 /* Chip Select Negation Time/ Start */117/* Address Multiplex */118#define OR_ACS_MSK 0x00000600 /* Address to Chip Select Setup mask */119#define OR_ACS_DIV1 0x00000000 /* CS is output at the same time */120#define OR_ACS_DIV4 0x00000400 /* CS is output 1/4 a clock later */121#define OR_ACS_DIV2 0x00000600 /* CS is output 1/2 a clock later */122#define OR_G5LA 0x00000400 /* Output #GPL5 on #GPL_A5 */123#define OR_G5LS 0x00000200 /* Drive #GPL high on falling edge of...*/124#define OR_BI 0x00000100 /* Burst inhibit */125#define OR_SCY_MSK 0x000000f0 /* Cycle Length in Clocks */126#define OR_SCY_0_CLK 0x00000000 /* 0 clock cycles wait states */127#define OR_SCY_1_CLK 0x00000010 /* 1 clock cycles wait states */128#define OR_SCY_2_CLK 0x00000020 /* 2 clock cycles wait states */129#define OR_SCY_3_CLK 0x00000030 /* 3 clock cycles wait states */130#define OR_SCY_4_CLK 0x00000040 /* 4 clock cycles wait states */131#define OR_SCY_5_CLK 0x00000050 /* 5 clock cycles wait states */132#define OR_SCY_6_CLK 0x00000060 /* 6 clock cycles wait states */133#define OR_SCY_7_CLK 0x00000070 /* 7 clock cycles wait states */134#define OR_SCY_8_CLK 0x00000080 /* 8 clock cycles wait states */135#define OR_SCY_9_CLK 0x00000090 /* 9 clock cycles wait states */136#define OR_SCY_10_CLK 0x000000a0 /* 10 clock cycles wait states */137#define OR_SCY_11_CLK 0x000000b0 /* 11 clock cycles wait states */138#define OR_SCY_12_CLK 0x000000c0 /* 12 clock cycles wait states */139#define OR_SCY_13_CLK 0x000000d0 /* 13 clock cycles wait states */140#define OR_SCY_14_CLK 0x000000e0 /* 14 clock cycles wait states */141#define OR_SCY_15_CLK 0x000000f0 /* 15 clock cycles wait states */142#define OR_SETA 0x00000008 /* External Transfer Acknowledge */143#define OR_TRLX 0x00000004 /* Timing Relaxed */144#define OR_EHTR 0x00000002 /* Extended Hold Time on Read */145146/* System Integration Timers.147*/148typedef struct sys_int_timers {149ushort sit_tbscr;150char res0[0x02];151uint sit_tbreff0;152uint sit_tbreff1;153char res1[0x14];154ushort sit_rtcsc;155char res2[0x02];156uint sit_rtc;157uint sit_rtsec;158uint sit_rtcal;159char res3[0x10];160ushort sit_piscr;161char res4[2];162uint sit_pitc;163uint sit_pitr;164char res5[0x34];165} sit8xx_t;166167#define TBSCR_TBIRQ_MASK ((ushort)0xff00)168#define TBSCR_REFA ((ushort)0x0080)169#define TBSCR_REFB ((ushort)0x0040)170#define TBSCR_REFAE ((ushort)0x0008)171#define TBSCR_REFBE ((ushort)0x0004)172#define TBSCR_TBF ((ushort)0x0002)173#define TBSCR_TBE ((ushort)0x0001)174175#define RTCSC_RTCIRQ_MASK ((ushort)0xff00)176#define RTCSC_SEC ((ushort)0x0080)177#define RTCSC_ALR ((ushort)0x0040)178#define RTCSC_38K ((ushort)0x0010)179#define RTCSC_SIE ((ushort)0x0008)180#define RTCSC_ALE ((ushort)0x0004)181#define RTCSC_RTF ((ushort)0x0002)182#define RTCSC_RTE ((ushort)0x0001)183184#define PISCR_PIRQ_MASK ((ushort)0xff00)185#define PISCR_PS ((ushort)0x0080)186#define PISCR_PIE ((ushort)0x0004)187#define PISCR_PTF ((ushort)0x0002)188#define PISCR_PTE ((ushort)0x0001)189190/* Clocks and Reset.191*/192typedef struct clk_and_reset {193uint car_sccr;194uint car_plprcr;195uint car_rsr;196char res[0x74]; /* Reserved area */197} car8xx_t;198199/* System Integration Timers keys.200*/201typedef struct sitk {202uint sitk_tbscrk;203uint sitk_tbreff0k;204uint sitk_tbreff1k;205uint sitk_tbk;206char res1[0x10];207uint sitk_rtcsck;208uint sitk_rtck;209uint sitk_rtseck;210uint sitk_rtcalk;211char res2[0x10];212uint sitk_piscrk;213uint sitk_pitck;214char res3[0x38];215} sitk8xx_t;216217/* Clocks and reset keys.218*/219typedef struct cark {220uint cark_sccrk;221uint cark_plprcrk;222uint cark_rsrk;223char res[0x474];224} cark8xx_t;225226/* The key to unlock registers maintained by keep-alive power.227*/228#define KAPWR_KEY ((unsigned int)0x55ccaa33)229230/* Video interface. MPC823 Only.231*/232typedef struct vid823 {233ushort vid_vccr;234ushort res1;235u_char vid_vsr;236u_char res2;237u_char vid_vcmr;238u_char res3;239uint vid_vbcb;240uint res4;241uint vid_vfcr0;242uint vid_vfaa0;243uint vid_vfba0;244uint vid_vfcr1;245uint vid_vfaa1;246uint vid_vfba1;247u_char res5[0x18];248} vid823_t;249250/* LCD interface. 823 Only.251*/252typedef struct lcd {253uint lcd_lccr;254uint lcd_lchcr;255uint lcd_lcvcr;256char res1[4];257uint lcd_lcfaa;258uint lcd_lcfba;259char lcd_lcsr;260char res2[0x7];261} lcd823_t;262263/* I2C264*/265typedef struct i2c {266u_char i2c_i2mod;267char res1[3];268u_char i2c_i2add;269char res2[3];270u_char i2c_i2brg;271char res3[3];272u_char i2c_i2com;273char res4[3];274u_char i2c_i2cer;275char res5[3];276u_char i2c_i2cmr;277char res6[0x8b];278} i2c8xx_t;279280/* DMA control/status registers.281*/282typedef struct sdma_csr {283char res1[4];284uint sdma_sdar;285u_char sdma_sdsr;286char res3[3];287u_char sdma_sdmr;288char res4[3];289u_char sdma_idsr1;290char res5[3];291u_char sdma_idmr1;292char res6[3];293u_char sdma_idsr2;294char res7[3];295u_char sdma_idmr2;296char res8[0x13];297} sdma8xx_t;298299/* Communication Processor Module Interrupt Controller.300*/301typedef struct cpm_ic {302ushort cpic_civr;303char res[0xe];304uint cpic_cicr;305uint cpic_cipr;306uint cpic_cimr;307uint cpic_cisr;308} cpic8xx_t;309310/* Input/Output Port control/status registers.311*/312typedef struct io_port {313ushort iop_padir;314ushort iop_papar;315ushort iop_paodr;316ushort iop_padat;317char res1[8];318ushort iop_pcdir;319ushort iop_pcpar;320ushort iop_pcso;321ushort iop_pcdat;322ushort iop_pcint;323char res2[6];324ushort iop_pddir;325ushort iop_pdpar;326char res3[2];327ushort iop_pddat;328uint utmode;329char res4[4];330} iop8xx_t;331332/* Communication Processor Module Timers333*/334typedef struct cpm_timers {335ushort cpmt_tgcr;336char res1[0xe];337ushort cpmt_tmr1;338ushort cpmt_tmr2;339ushort cpmt_trr1;340ushort cpmt_trr2;341ushort cpmt_tcr1;342ushort cpmt_tcr2;343ushort cpmt_tcn1;344ushort cpmt_tcn2;345ushort cpmt_tmr3;346ushort cpmt_tmr4;347ushort cpmt_trr3;348ushort cpmt_trr4;349ushort cpmt_tcr3;350ushort cpmt_tcr4;351ushort cpmt_tcn3;352ushort cpmt_tcn4;353ushort cpmt_ter1;354ushort cpmt_ter2;355ushort cpmt_ter3;356ushort cpmt_ter4;357char res2[8];358} cpmtimer8xx_t;359360/* Finally, the Communication Processor stuff.....361*/362typedef struct scc { /* Serial communication channels */363uint scc_gsmrl;364uint scc_gsmrh;365ushort scc_psmr;366char res1[2];367ushort scc_todr;368ushort scc_dsr;369ushort scc_scce;370char res2[2];371ushort scc_sccm;372char res3;373u_char scc_sccs;374char res4[8];375} scc_t;376377typedef struct smc { /* Serial management channels */378char res1[2];379ushort smc_smcmr;380char res2[2];381u_char smc_smce;382char res3[3];383u_char smc_smcm;384char res4[5];385} smc_t;386387/* MPC860T Fast Ethernet Controller. It isn't part of the CPM, but388* it fits within the address space.389*/390391typedef struct fec {392uint fec_addr_low; /* lower 32 bits of station address */393ushort fec_addr_high; /* upper 16 bits of station address */394ushort res1; /* reserved */395uint fec_grp_hash_table_high; /* upper 32-bits of hash table */396uint fec_grp_hash_table_low; /* lower 32-bits of hash table */397uint fec_r_des_start; /* beginning of Rx descriptor ring */398uint fec_x_des_start; /* beginning of Tx descriptor ring */399uint fec_r_buff_size; /* Rx buffer size */400uint res2[9]; /* reserved */401uint fec_ecntrl; /* ethernet control register */402uint fec_ievent; /* interrupt event register */403uint fec_imask; /* interrupt mask register */404uint fec_ivec; /* interrupt level and vector status */405uint fec_r_des_active; /* Rx ring updated flag */406uint fec_x_des_active; /* Tx ring updated flag */407uint res3[10]; /* reserved */408uint fec_mii_data; /* MII data register */409uint fec_mii_speed; /* MII speed control register */410uint res4[17]; /* reserved */411uint fec_r_bound; /* end of RAM (read-only) */412uint fec_r_fstart; /* Rx FIFO start address */413uint res5[6]; /* reserved */414uint fec_x_fstart; /* Tx FIFO start address */415uint res6[17]; /* reserved */416uint fec_fun_code; /* fec SDMA function code */417uint res7[3]; /* reserved */418uint fec_r_cntrl; /* Rx control register */419uint fec_r_hash; /* Rx hash register */420uint res8[14]; /* reserved */421uint fec_x_cntrl; /* Tx control register */422uint res9[0x1e]; /* reserved */423} fec_t;424425/* The FEC and LCD color map share the same address space....426* I guess we will never see an 823T :-).427*/428union fec_lcd {429fec_t fl_un_fec;430u_char fl_un_cmap[0x200];431};432433typedef struct comm_proc {434/* General control and status registers.435*/436ushort cp_cpcr;437u_char res1[2];438ushort cp_rccr;439u_char res2;440u_char cp_rmds;441u_char res3[4];442ushort cp_cpmcr1;443ushort cp_cpmcr2;444ushort cp_cpmcr3;445ushort cp_cpmcr4;446u_char res4[2];447ushort cp_rter;448u_char res5[2];449ushort cp_rtmr;450u_char res6[0x14];451452/* Baud rate generators.453*/454uint cp_brgc1;455uint cp_brgc2;456uint cp_brgc3;457uint cp_brgc4;458459/* Serial Communication Channels.460*/461scc_t cp_scc[4];462463/* Serial Management Channels.464*/465smc_t cp_smc[2];466467/* Serial Peripheral Interface.468*/469ushort cp_spmode;470u_char res7[4];471u_char cp_spie;472u_char res8[3];473u_char cp_spim;474u_char res9[2];475u_char cp_spcom;476u_char res10[2];477478/* Parallel Interface Port.479*/480u_char res11[2];481ushort cp_pipc;482u_char res12[2];483ushort cp_ptpr;484uint cp_pbdir;485uint cp_pbpar;486u_char res13[2];487ushort cp_pbodr;488uint cp_pbdat;489490/* Port E - MPC87x/88x only.491*/492uint cp_pedir;493uint cp_pepar;494uint cp_peso;495uint cp_peodr;496uint cp_pedat;497498/* Communications Processor Timing Register -499Contains RMII Timing for the FECs on MPC87x/88x only.500*/501uint cp_cptr;502503/* Serial Interface and Time Slot Assignment.504*/505uint cp_simode;506u_char cp_sigmr;507u_char res15;508u_char cp_sistr;509u_char cp_sicmr;510u_char res16[4];511uint cp_sicr;512uint cp_sirp;513u_char res17[0xc];514515/* 256 bytes of MPC823 video controller RAM array.516*/517u_char cp_vcram[0x100];518u_char cp_siram[0x200];519520/* The fast ethernet controller is not really part of the CPM,521* but it resides in the address space.522* The LCD color map is also here.523*/524union fec_lcd fl_un;525#define cp_fec fl_un.fl_un_fec526#define lcd_cmap fl_un.fl_un_cmap527char res18[0xE00];528529/* The DUET family has a second FEC here */530fec_t cp_fec2;531#define cp_fec1 cp_fec /* consistency macro */532533/* Dual Ported RAM follows.534* There are many different formats for this memory area535* depending upon the devices used and options chosen.536* Some processors don't have all of it populated.537*/538u_char cp_dpmem[0x1C00]; /* BD / Data / ucode */539u_char cp_dparam[0x400]; /* Parameter RAM */540} cpm8xx_t;541542/* Internal memory map.543*/544typedef struct immap {545sysconf8xx_t im_siu_conf; /* SIU Configuration */546pcmconf8xx_t im_pcmcia; /* PCMCIA Configuration */547memctl8xx_t im_memctl; /* Memory Controller */548sit8xx_t im_sit; /* System integration timers */549car8xx_t im_clkrst; /* Clocks and reset */550sitk8xx_t im_sitk; /* Sys int timer keys */551cark8xx_t im_clkrstk; /* Clocks and reset keys */552vid823_t im_vid; /* Video (823 only) */553lcd823_t im_lcd; /* LCD (823 only) */554i2c8xx_t im_i2c; /* I2C control/status */555sdma8xx_t im_sdma; /* SDMA control/status */556cpic8xx_t im_cpic; /* CPM Interrupt Controller */557iop8xx_t im_ioport; /* IO Port control/status */558cpmtimer8xx_t im_cpmtimer; /* CPM timers */559cpm8xx_t im_cpm; /* Communication processor */560} immap_t;561562#endif /* __IMMAP_8XX__ */563#endif /* __KERNEL__ */564565566