immap_5272.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. /*
  2. * MCF5272 Internal Memory Map
  3. *
  4. * Copyright (c) 2003 Josef Baumgartner <josef.baumgartner@telex.de>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #ifndef __IMMAP_5272__
  25. #define __IMMAP_5272__
  26. /* System configuration registers
  27. */
  28. typedef struct sys_ctrl {
  29. uint sc_mbar;
  30. ushort sc_scr;
  31. ushort sc_spr;
  32. uint sc_pmr;
  33. char res1[2];
  34. ushort sc_alpr;
  35. uint sc_dir;
  36. char res2[12];
  37. } sysctrl_t;
  38. /* Interrupt module registers
  39. */
  40. typedef struct int_ctrl {
  41. uint int_icr1;
  42. uint int_icr2;
  43. uint int_icr3;
  44. uint int_icr4;
  45. uint int_isr;
  46. uint int_pitr;
  47. uint int_piwr;
  48. uchar res1[3];
  49. uchar int_pivr;
  50. } intctrl_t;
  51. /* Chip select module registers.
  52. */
  53. typedef struct cs_ctlr {
  54. uint cs_br0;
  55. uint cs_or0;
  56. uint cs_br1;
  57. uint cs_or1;
  58. uint cs_br2;
  59. uint cs_or2;
  60. uint cs_br3;
  61. uint cs_or3;
  62. uint cs_br4;
  63. uint cs_or4;
  64. uint cs_br5;
  65. uint cs_or5;
  66. uint cs_br6;
  67. uint cs_or6;
  68. uint cs_br7;
  69. uint cs_or7;
  70. } csctrl_t;
  71. /* GPIO port registers
  72. */
  73. typedef struct gpio_ctrl {
  74. uint gpio_pacnt;
  75. ushort gpio_paddr;
  76. ushort gpio_padat;
  77. uint gpio_pbcnt;
  78. ushort gpio_pbddr;
  79. ushort gpio_pbdat;
  80. uchar res1[4];
  81. ushort gpio_pcddr;
  82. ushort gpio_pcdat;
  83. uint gpio_pdcnt;
  84. uchar res2[4];
  85. } gpio_t;
  86. /* QSPI module registers
  87. */
  88. typedef struct qspi_ctrl {
  89. ushort qspi_qmr;
  90. uchar res1[2];
  91. ushort qspi_qdlyr;
  92. uchar res2[2];
  93. ushort qspi_qwr;
  94. uchar res3[2];
  95. ushort qspi_qir;
  96. uchar res4[2];
  97. ushort qspi_qar;
  98. uchar res5[2];
  99. ushort qspi_qdr;
  100. uchar res6[10];
  101. } qspi_t;
  102. /* PWM module registers
  103. */
  104. typedef struct pwm_ctrl {
  105. uchar pwm_pwcr0;
  106. uchar res1[3];
  107. uchar pwm_pwcr1;
  108. uchar res2[3];
  109. uchar pwm_pwcr2;
  110. uchar res3[7];
  111. uchar pwm_pwwd0;
  112. uchar res4[3];
  113. uchar pwm_pwwd1;
  114. uchar res5[3];
  115. uchar pwm_pwwd2;
  116. uchar res6[7];
  117. } pwm_t;
  118. /* DMA module registers
  119. */
  120. typedef struct dma_ctrl {
  121. ulong dma_dmr;
  122. uchar res1[2];
  123. ushort dma_dir;
  124. ulong dma_dbcr;
  125. ulong dma_dsar;
  126. ulong dma_ddar;
  127. uchar res2[12];
  128. } dma_t;
  129. /* UART module registers
  130. */
  131. typedef struct uart_ctrl {
  132. uchar uart_umr;
  133. uchar res1[3];
  134. uchar uart_usr_ucsr;
  135. uchar res2[3];
  136. uchar uart_ucr;
  137. uchar res3[3];
  138. uchar uart_urb_utb;
  139. uchar res4[3];
  140. uchar uart_uipcr_uacr;
  141. uchar res5[3];
  142. uchar uart_uisr_uimr;
  143. uchar res6[3];
  144. uchar uart_udu;
  145. uchar res7[3];
  146. uchar uart_udl;
  147. uchar res8[3];
  148. uchar uart_uabu;
  149. uchar res9[3];
  150. uchar uart_uabl;
  151. uchar res10[3];
  152. uchar uart_utf;
  153. uchar res11[3];
  154. uchar uart_urf;
  155. uchar res12[3];
  156. uchar uart_ufpd;
  157. uchar res13[3];
  158. uchar uart_uip;
  159. uchar res14[3];
  160. uchar uart_uop1;
  161. uchar res15[3];
  162. uchar uart_uop0;
  163. uchar res16[3];
  164. } uart_t;
  165. /* SDRAM controller registers, offset: 0x180
  166. */
  167. typedef struct sdram_ctrl {
  168. uchar res1[2];
  169. ushort sdram_sdcr;
  170. uchar res2[2];
  171. ushort sdram_sdtr;
  172. uchar res3[120];
  173. } sdramctrl_t;
  174. /* Timer module registers
  175. */
  176. typedef struct timer_ctrl {
  177. ushort timer_tmr;
  178. ushort res1;
  179. ushort timer_trr;
  180. ushort res2;
  181. ushort timer_tcap;
  182. ushort res3;
  183. ushort timer_tcn;
  184. ushort res4;
  185. ushort timer_ter;
  186. uchar res5[14];
  187. } timer_t;
  188. /* Watchdog registers
  189. */
  190. typedef struct wdog_ctrl {
  191. ushort wdog_wrrr;
  192. ushort res1;
  193. ushort wdog_wirr;
  194. ushort res2;
  195. ushort wdog_wcr;
  196. ushort res3;
  197. ushort wdog_wer;
  198. uchar res4[114];
  199. } wdog_t;
  200. /* PLIC module registers
  201. */
  202. typedef struct plic_ctrl {
  203. ulong plic_p0b1rr;
  204. ulong plic_p1b1rr;
  205. ulong plic_p2b1rr;
  206. ulong plic_p3b1rr;
  207. ulong plic_p0b2rr;
  208. ulong plic_p1b2rr;
  209. ulong plic_p2b2rr;
  210. ulong plic_p3b2rr;
  211. uchar plic_p0drr;
  212. uchar plic_p1drr;
  213. uchar plic_p2drr;
  214. uchar plic_p3drr;
  215. uchar res1[4];
  216. ulong plic_p0b1tr;
  217. ulong plic_p1b1tr;
  218. ulong plic_p2b1tr;
  219. ulong plic_p3b1tr;
  220. ulong plic_p0b2tr;
  221. ulong plic_p1b2tr;
  222. ulong plic_p2b2tr;
  223. ulong plic_p3b2tr;
  224. uchar plic_p0dtr;
  225. uchar plic_p1dtr;
  226. uchar plic_p2dtr;
  227. uchar plic_p3dtr;
  228. uchar res2[4];
  229. ushort plic_p0cr;
  230. ushort plic_p1cr;
  231. ushort plic_p2cr;
  232. ushort plic_p3cr;
  233. ushort plic_p0icr;
  234. ushort plic_p1icr;
  235. ushort plic_p2icr;
  236. ushort plic_p3icr;
  237. ushort plic_p0gmr;
  238. ushort plic_p1gmr;
  239. ushort plic_p2gmr;
  240. ushort plic_p3gmr;
  241. ushort plic_p0gmt;
  242. ushort plic_p1gmt;
  243. ushort plic_p2gmt;
  244. ushort plic_p3gmt;
  245. uchar res3;
  246. uchar plic_pgmts;
  247. uchar plic_pgmta;
  248. uchar res4;
  249. uchar plic_p0gcir;
  250. uchar plic_p1gcir;
  251. uchar plic_p2gcir;
  252. uchar plic_p3gcir;
  253. uchar plic_p0gcit;
  254. uchar plic_p1gcit;
  255. uchar plic_p2gcit;
  256. uchar plic_p3gcit;
  257. uchar res5[3];
  258. uchar plic_pgcitsr;
  259. uchar res6[3];
  260. uchar plic_pdcsr;
  261. ushort plic_p0psr;
  262. ushort plic_p1psr;
  263. ushort plic_p2psr;
  264. ushort plic_p3psr;
  265. ushort plic_pasr;
  266. uchar res7;
  267. uchar plic_plcr;
  268. ushort res8;
  269. ushort plic_pdrqr;
  270. ushort plic_p0sdr;
  271. ushort plic_p1sdr;
  272. ushort plic_p2sdr;
  273. ushort plic_p3sdr;
  274. ushort res9;
  275. ushort plic_pcsr;
  276. uchar res10[1184];
  277. } plic_t;
  278. /* Fast ethernet controller registers
  279. */
  280. typedef struct fec {
  281. uint fec_ecntrl; /* ethernet control register */
  282. uint fec_ievent; /* interrupt event register */
  283. uint fec_imask; /* interrupt mask register */
  284. uint fec_ivec; /* interrupt level and vector status */
  285. uint fec_r_des_active; /* Rx ring updated flag */
  286. uint fec_x_des_active; /* Tx ring updated flag */
  287. uint res3[10]; /* reserved */
  288. uint fec_mii_data; /* MII data register */
  289. uint fec_mii_speed; /* MII speed control register */
  290. uint res4[17]; /* reserved */
  291. uint fec_r_bound; /* end of RAM (read-only) */
  292. uint fec_r_fstart; /* Rx FIFO start address */
  293. uint res5[6]; /* reserved */
  294. uint fec_x_fstart; /* Tx FIFO start address */
  295. uint res7[21]; /* reserved */
  296. uint fec_r_cntrl; /* Rx control register */
  297. uint fec_r_hash; /* Rx hash register */
  298. uint res8[14]; /* reserved */
  299. uint fec_x_cntrl; /* Tx control register */
  300. uint res9[0x9e]; /* reserved */
  301. uint fec_addr_low; /* lower 32 bits of station address */
  302. uint fec_addr_high; /* upper 16 bits of station address */
  303. uint fec_hash_table_high; /* upper 32-bits of hash table */
  304. uint fec_hash_table_low; /* lower 32-bits of hash table */
  305. uint fec_r_des_start; /* beginning of Rx descriptor ring */
  306. uint fec_x_des_start; /* beginning of Tx descriptor ring */
  307. uint fec_r_buff_size; /* Rx buffer size */
  308. uint res2[9]; /* reserved */
  309. uchar fec_fifo[960]; /* fifo RAM */
  310. } fec_t;
  311. /* USB module registers
  312. */
  313. typedef struct usb {
  314. ushort res1;
  315. ushort usb_fnr;
  316. ushort res2;
  317. ushort usb_fnmr;
  318. ushort res3;
  319. ushort usb_rfmr;
  320. ushort res4;
  321. ushort usb_rfmmr;
  322. uchar res5[3];
  323. uchar usb_far;
  324. ulong usb_asr;
  325. ulong usb_drr1;
  326. ulong usb_drr2;
  327. ushort res6;
  328. ushort usb_specr;
  329. ushort res7;
  330. ushort usb_ep0sr;
  331. ulong usb_iep0cfg;
  332. ulong usb_oep0cfg;
  333. ulong usb_ep1cfg;
  334. ulong usb_ep2cfg;
  335. ulong usb_ep3cfg;
  336. ulong usb_ep4cfg;
  337. ulong usb_ep5cfg;
  338. ulong usb_ep6cfg;
  339. ulong usb_ep7cfg;
  340. ulong usb_ep0ctl;
  341. ushort res8;
  342. ushort usb_ep1ctl;
  343. ushort res9;
  344. ushort usb_ep2ctl;
  345. ushort res10;
  346. ushort usb_ep3ctl;
  347. ushort res11;
  348. ushort usb_ep4ctl;
  349. ushort res12;
  350. ushort usb_ep5ctl;
  351. ushort res13;
  352. ushort usb_ep6ctl;
  353. ushort res14;
  354. ushort usb_ep7ctl;
  355. ulong usb_ep0isr;
  356. ushort res15;
  357. ushort usb_ep1isr;
  358. ushort res16;
  359. ushort usb_ep2isr;
  360. ushort res17;
  361. ushort usb_ep3isr;
  362. ushort res18;
  363. ushort usb_ep4isr;
  364. ushort res19;
  365. ushort usb_ep5isr;
  366. ushort res20;
  367. ushort usb_ep6isr;
  368. ushort res21;
  369. ushort usb_ep7isr;
  370. ulong usb_ep0imr;
  371. ushort res22;
  372. ushort usb_ep1imr;
  373. ushort res23;
  374. ushort usb_ep2imr;
  375. ushort res24;
  376. ushort usb_ep3imr;
  377. ushort res25;
  378. ushort usb_ep4imr;
  379. ushort res26;
  380. ushort usb_ep5imr;
  381. ushort res27;
  382. ushort usb_ep6imr;
  383. ushort res28;
  384. ushort usb_ep7imr;
  385. ulong usb_ep0dr;
  386. ulong usb_ep1dr;
  387. ulong usb_ep2dr;
  388. ulong usb_ep3dr;
  389. ulong usb_ep4dr;
  390. ulong usb_ep5dr;
  391. ulong usb_ep6dr;
  392. ulong usb_ep7dr;
  393. ushort res29;
  394. ushort usb_ep0dpr;
  395. ushort res30;
  396. ushort usb_ep1dpr;
  397. ushort res31;
  398. ushort usb_ep2dpr;
  399. ushort res32;
  400. ushort usb_ep3dpr;
  401. ushort res33;
  402. ushort usb_ep4dpr;
  403. ushort res34;
  404. ushort usb_ep5dpr;
  405. ushort res35;
  406. ushort usb_ep6dpr;
  407. ushort res36;
  408. ushort usb_ep7dpr;
  409. uchar res37[788];
  410. uchar usb_cfgram[1024];
  411. } usb_t;
  412. /* Internal memory map.
  413. */
  414. typedef struct immap {
  415. sysctrl_t sysctrl_reg; /* System configuration registers */
  416. intctrl_t intctrl_reg; /* Interrupt controller registers */
  417. csctrl_t csctrl_reg; /* Chip select controller registers */
  418. gpio_t gpio_reg; /* GPIO controller registers */
  419. qspi_t qspi_reg; /* QSPI controller registers */
  420. pwm_t pwm_reg; /* Pulse width modulation registers */
  421. dma_t dma_reg; /* DMA registers */
  422. uart_t uart_reg[2]; /* UART registers */
  423. sdramctrl_t sdram_reg; /* SDRAM controller registers */
  424. timer_t timer_reg[4]; /* Timer registers */
  425. wdog_t wdog_reg; /* Watchdog registers */
  426. plic_t plic_reg; /* Physical layer interface registers */
  427. fec_t fec_reg; /* Fast ethernet controller registers */
  428. usb_t usb_reg; /* USB controller registers */
  429. } immap_t;
  430. #endif /* __IMMAP_5272__ */