immap_512x.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. /*
  2. * (C) Copyright 2007 DENX Software Engineering
  3. *
  4. * MPC512x Internal Memory Map
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. *
  21. * Based on the MPC83xx header.
  22. */
  23. #ifndef __IMMAP_512x__
  24. #define __IMMAP_512x__
  25. #include <asm/types.h>
  26. typedef struct law512x {
  27. u32 bar; /* Base Addr Register */
  28. u32 ar; /* Attributes Register */
  29. } law521x_t;
  30. /*
  31. * System configuration registers
  32. */
  33. typedef struct sysconf512x {
  34. u32 immrbar; /* Internal memory map base address register */
  35. u8 res0[0x1c];
  36. u32 lpbaw; /* LP Boot Access Window */
  37. u32 lpcs0aw; /* LP CS0 Access Window */
  38. u32 lpcs1aw; /* LP CS1 Access Window */
  39. u32 lpcs2aw; /* LP CS2 Access Window */
  40. u32 lpcs3aw; /* LP CS3 Access Window */
  41. u32 lpcs4aw; /* LP CS4 Access Window */
  42. u32 lpcs5aw; /* LP CS5 Access Window */
  43. u32 lpcs6aw; /* LP CS6 Access Window */
  44. u32 lpcs7aw; /* LP CS7 Access Window */
  45. u8 res1[0x1c];
  46. law521x_t pcilaw[3]; /* PCI Local Access Window 0-2 Registers */
  47. u8 res2[0x28];
  48. law521x_t ddrlaw; /* DDR Local Access Window */
  49. u8 res3[0x18];
  50. u32 mbxbar; /* MBX Base Address */
  51. u32 srambar; /* SRAM Base Address */
  52. u32 nfcbar; /* NFC Base Address */
  53. u8 res4[0x34];
  54. u32 spridr; /* System Part and Revision ID Register */
  55. u32 spcr; /* System Priority Configuration Register */
  56. u8 res5[0xf8];
  57. } sysconf512x_t;
  58. /*
  59. * Watch Dog Timer (WDT) Registers
  60. */
  61. typedef struct wdt512x {
  62. u8 res0[4];
  63. u32 swcrr; /* System watchdog control register */
  64. u32 swcnr; /* System watchdog count register */
  65. u8 res1[2];
  66. u16 swsrr; /* System watchdog service register */
  67. u8 res2[0xF0];
  68. } wdt512x_t;
  69. /*
  70. * RTC Module Registers
  71. */
  72. typedef struct rtclk512x {
  73. u8 fixme[0x100];
  74. } rtclk512x_t;
  75. /*
  76. * General Purpose Timer
  77. */
  78. typedef struct gpt512x {
  79. u8 fixme[0x100];
  80. } gpt512x_t;
  81. /*
  82. * Integrated Programmable Interrupt Controller
  83. */
  84. typedef struct ipic512x {
  85. u8 fixme[0x100];
  86. } ipic512x_t;
  87. /*
  88. * System Arbiter Registers
  89. */
  90. typedef struct arbiter512x {
  91. u32 acr; /* Arbiter Configuration Register */
  92. u32 atr; /* Arbiter Timers Register */
  93. u32 ater; /* Arbiter Transfer Error Register */
  94. u32 aer; /* Arbiter Event Register */
  95. u32 aidr; /* Arbiter Interrupt Definition Register */
  96. u32 amr; /* Arbiter Mask Register */
  97. u32 aeatr; /* Arbiter Event Attributes Register */
  98. u32 aeadr; /* Arbiter Event Address Register */
  99. u32 aerr; /* Arbiter Event Response Register */
  100. u8 res1[0xDC];
  101. } arbiter512x_t;
  102. /*
  103. * Reset Module
  104. */
  105. typedef struct reset512x {
  106. u32 rcwl; /* Reset Configuration Word Low Register */
  107. u32 rcwh; /* Reset Configuration Word High Register */
  108. u8 res0[8];
  109. u32 rsr; /* Reset Status Register */
  110. u32 rmr; /* Reset Mode Register */
  111. u32 rpr; /* Reset protection Register */
  112. u32 rcr; /* Reset Control Register */
  113. u32 rcer; /* Reset Control Enable Register */
  114. u8 res1[0xDC];
  115. } reset512x_t;
  116. /*
  117. * Clock Module
  118. */
  119. typedef struct clk512x {
  120. u32 spmr; /* System PLL Mode Register */
  121. u32 sccr[2]; /* System Clock Control Registers */
  122. u32 scfr[2]; /* System Clock Frequency Registers */
  123. u8 res0[4];
  124. u32 bcr; /* Bread Crumb Register */
  125. u32 pscccr[12]; /* PSC0-11 Clock Control Registers */
  126. u32 spccr; /* SPDIF Clock Control Registers */
  127. u32 cccr; /* CFM Clock Control Registers */
  128. u32 dccr; /* DIU Clock Control Registers */
  129. u8 res1[0xa8];
  130. } clk512x_t;
  131. /*
  132. * Power Management Control Module
  133. */
  134. typedef struct pmc512x {
  135. u8 fixme[0x100];
  136. } pmc512x_t;
  137. /*
  138. * General purpose I/O module
  139. */
  140. typedef struct gpio512x {
  141. u8 fixme[0x100];
  142. } gpio512x_t;
  143. /*
  144. * DDR Memory Controller Memory Map
  145. */
  146. typedef struct ddr512x {
  147. u32 ddr_sys_config; /* System Configuration Register */
  148. u32 ddr_time_config0; /* Timing Configuration Register */
  149. u32 ddr_time_config1; /* Timing Configuration Register */
  150. u32 ddr_time_config2; /* Timing Configuration Register */
  151. u32 ddr_command; /* Command Register */
  152. u32 ddr_compact_command; /* Compact Command Register */
  153. u32 self_refresh_cmd_0; /* Enter/Exit Self Refresh Registers */
  154. u32 self_refresh_cmd_1; /* Enter/Exit Self Refresh Registers */
  155. u32 self_refresh_cmd_2; /* Enter/Exit Self Refresh Registers */
  156. u32 self_refresh_cmd_3; /* Enter/Exit Self Refresh Registers */
  157. u32 self_refresh_cmd_4; /* Enter/Exit Self Refresh Registers */
  158. u32 self_refresh_cmd_5; /* Enter/Exit Self Refresh Registers */
  159. u32 self_refresh_cmd_6; /* Enter/Exit Self Refresh Registers */
  160. u32 self_refresh_cmd_7; /* Enter/Exit Self Refresh Registers */
  161. u32 DQS_config_offset_count; /* DQS Config Offset Count */
  162. u32 DQS_config_offset_time; /* DQS Config Offset Time */
  163. u32 DQS_delay_status; /* DQS Delay Status */
  164. u32 res0[0xF];
  165. u32 prioman_config1; /* Priority Manager Configuration */
  166. u32 prioman_config2; /* Priority Manager Configuration */
  167. u32 hiprio_config; /* High Priority Configuration */
  168. u32 lut_table0_main_upper; /* LUT0 Main Upper */
  169. u32 lut_table1_main_upper; /* LUT1 Main Upper */
  170. u32 lut_table2_main_upper; /* LUT2 Main Upper */
  171. u32 lut_table3_main_upper; /* LUT3 Main Upper */
  172. u32 lut_table4_main_upper; /* LUT4 Main Upper */
  173. u32 lut_table0_main_lower; /* LUT0 Main Lower */
  174. u32 lut_table1_main_lower; /* LUT1 Main Lower */
  175. u32 lut_table2_main_lower; /* LUT2 Main Lower */
  176. u32 lut_table3_main_lower; /* LUT3 Main Lower */
  177. u32 lut_table4_main_lower; /* LUT4 Main Lower */
  178. u32 lut_table0_alternate_upper; /* LUT0 Alternate Upper */
  179. u32 lut_table1_alternate_upper; /* LUT1 Alternate Upper */
  180. u32 lut_table2_alternate_upper; /* LUT2 Alternate Upper */
  181. u32 lut_table3_alternate_upper; /* LUT3 Alternate Upper */
  182. u32 lut_table4_alternate_upper; /* LUT4 Alternate Upper */
  183. u32 lut_table0_alternate_lower; /* LUT0 Alternate Lower */
  184. u32 lut_table1_alternate_lower; /* LUT1 Alternate Lower */
  185. u32 lut_table2_alternate_lower; /* LUT2 Alternate Lower */
  186. u32 lut_table3_alternate_lower; /* LUT3 Alternate Lower */
  187. u32 lut_table4_alternate_lower; /* LUT4 Alternate Lower */
  188. u32 performance_monitor_config;
  189. u32 event_time_counter;
  190. u32 event_time_preset;
  191. u32 performance_monitor1_address_low;
  192. u32 performance_monitor2_address_low;
  193. u32 performance_monitor1_address_hi;
  194. u32 performance_monitor2_address_hi;
  195. u32 res1[2];
  196. u32 performance_monitor1_read_counter;
  197. u32 performance_monitor2_read_counter;
  198. u32 performance_monitor1_write_counter;
  199. u32 performance_monitor2_write_counter;
  200. u32 granted_ack_counter0;
  201. u32 granted_ack_counter1;
  202. u32 granted_ack_counter2;
  203. u32 granted_ack_counter3;
  204. u32 granted_ack_counter4;
  205. u32 cumulative_wait_counter0;
  206. u32 cumulative_wait_counter1;
  207. u32 cumulative_wait_counter2;
  208. u32 cumulative_wait_counter3;
  209. u32 cumulative_wait_counter4;
  210. u32 summed_priority_counter0;
  211. u32 summed_priority_counter1;
  212. u32 summed_priority_counter2;
  213. u32 summed_priority_counter3;
  214. u32 summed_priority_counter4;
  215. u32 res2[0x3AD];
  216. } ddr512x_t;
  217. /*
  218. * DMA/Messaging Unit
  219. */
  220. typedef struct dma512x {
  221. u8 fixme[0x1800];
  222. } dma512x_t;
  223. /*
  224. * PCI Software Configuration Registers
  225. */
  226. typedef struct pciconf512x {
  227. u8 fixme[0x80];
  228. } pciconf512x_t;
  229. /*
  230. * Sequencer
  231. */
  232. typedef struct ios512x {
  233. u8 fixme[0x100];
  234. } ios512x_t;
  235. /*
  236. * PCI Controller
  237. */
  238. typedef struct pcictrl512x {
  239. u8 fixme[0x100];
  240. } pcictrl512x_t;
  241. /*
  242. * MSCAN
  243. */
  244. typedef struct mscan512x {
  245. u8 fixme[0x100];
  246. } mscan512x_t;
  247. /*
  248. * BDLC
  249. */
  250. typedef struct bdlc512x {
  251. u8 fixme[0x100];
  252. } bdlc512x_t;
  253. /*
  254. * SDHC
  255. */
  256. typedef struct sdhc512x {
  257. u8 fixme[0x100];
  258. } sdhc512x_t;
  259. /*
  260. * SPDIF
  261. */
  262. typedef struct spdif512x {
  263. u8 fixme[0x100];
  264. } spdif512x_t;
  265. /*
  266. * I2C
  267. */
  268. typedef struct i2c512x_dev {
  269. volatile u32 madr; /* I2Cn + 0x00 */
  270. volatile u32 mfdr; /* I2Cn + 0x04 */
  271. volatile u32 mcr; /* I2Cn + 0x08 */
  272. volatile u32 msr; /* I2Cn + 0x0C */
  273. volatile u32 mdr; /* I2Cn + 0x10 */
  274. u8 res0[0x0C];
  275. } i2c512x_dev_t;
  276. typedef struct i2c512x {
  277. i2c512x_dev_t dev[3];
  278. volatile u32 icr;
  279. volatile u32 mifr;
  280. u8 res0[0x98];
  281. } i2c512x_t;
  282. /*
  283. * AXE
  284. */
  285. typedef struct axe512x {
  286. u8 fixme[0x100];
  287. } axe512x_t;
  288. /*
  289. * DIU
  290. */
  291. typedef struct diu512x {
  292. u8 fixme[0x100];
  293. } diu512x_t;
  294. /*
  295. * CFM
  296. */
  297. typedef struct cfm512x {
  298. u8 fixme[0x100];
  299. } cfm512x_t;
  300. /*
  301. * FEC
  302. */
  303. typedef struct fec512x {
  304. u8 fixme[0x800];
  305. } fec512x_t;
  306. /*
  307. * ULPI
  308. */
  309. typedef struct ulpi512x {
  310. u8 fixme[0x600];
  311. } ulpi512x_t;
  312. /*
  313. * UTMI
  314. */
  315. typedef struct utmi512x {
  316. u8 fixme[0x3000];
  317. } utmi512x_t;
  318. /*
  319. * PCI DMA
  320. */
  321. typedef struct pcidma512x {
  322. u8 fixme[0x300];
  323. } pcidma512x_t;
  324. /*
  325. * IO Control
  326. */
  327. typedef struct ioctrl512x {
  328. u32 regs[0x400];
  329. } ioctrl512x_t;
  330. /*
  331. * IIM
  332. */
  333. typedef struct iim512x {
  334. u8 fixme[0x1000];
  335. } iim512x_t;
  336. /*
  337. * LPC
  338. */
  339. typedef struct lpc512x {
  340. u32 cs_cfg[8]; /* Chip Select N Configuration Registers
  341. No dedicated entry for CS Boot as == CS0 */
  342. u32 cs_cr; /* Chip Select Control Register */
  343. u32 cs_sr; /* Chip Select Status Register */
  344. u32 cs_bcr; /* Chip Select Burst Control Register */
  345. u32 cs_dccr; /* Chip Select Deadcycle Control Register */
  346. u32 cs_hccr; /* Chip Select Holdcycle Control Register */
  347. u8 res0[0xcc];
  348. u32 sclpc_psr; /* SCLPC Packet Size Register */
  349. u32 sclpc_sar; /* SCLPC Start Address Register */
  350. u32 sclpc_cr; /* SCLPC Control Register */
  351. u32 sclpc_er; /* SCLPC Enable Register */
  352. u32 sclpc_nar; /* SCLPC NextAddress Register */
  353. u32 sclpc_sr; /* SCLPC Status Register */
  354. u32 sclpc_bdr; /* SCLPC Bytes Done Register */
  355. u32 emb_scr; /* EMB Share Counter Register */
  356. u32 emb_pcr; /* EMB Pause Control Register */
  357. u8 res1[0x1c];
  358. u32 lpc_fdwr; /* LPC RX/TX FIFO Data Word Register */
  359. u32 lpc_fsr; /* LPC RX/TX FIFO Status Register */
  360. u32 lpc_cr; /* LPC RX/TX FIFO Control Register */
  361. u32 lpc_ar; /* LPC RX/TX FIFO Alarm Register */
  362. u8 res2[0xb0];
  363. } lpc512x_t;
  364. /*
  365. * PATA
  366. */
  367. typedef struct pata512x {
  368. u8 fixme[0x100];
  369. } pata512x_t;
  370. /*
  371. * PSC
  372. */
  373. typedef struct psc512x {
  374. volatile u8 mode; /* PSC + 0x00 */
  375. volatile u8 res0[3];
  376. union { /* PSC + 0x04 */
  377. volatile u16 status;
  378. volatile u16 clock_select;
  379. } sr_csr;
  380. #define psc_status sr_csr.status
  381. #define psc_clock_select sr_csr.clock_select
  382. volatile u16 res1;
  383. volatile u8 command; /* PSC + 0x08 */
  384. volatile u8 res2[3];
  385. union { /* PSC + 0x0c */
  386. volatile u8 buffer_8;
  387. volatile u16 buffer_16;
  388. volatile u32 buffer_32;
  389. } buffer;
  390. #define psc_buffer_8 buffer.buffer_8
  391. #define psc_buffer_16 buffer.buffer_16
  392. #define psc_buffer_32 buffer.buffer_32
  393. union { /* PSC + 0x10 */
  394. volatile u8 ipcr;
  395. volatile u8 acr;
  396. } ipcr_acr;
  397. #define psc_ipcr ipcr_acr.ipcr
  398. #define psc_acr ipcr_acr.acr
  399. volatile u8 res3[3];
  400. union { /* PSC + 0x14 */
  401. volatile u16 isr;
  402. volatile u16 imr;
  403. } isr_imr;
  404. #define psc_isr isr_imr.isr
  405. #define psc_imr isr_imr.imr
  406. volatile u16 res4;
  407. volatile u8 ctur; /* PSC + 0x18 */
  408. volatile u8 res5[3];
  409. volatile u8 ctlr; /* PSC + 0x1c */
  410. volatile u8 res6[3];
  411. volatile u32 ccr; /* PSC + 0x20 */
  412. volatile u8 res7[12];
  413. volatile u8 ivr; /* PSC + 0x30 */
  414. volatile u8 res8[3];
  415. volatile u8 ip; /* PSC + 0x34 */
  416. volatile u8 res9[3];
  417. volatile u8 op1; /* PSC + 0x38 */
  418. volatile u8 res10[3];
  419. volatile u8 op0; /* PSC + 0x3c */
  420. volatile u8 res11[3];
  421. volatile u32 sicr; /* PSC + 0x40 */
  422. volatile u8 res12[60];
  423. volatile u32 tfcmd; /* PSC + 0x80 */
  424. volatile u32 tfalarm; /* PSC + 0x84 */
  425. volatile u32 tfstat; /* PSC + 0x88 */
  426. volatile u32 tfintstat; /* PSC + 0x8C */
  427. volatile u32 tfintmask; /* PSC + 0x90 */
  428. volatile u32 tfcount; /* PSC + 0x94 */
  429. volatile u16 tfwptr; /* PSC + 0x98 */
  430. volatile u16 tfrptr; /* PSC + 0x9A */
  431. volatile u32 tfsize; /* PSC + 0x9C */
  432. volatile u8 res13[28];
  433. union { /* PSC + 0xBC */
  434. volatile u8 buffer_8;
  435. volatile u16 buffer_16;
  436. volatile u32 buffer_32;
  437. } tfdata_buffer;
  438. #define tfdata_8 tfdata_buffer.buffer_8
  439. #define tfdata_16 tfdata_buffer.buffer_16
  440. #define tfdata_32 tfdata_buffer.buffer_32
  441. volatile u32 rfcmd; /* PSC + 0xC0 */
  442. volatile u32 rfalarm; /* PSC + 0xC4 */
  443. volatile u32 rfstat; /* PSC + 0xC8 */
  444. volatile u32 rfintstat; /* PSC + 0xCC */
  445. volatile u32 rfintmask; /* PSC + 0xD0 */
  446. volatile u32 rfcount; /* PSC + 0xD4 */
  447. volatile u16 rfwptr; /* PSC + 0xD8 */
  448. volatile u16 rfrptr; /* PSC + 0xDA */
  449. volatile u32 rfsize; /* PSC + 0xDC */
  450. volatile u8 res18[28];
  451. union { /* PSC + 0xFC */
  452. volatile u8 buffer_8;
  453. volatile u16 buffer_16;
  454. volatile u32 buffer_32;
  455. } rfdata_buffer;
  456. #define rfdata_8 rfdata_buffer.buffer_8
  457. #define rfdata_16 rfdata_buffer.buffer_16
  458. #define rfdata_32 rfdata_buffer.buffer_32
  459. } psc512x_t;
  460. /*
  461. * FIFOC
  462. */
  463. typedef struct fifoc512x {
  464. u32 fifoc_cmd;
  465. u32 fifoc_int;
  466. u32 fifoc_dma;
  467. u32 fifoc_axe;
  468. u32 fifoc_debug;
  469. u8 fixme[0xEC];
  470. } fifoc512x_t;
  471. /*
  472. * SATA
  473. */
  474. typedef struct sata512x {
  475. u8 fixme[0x2000];
  476. } sata512x_t;
  477. typedef struct immap {
  478. sysconf512x_t sysconf; /* System configuration */
  479. u8 res0[0x700];
  480. wdt512x_t wdt; /* Watch Dog Timer (WDT) */
  481. rtclk512x_t rtc; /* Real Time Clock Module */
  482. gpt512x_t gpt; /* General Purpose Timer */
  483. ipic512x_t ipic; /* Integrated Programmable Interrupt Controller */
  484. arbiter512x_t arbiter; /* CSB Arbiter */
  485. reset512x_t reset; /* Reset Module */
  486. clk512x_t clk; /* Clock Module */
  487. pmc512x_t pmc; /* Power Management Control Module */
  488. gpio512x_t gpio; /* General purpose I/O module */
  489. u8 res1[0x100];
  490. mscan512x_t mscan; /* MSCAN */
  491. bdlc512x_t bdlc; /* BDLC */
  492. sdhc512x_t sdhc; /* SDHC */
  493. spdif512x_t spdif; /* SPDIF */
  494. i2c512x_t i2c; /* I2C Controllers */
  495. u8 res2[0x800];
  496. axe512x_t axe; /* AXE */
  497. diu512x_t diu; /* Display Interface Unit */
  498. cfm512x_t cfm; /* Clock Frequency Measurement */
  499. u8 res3[0x500];
  500. fec512x_t fec; /* Fast Ethernet Controller */
  501. ulpi512x_t ulpi; /* USB ULPI */
  502. u8 res4[0xa00];
  503. utmi512x_t utmi; /* USB UTMI */
  504. u8 res5[0x1000];
  505. pcidma512x_t pci_dma; /* PCI DMA */
  506. pciconf512x_t pci_conf; /* PCI Configuration */
  507. u8 res6[0x80];
  508. ios512x_t ios; /* PCI Sequencer */
  509. pcictrl512x_t pci_ctrl; /* PCI Controller Control and Status */
  510. u8 res7[0xa00];
  511. ddr512x_t mddrc; /* Multi-port DDR Memory Controller */
  512. ioctrl512x_t io_ctrl; /* IO Control */
  513. iim512x_t iim; /* IC Identification module */
  514. u8 res8[0x4000];
  515. lpc512x_t lpc; /* LocalPlus Controller */
  516. pata512x_t pata; /* Parallel ATA */
  517. u8 res9[0xd00];
  518. psc512x_t psc[12]; /* PSCs */
  519. u8 res10[0x300];
  520. fifoc512x_t fifoc; /* FIFO Controller */
  521. u8 res11[0x2000];
  522. dma512x_t dma; /* DMA */
  523. u8 res12[0xa800];
  524. sata512x_t sata; /* Serial ATA */
  525. u8 res13[0xde000];
  526. } immap_t;
  527. #endif /* __IMMAP_512x__ */