8xx_immap.h 14 KB

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