8xx_immap.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:9k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * BK Id: SCCS/s.8xx_immap.h 1.5 05/17/01 18:14:24 cort
  3.  */
  4. /*
  5.  * MPC8xx Internal Memory Map
  6.  * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
  7.  *
  8.  * The I/O on the MPC860 is comprised of blocks of special registers
  9.  * and the dual port ram for the Communication Processor Module.
  10.  * Within this space are functional units such as the SIU, memory
  11.  * controller, system timers, and other control functions.  It is
  12.  * a combination that I found difficult to separate into logical
  13.  * functional files.....but anyone else is welcome to try.  -- Dan
  14.  */
  15. #ifdef __KERNEL__
  16. #ifndef __IMMAP_8XX__
  17. #define __IMMAP_8XX__
  18. /* System configuration registers.
  19. */
  20. typedef struct sys_conf {
  21. uint sc_siumcr;
  22. uint sc_sypcr;
  23. uint sc_swt;
  24. char res1[2];
  25. ushort sc_swsr;
  26. uint sc_sipend;
  27. uint sc_simask;
  28. uint sc_siel;
  29. uint sc_sivec;
  30. uint sc_tesr;
  31. char res2[0xc];
  32. uint sc_sdcr;
  33. char res3[0x4c];
  34. } sysconf8xx_t;
  35. /* PCMCIA configuration registers.
  36. */
  37. typedef struct pcmcia_conf {
  38. uint pcmc_pbr0;
  39. uint pcmc_por0;
  40. uint pcmc_pbr1;
  41. uint pcmc_por1;
  42. uint pcmc_pbr2;
  43. uint pcmc_por2;
  44. uint pcmc_pbr3;
  45. uint pcmc_por3;
  46. uint pcmc_pbr4;
  47. uint pcmc_por4;
  48. uint pcmc_pbr5;
  49. uint pcmc_por5;
  50. uint pcmc_pbr6;
  51. uint pcmc_por6;
  52. uint pcmc_pbr7;
  53. uint pcmc_por7;
  54. char res1[0x20];
  55. uint pcmc_pgcra;
  56. uint pcmc_pgcrb;
  57. uint pcmc_pscr;
  58. char res2[4];
  59. uint pcmc_pipr;
  60. char res3[4];
  61. uint pcmc_per;
  62. char res4[4];
  63. } pcmconf8xx_t;
  64. /* Memory controller registers.
  65. */
  66. typedef struct mem_ctlr {
  67. uint memc_br0;
  68. uint memc_or0;
  69. uint memc_br1;
  70. uint memc_or1;
  71. uint memc_br2;
  72. uint memc_or2;
  73. uint memc_br3;
  74. uint memc_or3;
  75. uint memc_br4;
  76. uint memc_or4;
  77. uint memc_br5;
  78. uint memc_or5;
  79. uint memc_br6;
  80. uint memc_or6;
  81. uint memc_br7;
  82. uint memc_or7;
  83. char res1[0x24];
  84. uint memc_mar;
  85. uint memc_mcr;
  86. char res2[4];
  87. uint memc_mamr;
  88. uint memc_mbmr;
  89. ushort memc_mstat;
  90. ushort memc_mptpr;
  91. uint memc_mdr;
  92. char res3[0x80];
  93. } memctl8xx_t;
  94. /* System Integration Timers.
  95. */
  96. typedef struct sys_int_timers {
  97. ushort sit_tbscr;
  98. uint sit_tbreff0;
  99. uint sit_tbreff1;
  100. char res1[0x14];
  101. ushort sit_rtcsc;
  102. uint sit_rtc;
  103. uint sit_rtsec;
  104. uint sit_rtcal;
  105. char res2[0x10];
  106. ushort sit_piscr;
  107. char res3[2];
  108. uint sit_pitc;
  109. uint sit_pitr;
  110. char res4[0x34];
  111. } sit8xx_t;
  112. #define TBSCR_TBIRQ_MASK ((ushort)0xff00)
  113. #define TBSCR_REFA ((ushort)0x0080)
  114. #define TBSCR_REFB ((ushort)0x0040)
  115. #define TBSCR_REFAE ((ushort)0x0008)
  116. #define TBSCR_REFBE ((ushort)0x0004)
  117. #define TBSCR_TBF ((ushort)0x0002)
  118. #define TBSCR_TBE ((ushort)0x0001)
  119. #define RTCSC_RTCIRQ_MASK ((ushort)0xff00)
  120. #define RTCSC_SEC ((ushort)0x0080)
  121. #define RTCSC_ALR ((ushort)0x0040)
  122. #define RTCSC_38K ((ushort)0x0010)
  123. #define RTCSC_SIE ((ushort)0x0008)
  124. #define RTCSC_ALE ((ushort)0x0004)
  125. #define RTCSC_RTF ((ushort)0x0002)
  126. #define RTCSC_RTE ((ushort)0x0001)
  127. #define PISCR_PIRQ_MASK ((ushort)0xff00)
  128. #define PISCR_PS ((ushort)0x0080)
  129. #define PISCR_PIE ((ushort)0x0004)
  130. #define PISCR_PTF ((ushort)0x0002)
  131. #define PISCR_PTE ((ushort)0x0001)
  132. /* Clocks and Reset.
  133. */
  134. typedef struct clk_and_reset {
  135. uint car_sccr;
  136. uint car_plprcr;
  137. uint car_rsr;
  138. char res[0x74];        /* Reserved area                  */
  139. } car8xx_t;
  140. /* System Integration Timers keys.
  141. */
  142. typedef struct sitk {
  143. uint sitk_tbscrk;
  144. uint sitk_tbreff0k;
  145. uint sitk_tbreff1k;
  146. uint sitk_tbk;
  147. char res1[0x10];
  148. uint sitk_rtcsck;
  149. uint sitk_rtck;
  150. uint sitk_rtseck;
  151. uint sitk_rtcalk;
  152. char res2[0x10];
  153. uint sitk_piscrk;
  154. uint sitk_pitck;
  155. char res3[0x38];
  156. } sitk8xx_t;
  157. /* Clocks and reset keys.
  158. */
  159. typedef struct cark {
  160. uint cark_sccrk;
  161. uint cark_plprcrk;
  162. uint cark_rsrk;
  163. char res[0x474];
  164. } cark8xx_t;
  165. /* The key to unlock registers maintained by keep-alive power.
  166. */
  167. #define KAPWR_KEY ((unsigned int)0x55ccaa33)
  168. /* LCD interface.  MPC821 Only.
  169. */
  170. typedef struct lcd {
  171. ushort lcd_lcolr[16];
  172. char res[0x20];
  173. uint lcd_lccr;
  174. uint lcd_lchcr;
  175. uint lcd_lcvcr;
  176. char res2[4];
  177. uint lcd_lcfaa;
  178. uint lcd_lcfba;
  179. char lcd_lcsr;
  180. char res3[0x7];
  181. } lcd8xx_t;
  182. /* I2C
  183. */
  184. typedef struct i2c {
  185. u_char i2c_i2mod;
  186. char res1[3];
  187. u_char i2c_i2add;
  188. char res2[3];
  189. u_char i2c_i2brg;
  190. char res3[3];
  191. u_char i2c_i2com;
  192. char res4[3];
  193. u_char i2c_i2cer;
  194. char res5[3];
  195. u_char i2c_i2cmr;
  196. char res6[0x8b];
  197. } i2c8xx_t;
  198. /* DMA control/status registers.
  199. */
  200. typedef struct sdma_csr {
  201. char res1[4];
  202. uint sdma_sdar;
  203. u_char sdma_sdsr;
  204. char res3[3];
  205. u_char sdma_sdmr;
  206. char res4[3];
  207. u_char sdma_idsr1;
  208. char res5[3];
  209. u_char sdma_idmr1;
  210. char res6[3];
  211. u_char sdma_idsr2;
  212. char res7[3];
  213. u_char sdma_idmr2;
  214. char res8[0x13];
  215. } sdma8xx_t;
  216. /* Communication Processor Module Interrupt Controller.
  217. */
  218. typedef struct cpm_ic {
  219. ushort cpic_civr;
  220. char res[0xe];
  221. uint cpic_cicr;
  222. uint cpic_cipr;
  223. uint cpic_cimr;
  224. uint cpic_cisr;
  225. } cpic8xx_t;
  226. /* Input/Output Port control/status registers.
  227. */
  228. typedef struct io_port {
  229. ushort iop_padir;
  230. ushort iop_papar;
  231. ushort iop_paodr;
  232. ushort iop_padat;
  233. char res1[8];
  234. ushort iop_pcdir;
  235. ushort iop_pcpar;
  236. ushort iop_pcso;
  237. ushort iop_pcdat;
  238. ushort iop_pcint;
  239. char res2[6];
  240. ushort iop_pddir;
  241. ushort iop_pdpar;
  242. char res3[2];
  243. ushort iop_pddat;
  244. char res4[8];
  245. } iop8xx_t;
  246. /* Communication Processor Module Timers
  247. */
  248. typedef struct cpm_timers {
  249. ushort cpmt_tgcr;
  250. char res1[0xe];
  251. ushort cpmt_tmr1;
  252. ushort cpmt_tmr2;
  253. ushort cpmt_trr1;
  254. ushort cpmt_trr2;
  255. ushort cpmt_tcr1;
  256. ushort cpmt_tcr2;
  257. ushort cpmt_tcn1;
  258. ushort cpmt_tcn2;
  259. ushort cpmt_tmr3;
  260. ushort cpmt_tmr4;
  261. ushort cpmt_trr3;
  262. ushort cpmt_trr4;
  263. ushort cpmt_tcr3;
  264. ushort cpmt_tcr4;
  265. ushort cpmt_tcn3;
  266. ushort cpmt_tcn4;
  267. ushort cpmt_ter1;
  268. ushort cpmt_ter2;
  269. ushort cpmt_ter3;
  270. ushort cpmt_ter4;
  271. char res2[8];
  272. } cpmtimer8xx_t;
  273. /* Finally, the Communication Processor stuff.....
  274. */
  275. typedef struct scc { /* Serial communication channels */
  276. uint scc_gsmrl;
  277. uint scc_gsmrh;
  278. ushort scc_pmsr;
  279. char res1[2];
  280. ushort scc_todr;
  281. ushort scc_dsr;
  282. ushort scc_scce;
  283. char res2[2];
  284. ushort scc_sccm;
  285. char res3;
  286. u_char scc_sccs;
  287. char res4[8];
  288. } scc_t;
  289. typedef struct smc { /* Serial management channels */
  290. char res1[2];
  291. ushort smc_smcmr;
  292. char res2[2];
  293. u_char smc_smce;
  294. char res3[3];
  295. u_char smc_smcm;
  296. char res4[5];
  297. } smc_t;
  298. /* MPC860T Fast Ethernet Controller.  It isn't part of the CPM, but
  299.  * it fits within the address space.
  300.  */
  301. typedef struct fec {
  302. uint fec_addr_low; /* LS 32 bits of station address */
  303. ushort fec_addr_high; /* MS 16 bits of address */
  304. ushort res1;
  305. uint fec_hash_table_high;
  306. uint fec_hash_table_low;
  307. uint fec_r_des_start;
  308. uint fec_x_des_start;
  309. uint fec_r_buff_size;
  310. uint res2[9];
  311. uint fec_ecntrl;
  312. uint fec_ievent;
  313. uint fec_imask;
  314. uint fec_ivec;
  315. uint fec_r_des_active;
  316. uint fec_x_des_active;
  317. uint res3[10];
  318. uint fec_mii_data;
  319. uint fec_mii_speed;
  320. uint res4[17];
  321. uint fec_r_bound;
  322. uint fec_r_fstart;
  323. uint res5[6];
  324. uint fec_x_fstart;
  325. uint res6[17];
  326. uint fec_fun_code;
  327. uint res7[3];
  328. uint fec_r_cntrl;
  329. uint fec_r_hash;
  330. uint res8[14];
  331. uint fec_x_cntrl;
  332. uint res9[0x1e];
  333. } fec_t;
  334. typedef struct comm_proc {
  335. /* General control and status registers.
  336. */
  337. ushort cp_cpcr;
  338. char res1[2];
  339. ushort cp_rccr;
  340. char res2[6];
  341. ushort cp_cpmcr1;
  342. ushort cp_cpmcr2;
  343. ushort cp_cpmcr3;
  344. ushort cp_cpmcr4;
  345. char res3[2];
  346. ushort cp_rter;
  347. char res4[2];
  348. ushort cp_rtmr;
  349. char res5[0x14];
  350. /* Baud rate generators.
  351. */
  352. uint cp_brgc1;
  353. uint cp_brgc2;
  354. uint cp_brgc3;
  355. uint cp_brgc4;
  356. /* Serial Communication Channels.
  357. */
  358. scc_t cp_scc[4];
  359. /* Serial Management Channels.
  360. */
  361. smc_t cp_smc[2];
  362. /* Serial Peripheral Interface.
  363. */
  364. ushort cp_spmode;
  365. char res6[4];
  366. u_char cp_spie;
  367. char res7[3];
  368. u_char cp_spim;
  369. char res8[2];
  370. u_char cp_spcom;
  371. char res9[2];
  372. /* Parallel Interface Port.
  373. */
  374. char res10[2];
  375. ushort cp_pipc;
  376. char res11[2];
  377. ushort cp_ptpr;
  378. uint cp_pbdir;
  379. uint cp_pbpar;
  380. char res12[2];
  381. ushort cp_pbodr;
  382. uint cp_pbdat;
  383. char res13[0x18];
  384. /* Serial Interface and Time Slot Assignment.
  385. */
  386. uint cp_simode;
  387. u_char cp_sigmr;
  388. char res14;
  389. u_char cp_sistr;
  390. u_char cp_sicmr;
  391. char res15[4];
  392. uint cp_sicr;
  393. uint cp_sirp;
  394. char res16[0x10c];
  395. u_char cp_siram[0x200];
  396. /* The fast ethernet controller is not really part of the CPM,
  397.  * but it resides in the address space.
  398.  */
  399. fec_t cp_fec;
  400. char res18[0x1000];
  401. /* Dual Ported RAM follows.
  402.  * There are many different formats for this memory area
  403.  * depending upon the devices used and options chosen.
  404.  */
  405. u_char cp_dpmem[0x1000]; /* BD / Data / ucode */
  406. u_char res19[0xc00];
  407. u_char cp_dparam[0x400]; /* Parameter RAM */
  408. } cpm8xx_t;
  409. /* Internal memory map.
  410. */
  411. typedef struct immap {
  412. sysconf8xx_t im_siu_conf; /* SIU Configuration */
  413. pcmconf8xx_t im_pcmcia; /* PCMCIA Configuration */
  414. memctl8xx_t im_memctl; /* Memory Controller */
  415. sit8xx_t im_sit; /* System integration timers */
  416. car8xx_t im_clkrst; /* Clocks and reset */
  417. sitk8xx_t im_sitk; /* Sys int timer keys */
  418. cark8xx_t im_clkrstk; /* Clocks and reset keys */
  419. lcd8xx_t im_lcd; /* LCD (821 only) */
  420. i2c8xx_t im_i2c; /* I2C control/status */
  421. sdma8xx_t im_sdma; /* SDMA control/status */
  422. cpic8xx_t im_cpic; /* CPM Interrupt Controller */
  423. iop8xx_t im_ioport; /* IO Port control/status */
  424. cpmtimer8xx_t im_cpmtimer; /* CPM timers */
  425. cpm8xx_t im_cpm; /* Communication processor */
  426. } immap_t;
  427. #endif /* __IMMAP_8XX__ */
  428. #endif /* __KERNEL__ */