immap_cpm2.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /*
  2. * CPM2 Internal Memory Map
  3. * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
  4. *
  5. * The Internal Memory Map for devices with CPM2 on them. This
  6. * is the superset of all CPM2 devices (8260, 8266, 8280, 8272,
  7. * 8560).
  8. */
  9. #ifdef __KERNEL__
  10. #ifndef __IMMAP_CPM2__
  11. #define __IMMAP_CPM2__
  12. #include <linux/types.h>
  13. /* System configuration registers.
  14. */
  15. typedef struct sys_82xx_conf {
  16. u32 sc_siumcr;
  17. u32 sc_sypcr;
  18. u8 res1[6];
  19. u16 sc_swsr;
  20. u8 res2[20];
  21. u32 sc_bcr;
  22. u8 sc_ppc_acr;
  23. u8 res3[3];
  24. u32 sc_ppc_alrh;
  25. u32 sc_ppc_alrl;
  26. u8 sc_lcl_acr;
  27. u8 res4[3];
  28. u32 sc_lcl_alrh;
  29. u32 sc_lcl_alrl;
  30. u32 sc_tescr1;
  31. u32 sc_tescr2;
  32. u32 sc_ltescr1;
  33. u32 sc_ltescr2;
  34. u32 sc_pdtea;
  35. u8 sc_pdtem;
  36. u8 res5[3];
  37. u32 sc_ldtea;
  38. u8 sc_ldtem;
  39. u8 res6[163];
  40. } sysconf_82xx_cpm2_t;
  41. typedef struct sys_85xx_conf {
  42. u32 sc_cear;
  43. u16 sc_ceer;
  44. u16 sc_cemr;
  45. u8 res1[70];
  46. u32 sc_smaer;
  47. u8 res2[4];
  48. u32 sc_smevr;
  49. u32 sc_smctr;
  50. u32 sc_lmaer;
  51. u8 res3[4];
  52. u32 sc_lmevr;
  53. u32 sc_lmctr;
  54. u8 res4[144];
  55. } sysconf_85xx_cpm2_t;
  56. typedef union sys_conf {
  57. sysconf_82xx_cpm2_t siu_82xx;
  58. sysconf_85xx_cpm2_t siu_85xx;
  59. } sysconf_cpm2_t;
  60. /* Memory controller registers.
  61. */
  62. typedef struct mem_ctlr {
  63. u32 memc_br0;
  64. u32 memc_or0;
  65. u32 memc_br1;
  66. u32 memc_or1;
  67. u32 memc_br2;
  68. u32 memc_or2;
  69. u32 memc_br3;
  70. u32 memc_or3;
  71. u32 memc_br4;
  72. u32 memc_or4;
  73. u32 memc_br5;
  74. u32 memc_or5;
  75. u32 memc_br6;
  76. u32 memc_or6;
  77. u32 memc_br7;
  78. u32 memc_or7;
  79. u32 memc_br8;
  80. u32 memc_or8;
  81. u32 memc_br9;
  82. u32 memc_or9;
  83. u32 memc_br10;
  84. u32 memc_or10;
  85. u32 memc_br11;
  86. u32 memc_or11;
  87. u8 res1[8];
  88. u32 memc_mar;
  89. u8 res2[4];
  90. u32 memc_mamr;
  91. u32 memc_mbmr;
  92. u32 memc_mcmr;
  93. u8 res3[8];
  94. u16 memc_mptpr;
  95. u8 res4[2];
  96. u32 memc_mdr;
  97. u8 res5[4];
  98. u32 memc_psdmr;
  99. u32 memc_lsdmr;
  100. u8 memc_purt;
  101. u8 res6[3];
  102. u8 memc_psrt;
  103. u8 res7[3];
  104. u8 memc_lurt;
  105. u8 res8[3];
  106. u8 memc_lsrt;
  107. u8 res9[3];
  108. u32 memc_immr;
  109. u32 memc_pcibr0;
  110. u32 memc_pcibr1;
  111. u8 res10[16];
  112. u32 memc_pcimsk0;
  113. u32 memc_pcimsk1;
  114. u8 res11[52];
  115. } memctl_cpm2_t;
  116. /* System Integration Timers.
  117. */
  118. typedef struct sys_int_timers {
  119. u8 res1[32];
  120. u16 sit_tmcntsc;
  121. u8 res2[2];
  122. u32 sit_tmcnt;
  123. u8 res3[4];
  124. u32 sit_tmcntal;
  125. u8 res4[16];
  126. u16 sit_piscr;
  127. u8 res5[2];
  128. u32 sit_pitc;
  129. u32 sit_pitr;
  130. u8 res6[94];
  131. u8 res7[390];
  132. } sit_cpm2_t;
  133. #define PISCR_PIRQ_MASK ((u16)0xff00)
  134. #define PISCR_PS ((u16)0x0080)
  135. #define PISCR_PIE ((u16)0x0004)
  136. #define PISCR_PTF ((u16)0x0002)
  137. #define PISCR_PTE ((u16)0x0001)
  138. /* PCI Controller.
  139. */
  140. typedef struct pci_ctlr {
  141. u32 pci_omisr;
  142. u32 pci_omimr;
  143. u8 res1[8];
  144. u32 pci_ifqpr;
  145. u32 pci_ofqpr;
  146. u8 res2[8];
  147. u32 pci_imr0;
  148. u32 pci_imr1;
  149. u32 pci_omr0;
  150. u32 pci_omr1;
  151. u32 pci_odr;
  152. u8 res3[4];
  153. u32 pci_idr;
  154. u8 res4[20];
  155. u32 pci_imisr;
  156. u32 pci_imimr;
  157. u8 res5[24];
  158. u32 pci_ifhpr;
  159. u8 res6[4];
  160. u32 pci_iftpr;
  161. u8 res7[4];
  162. u32 pci_iphpr;
  163. u8 res8[4];
  164. u32 pci_iptpr;
  165. u8 res9[4];
  166. u32 pci_ofhpr;
  167. u8 res10[4];
  168. u32 pci_oftpr;
  169. u8 res11[4];
  170. u32 pci_ophpr;
  171. u8 res12[4];
  172. u32 pci_optpr;
  173. u8 res13[8];
  174. u32 pci_mucr;
  175. u8 res14[8];
  176. u32 pci_qbar;
  177. u8 res15[12];
  178. u32 pci_dmamr0;
  179. u32 pci_dmasr0;
  180. u32 pci_dmacdar0;
  181. u8 res16[4];
  182. u32 pci_dmasar0;
  183. u8 res17[4];
  184. u32 pci_dmadar0;
  185. u8 res18[4];
  186. u32 pci_dmabcr0;
  187. u32 pci_dmandar0;
  188. u8 res19[86];
  189. u32 pci_dmamr1;
  190. u32 pci_dmasr1;
  191. u32 pci_dmacdar1;
  192. u8 res20[4];
  193. u32 pci_dmasar1;
  194. u8 res21[4];
  195. u32 pci_dmadar1;
  196. u8 res22[4];
  197. u32 pci_dmabcr1;
  198. u32 pci_dmandar1;
  199. u8 res23[88];
  200. u32 pci_dmamr2;
  201. u32 pci_dmasr2;
  202. u32 pci_dmacdar2;
  203. u8 res24[4];
  204. u32 pci_dmasar2;
  205. u8 res25[4];
  206. u32 pci_dmadar2;
  207. u8 res26[4];
  208. u32 pci_dmabcr2;
  209. u32 pci_dmandar2;
  210. u8 res27[88];
  211. u32 pci_dmamr3;
  212. u32 pci_dmasr3;
  213. u32 pci_dmacdar3;
  214. u8 res28[4];
  215. u32 pci_dmasar3;
  216. u8 res29[4];
  217. u32 pci_dmadar3;
  218. u8 res30[4];
  219. u32 pci_dmabcr3;
  220. u32 pci_dmandar3;
  221. u8 res31[344];
  222. u32 pci_potar0;
  223. u8 res32[4];
  224. u32 pci_pobar0;
  225. u8 res33[4];
  226. u32 pci_pocmr0;
  227. u8 res34[4];
  228. u32 pci_potar1;
  229. u8 res35[4];
  230. u32 pci_pobar1;
  231. u8 res36[4];
  232. u32 pci_pocmr1;
  233. u8 res37[4];
  234. u32 pci_potar2;
  235. u8 res38[4];
  236. u32 pci_pobar2;
  237. u8 res39[4];
  238. u32 pci_pocmr2;
  239. u8 res40[50];
  240. u32 pci_ptcr;
  241. u32 pci_gpcr;
  242. u32 pci_gcr;
  243. u32 pci_esr;
  244. u32 pci_emr;
  245. u32 pci_ecr;
  246. u32 pci_eacr;
  247. u8 res41[4];
  248. u32 pci_edcr;
  249. u8 res42[4];
  250. u32 pci_eccr;
  251. u8 res43[44];
  252. u32 pci_pitar1;
  253. u8 res44[4];
  254. u32 pci_pibar1;
  255. u8 res45[4];
  256. u32 pci_picmr1;
  257. u8 res46[4];
  258. u32 pci_pitar0;
  259. u8 res47[4];
  260. u32 pci_pibar0;
  261. u8 res48[4];
  262. u32 pci_picmr0;
  263. u8 res49[4];
  264. u32 pci_cfg_addr;
  265. u32 pci_cfg_data;
  266. u32 pci_int_ack;
  267. u8 res50[756];
  268. } pci_cpm2_t;
  269. /* Interrupt Controller.
  270. */
  271. typedef struct interrupt_controller {
  272. u16 ic_sicr;
  273. u8 res1[2];
  274. u32 ic_sivec;
  275. u32 ic_sipnrh;
  276. u32 ic_sipnrl;
  277. u32 ic_siprr;
  278. u32 ic_scprrh;
  279. u32 ic_scprrl;
  280. u32 ic_simrh;
  281. u32 ic_simrl;
  282. u32 ic_siexr;
  283. u8 res2[88];
  284. } intctl_cpm2_t;
  285. /* Clocks and Reset.
  286. */
  287. typedef struct clk_and_reset {
  288. u32 car_sccr;
  289. u8 res1[4];
  290. u32 car_scmr;
  291. u8 res2[4];
  292. u32 car_rsr;
  293. u32 car_rmr;
  294. u8 res[104];
  295. } car_cpm2_t;
  296. /* Input/Output Port control/status registers.
  297. * Names consistent with processor manual, although they are different
  298. * from the original 8xx names.......
  299. */
  300. typedef struct io_port {
  301. u32 iop_pdira;
  302. u32 iop_ppara;
  303. u32 iop_psora;
  304. u32 iop_podra;
  305. u32 iop_pdata;
  306. u8 res1[12];
  307. u32 iop_pdirb;
  308. u32 iop_pparb;
  309. u32 iop_psorb;
  310. u32 iop_podrb;
  311. u32 iop_pdatb;
  312. u8 res2[12];
  313. u32 iop_pdirc;
  314. u32 iop_pparc;
  315. u32 iop_psorc;
  316. u32 iop_podrc;
  317. u32 iop_pdatc;
  318. u8 res3[12];
  319. u32 iop_pdird;
  320. u32 iop_ppard;
  321. u32 iop_psord;
  322. u32 iop_podrd;
  323. u32 iop_pdatd;
  324. u8 res4[12];
  325. } iop_cpm2_t;
  326. /* Communication Processor Module Timers
  327. */
  328. typedef struct cpm_timers {
  329. u8 cpmt_tgcr1;
  330. u8 res1[3];
  331. u8 cpmt_tgcr2;
  332. u8 res2[11];
  333. u16 cpmt_tmr1;
  334. u16 cpmt_tmr2;
  335. u16 cpmt_trr1;
  336. u16 cpmt_trr2;
  337. u16 cpmt_tcr1;
  338. u16 cpmt_tcr2;
  339. u16 cpmt_tcn1;
  340. u16 cpmt_tcn2;
  341. u16 cpmt_tmr3;
  342. u16 cpmt_tmr4;
  343. u16 cpmt_trr3;
  344. u16 cpmt_trr4;
  345. u16 cpmt_tcr3;
  346. u16 cpmt_tcr4;
  347. u16 cpmt_tcn3;
  348. u16 cpmt_tcn4;
  349. u16 cpmt_ter1;
  350. u16 cpmt_ter2;
  351. u16 cpmt_ter3;
  352. u16 cpmt_ter4;
  353. u8 res3[584];
  354. } cpmtimer_cpm2_t;
  355. /* DMA control/status registers.
  356. */
  357. typedef struct sdma_csr {
  358. u8 res0[24];
  359. u8 sdma_sdsr;
  360. u8 res1[3];
  361. u8 sdma_sdmr;
  362. u8 res2[3];
  363. u8 sdma_idsr1;
  364. u8 res3[3];
  365. u8 sdma_idmr1;
  366. u8 res4[3];
  367. u8 sdma_idsr2;
  368. u8 res5[3];
  369. u8 sdma_idmr2;
  370. u8 res6[3];
  371. u8 sdma_idsr3;
  372. u8 res7[3];
  373. u8 sdma_idmr3;
  374. u8 res8[3];
  375. u8 sdma_idsr4;
  376. u8 res9[3];
  377. u8 sdma_idmr4;
  378. u8 res10[707];
  379. } sdma_cpm2_t;
  380. /* Fast controllers
  381. */
  382. typedef struct fcc {
  383. u32 fcc_gfmr;
  384. u32 fcc_fpsmr;
  385. u16 fcc_ftodr;
  386. u8 res1[2];
  387. u16 fcc_fdsr;
  388. u8 res2[2];
  389. u16 fcc_fcce;
  390. u8 res3[2];
  391. u16 fcc_fccm;
  392. u8 res4[2];
  393. u8 fcc_fccs;
  394. u8 res5[3];
  395. u8 fcc_ftirr_phy[4];
  396. } fcc_t;
  397. /* Fast controllers continued
  398. */
  399. typedef struct fcc_c {
  400. u32 fcc_firper;
  401. u32 fcc_firer;
  402. u32 fcc_firsr_hi;
  403. u32 fcc_firsr_lo;
  404. u8 fcc_gfemr;
  405. u8 res1[15];
  406. } fcc_c_t;
  407. /* TC Layer
  408. */
  409. typedef struct tclayer {
  410. u16 tc_tcmode;
  411. u16 tc_cdsmr;
  412. u16 tc_tcer;
  413. u16 tc_rcc;
  414. u16 tc_tcmr;
  415. u16 tc_fcc;
  416. u16 tc_ccc;
  417. u16 tc_icc;
  418. u16 tc_tcc;
  419. u16 tc_ecc;
  420. u8 res1[12];
  421. } tclayer_t;
  422. /* I2C
  423. */
  424. typedef struct i2c {
  425. u8 i2c_i2mod;
  426. u8 res1[3];
  427. u8 i2c_i2add;
  428. u8 res2[3];
  429. u8 i2c_i2brg;
  430. u8 res3[3];
  431. u8 i2c_i2com;
  432. u8 res4[3];
  433. u8 i2c_i2cer;
  434. u8 res5[3];
  435. u8 i2c_i2cmr;
  436. u8 res6[331];
  437. } i2c_cpm2_t;
  438. typedef struct scc { /* Serial communication channels */
  439. u32 scc_gsmrl;
  440. u32 scc_gsmrh;
  441. u16 scc_psmr;
  442. u8 res1[2];
  443. u16 scc_todr;
  444. u16 scc_dsr;
  445. u16 scc_scce;
  446. u8 res2[2];
  447. u16 scc_sccm;
  448. u8 res3;
  449. u8 scc_sccs;
  450. u8 res4[8];
  451. } scc_t;
  452. typedef struct smc { /* Serial management channels */
  453. u8 res1[2];
  454. u16 smc_smcmr;
  455. u8 res2[2];
  456. u8 smc_smce;
  457. u8 res3[3];
  458. u8 smc_smcm;
  459. u8 res4[5];
  460. } smc_t;
  461. /* Serial Peripheral Interface.
  462. */
  463. typedef struct spi_ctrl {
  464. u16 spi_spmode;
  465. u8 res1[4];
  466. u8 spi_spie;
  467. u8 res2[3];
  468. u8 spi_spim;
  469. u8 res3[2];
  470. u8 spi_spcom;
  471. u8 res4[82];
  472. } spictl_cpm2_t;
  473. /* CPM Mux.
  474. */
  475. typedef struct cpmux {
  476. u8 cmx_si1cr;
  477. u8 res1;
  478. u8 cmx_si2cr;
  479. u8 res2;
  480. u32 cmx_fcr;
  481. u32 cmx_scr;
  482. u8 cmx_smr;
  483. u8 res3;
  484. u16 cmx_uar;
  485. u8 res4[16];
  486. } cpmux_t;
  487. /* SIRAM control
  488. */
  489. typedef struct siram {
  490. u16 si_amr;
  491. u16 si_bmr;
  492. u16 si_cmr;
  493. u16 si_dmr;
  494. u8 si_gmr;
  495. u8 res1;
  496. u8 si_cmdr;
  497. u8 res2;
  498. u8 si_str;
  499. u8 res3;
  500. u16 si_rsr;
  501. } siramctl_t;
  502. typedef struct mcc {
  503. u16 mcc_mcce;
  504. u8 res1[2];
  505. u16 mcc_mccm;
  506. u8 res2[2];
  507. u8 mcc_mccf;
  508. u8 res3[7];
  509. } mcc_t;
  510. typedef struct comm_proc {
  511. u32 cp_cpcr;
  512. u32 cp_rccr;
  513. u8 res1[14];
  514. u16 cp_rter;
  515. u8 res2[2];
  516. u16 cp_rtmr;
  517. u16 cp_rtscr;
  518. u8 res3[2];
  519. u32 cp_rtsr;
  520. u8 res4[12];
  521. } cpm_cpm2_t;
  522. /* USB Controller.
  523. */
  524. typedef struct cpm_usb_ctlr {
  525. u8 usb_usmod;
  526. u8 usb_usadr;
  527. u8 usb_uscom;
  528. u8 res1[1];
  529. __be16 usb_usep[4];
  530. u8 res2[4];
  531. __be16 usb_usber;
  532. u8 res3[2];
  533. __be16 usb_usbmr;
  534. u8 usb_usbs;
  535. u8 res4[7];
  536. } usb_cpm2_t;
  537. /* ...and the whole thing wrapped up....
  538. */
  539. typedef struct immap {
  540. /* Some references are into the unique and known dpram spaces,
  541. * others are from the generic base.
  542. */
  543. #define im_dprambase im_dpram1
  544. u8 im_dpram1[16*1024];
  545. u8 res1[16*1024];
  546. u8 im_dpram2[4*1024];
  547. u8 res2[8*1024];
  548. u8 im_dpram3[4*1024];
  549. u8 res3[16*1024];
  550. sysconf_cpm2_t im_siu_conf; /* SIU Configuration */
  551. memctl_cpm2_t im_memctl; /* Memory Controller */
  552. sit_cpm2_t im_sit; /* System Integration Timers */
  553. pci_cpm2_t im_pci; /* PCI Controller */
  554. intctl_cpm2_t im_intctl; /* Interrupt Controller */
  555. car_cpm2_t im_clkrst; /* Clocks and reset */
  556. iop_cpm2_t im_ioport; /* IO Port control/status */
  557. cpmtimer_cpm2_t im_cpmtimer; /* CPM timers */
  558. sdma_cpm2_t im_sdma; /* SDMA control/status */
  559. fcc_t im_fcc[3]; /* Three FCCs */
  560. u8 res4z[32];
  561. fcc_c_t im_fcc_c[3]; /* Continued FCCs */
  562. u8 res4[32];
  563. tclayer_t im_tclayer[8]; /* Eight TCLayers */
  564. u16 tc_tcgsr;
  565. u16 tc_tcger;
  566. /* First set of baud rate generators.
  567. */
  568. u8 res[236];
  569. u32 im_brgc5;
  570. u32 im_brgc6;
  571. u32 im_brgc7;
  572. u32 im_brgc8;
  573. u8 res5[608];
  574. i2c_cpm2_t im_i2c; /* I2C control/status */
  575. cpm_cpm2_t im_cpm; /* Communication processor */
  576. /* Second set of baud rate generators.
  577. */
  578. u32 im_brgc1;
  579. u32 im_brgc2;
  580. u32 im_brgc3;
  581. u32 im_brgc4;
  582. scc_t im_scc[4]; /* Four SCCs */
  583. smc_t im_smc[2]; /* Couple of SMCs */
  584. spictl_cpm2_t im_spi; /* A SPI */
  585. cpmux_t im_cpmux; /* CPM clock route mux */
  586. siramctl_t im_siramctl1; /* First SI RAM Control */
  587. mcc_t im_mcc1; /* First MCC */
  588. siramctl_t im_siramctl2; /* Second SI RAM Control */
  589. mcc_t im_mcc2; /* Second MCC */
  590. usb_cpm2_t im_usb; /* USB Controller */
  591. u8 res6[1153];
  592. u16 im_si1txram[256];
  593. u8 res7[512];
  594. u16 im_si1rxram[256];
  595. u8 res8[512];
  596. u16 im_si2txram[256];
  597. u8 res9[512];
  598. u16 im_si2rxram[256];
  599. u8 res10[512];
  600. u8 res11[4096];
  601. } cpm2_map_t;
  602. extern cpm2_map_t __iomem *cpm2_immr;
  603. #endif /* __IMMAP_CPM2__ */
  604. #endif /* __KERNEL__ */