mb86r0x.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /*
  2. * (C) Copyright 2007
  3. *
  4. * mb86r0x definitions
  5. *
  6. * Author : Carsten Schneider, mycable GmbH
  7. * <cs@mycable.de>
  8. *
  9. * (C) Copyright 2010
  10. * Matthias Weisser <weisserm@arcor.de>
  11. *
  12. * See file CREDITS for list of people who contributed to this
  13. * project.
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License as
  17. * published by the Free Software Foundation; either version 2 of
  18. * the License, or (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, write to the Free Software
  27. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  28. * MA 02111-1307 USA
  29. */
  30. #ifndef MB86R0X_H
  31. #define MB86R0X_H
  32. #ifndef __ASSEMBLY__
  33. /* GPIO registers */
  34. struct mb86r0x_gpio {
  35. uint32_t gpdr0;
  36. uint32_t gpdr1;
  37. uint32_t gpdr2;
  38. uint32_t res;
  39. uint32_t gpddr0;
  40. uint32_t gpddr1;
  41. uint32_t gpddr2;
  42. };
  43. /* PWM registers */
  44. struct mb86r0x_pwm {
  45. uint32_t bcr;
  46. uint32_t tpr;
  47. uint32_t pr;
  48. uint32_t dr;
  49. uint32_t cr;
  50. uint32_t sr;
  51. uint32_t ccr;
  52. uint32_t ir;
  53. };
  54. /* The mb86r0x chip control (CCNT) register set. */
  55. struct mb86r0x_ccnt {
  56. uint32_t ccid;
  57. uint32_t csrst;
  58. uint32_t pad0[2];
  59. uint32_t cist;
  60. uint32_t cistm;
  61. uint32_t cgpio_ist;
  62. uint32_t cgpio_istm;
  63. uint32_t cgpio_ip;
  64. uint32_t cgpio_im;
  65. uint32_t caxi_bw;
  66. uint32_t caxi_ps;
  67. uint32_t cmux_md;
  68. uint32_t cex_pin_st;
  69. uint32_t cmlb;
  70. uint32_t pad1[1];
  71. uint32_t cusb;
  72. uint32_t pad2[41];
  73. uint32_t cbsc;
  74. uint32_t cdcrc;
  75. uint32_t cmsr0;
  76. uint32_t cmsr1;
  77. uint32_t pad3[2];
  78. };
  79. /* The mb86r0x clock reset generator */
  80. struct mb86r0x_crg {
  81. uint32_t crpr;
  82. uint32_t pad0;
  83. uint32_t crwr;
  84. uint32_t crsr;
  85. uint32_t crda;
  86. uint32_t crdb;
  87. uint32_t crha;
  88. uint32_t crpa;
  89. uint32_t crpb;
  90. uint32_t crhb;
  91. uint32_t cram;
  92. };
  93. /* The mb86r0x timer */
  94. struct mb86r0x_timer {
  95. uint32_t load;
  96. uint32_t value;
  97. uint32_t control;
  98. uint32_t intclr;
  99. uint32_t ris;
  100. uint32_t mis;
  101. uint32_t bgload;
  102. };
  103. /* mb86r0x gdc display controller */
  104. struct mb86r0x_gdc_dsp {
  105. /* Display settings */
  106. uint32_t dcm0;
  107. uint16_t pad00;
  108. uint16_t htp;
  109. uint16_t hdp;
  110. uint16_t hdb;
  111. uint16_t hsp;
  112. uint8_t hsw;
  113. uint8_t vsw;
  114. uint16_t pad01;
  115. uint16_t vtr;
  116. uint16_t vsp;
  117. uint16_t vdp;
  118. uint16_t wx;
  119. uint16_t wy;
  120. uint16_t ww;
  121. uint16_t wh;
  122. /* Layer 0 */
  123. uint32_t l0m;
  124. uint32_t l0oa;
  125. uint32_t l0da;
  126. uint16_t l0dx;
  127. uint16_t l0dy;
  128. /* Layer 1 */
  129. uint32_t l1m;
  130. uint32_t cbda0;
  131. uint32_t cbda1;
  132. uint32_t pad02;
  133. /* Layer 2 */
  134. uint32_t l2m;
  135. uint32_t l2oa0;
  136. uint32_t l2da0;
  137. uint32_t l2oa1;
  138. uint32_t l2da1;
  139. uint16_t l2dx;
  140. uint16_t l2dy;
  141. /* Layer 3 */
  142. uint32_t l3m;
  143. uint32_t l3oa0;
  144. uint32_t l3da0;
  145. uint32_t l3oa1;
  146. uint32_t l3da1;
  147. uint16_t l3dx;
  148. uint16_t l3dy;
  149. /* Layer 4 */
  150. uint32_t l4m;
  151. uint32_t l4oa0;
  152. uint32_t l4da0;
  153. uint32_t l4oa1;
  154. uint32_t l4da1;
  155. uint16_t l4dx;
  156. uint16_t l4dy;
  157. /* Layer 5 */
  158. uint32_t l5m;
  159. uint32_t l5oa0;
  160. uint32_t l5da0;
  161. uint32_t l5oa1;
  162. uint32_t l5da1;
  163. uint16_t l5dx;
  164. uint16_t l5dy;
  165. /* Cursor */
  166. uint16_t cutc;
  167. uint8_t cpm;
  168. uint8_t csize;
  169. uint32_t cuoa0;
  170. uint16_t cux0;
  171. uint16_t cuy0;
  172. uint32_t cuoa1;
  173. uint16_t cux1;
  174. uint16_t cuy1;
  175. /* Layer blending */
  176. uint32_t l0bld;
  177. uint32_t pad03;
  178. uint32_t l0tc;
  179. uint16_t l3tc;
  180. uint16_t l2tc;
  181. uint32_t pad04[15];
  182. /* Display settings */
  183. uint32_t dcm1;
  184. uint32_t dcm2;
  185. uint32_t dcm3;
  186. uint32_t pad05;
  187. /* Layer 0 extended */
  188. uint32_t l0em;
  189. uint16_t l0wx;
  190. uint16_t l0wy;
  191. uint16_t l0ww;
  192. uint16_t l0wh;
  193. uint32_t pad06;
  194. /* Layer 1 extended */
  195. uint32_t l1em;
  196. uint16_t l1wx;
  197. uint16_t l1wy;
  198. uint16_t l1ww;
  199. uint16_t l1wh;
  200. uint32_t pad07;
  201. /* Layer 2 extended */
  202. uint32_t l2em;
  203. uint16_t l2wx;
  204. uint16_t l2wy;
  205. uint16_t l2ww;
  206. uint16_t l2wh;
  207. uint32_t pad08;
  208. /* Layer 3 extended */
  209. uint32_t l3em;
  210. uint16_t l3wx;
  211. uint16_t l3wy;
  212. uint16_t l3ww;
  213. uint16_t l3wh;
  214. uint32_t pad09;
  215. /* Layer 4 extended */
  216. uint32_t l4em;
  217. uint16_t l4wx;
  218. uint16_t l4wy;
  219. uint16_t l4ww;
  220. uint16_t l4wh;
  221. uint32_t pad10;
  222. /* Layer 5 extended */
  223. uint32_t l5em;
  224. uint16_t l5wx;
  225. uint16_t l5wy;
  226. uint16_t l5ww;
  227. uint16_t l5wh;
  228. uint32_t pad11;
  229. /* Multi screen control */
  230. uint32_t msc;
  231. uint32_t pad12[3];
  232. uint32_t dls;
  233. uint32_t dbgc;
  234. /* Layer blending */
  235. uint32_t l1bld;
  236. uint32_t l2bld;
  237. uint32_t l3bld;
  238. uint32_t l4bld;
  239. uint32_t l5bld;
  240. uint32_t pad13;
  241. /* Extended transparency control */
  242. uint32_t l0etc;
  243. uint32_t l1etc;
  244. uint32_t l2etc;
  245. uint32_t l3etc;
  246. uint32_t l4etc;
  247. uint32_t l5etc;
  248. uint32_t pad14[10];
  249. /* YUV coefficients */
  250. uint32_t l1ycr0;
  251. uint32_t l1ycr1;
  252. uint32_t l1ycg0;
  253. uint32_t l1ycg1;
  254. uint32_t l1ycb0;
  255. uint32_t l1ycb1;
  256. uint32_t pad15[130];
  257. /* Layer palletes */
  258. uint32_t l0pal[256];
  259. uint32_t l1pal[256];
  260. uint32_t pad16[256];
  261. uint32_t l2pal[256];
  262. uint32_t l3pal[256];
  263. uint32_t pad17[256];
  264. /* PWM settings */
  265. uint32_t vpwmm;
  266. uint16_t vpwms;
  267. uint16_t vpwme;
  268. uint32_t vpwmc;
  269. uint32_t pad18[253];
  270. };
  271. /* mb86r0x gdc capture controller */
  272. struct mb86r0x_gdc_cap {
  273. uint32_t vcm;
  274. uint32_t csc;
  275. uint32_t vcs;
  276. uint32_t pad01;
  277. uint32_t cbm;
  278. uint32_t cboa;
  279. uint32_t cbla;
  280. uint16_t cihstr;
  281. uint16_t civstr;
  282. uint16_t cihend;
  283. uint16_t civend;
  284. uint32_t pad02;
  285. uint32_t chp;
  286. uint32_t cvp;
  287. uint32_t pad03[4];
  288. uint32_t clpf;
  289. uint32_t pad04;
  290. uint32_t cmss;
  291. uint32_t cmds;
  292. uint32_t pad05[12];
  293. uint32_t rgbhc;
  294. uint32_t rgbhen;
  295. uint32_t rgbven;
  296. uint32_t pad06;
  297. uint32_t rgbs;
  298. uint32_t pad07[11];
  299. uint32_t rgbcmy;
  300. uint32_t rgbcmcb;
  301. uint32_t rgbcmcr;
  302. uint32_t rgbcmb;
  303. uint32_t pad08[12 + 1984];
  304. };
  305. /* mb86r0x gdc draw */
  306. struct mb86r0x_gdc_draw {
  307. uint32_t ys;
  308. uint32_t xs;
  309. uint32_t dxdy;
  310. uint32_t xus;
  311. uint32_t dxudy;
  312. uint32_t xls;
  313. uint32_t dxldy;
  314. uint32_t usn;
  315. uint32_t lsn;
  316. uint32_t pad01[7];
  317. uint32_t rs;
  318. uint32_t drdx;
  319. uint32_t drdy;
  320. uint32_t gs;
  321. uint32_t dgdx;
  322. uint32_t dgdy;
  323. uint32_t bs;
  324. uint32_t dbdx;
  325. uint32_t dbdy;
  326. uint32_t pad02[7];
  327. uint32_t zs;
  328. uint32_t dzdx;
  329. uint32_t dzdy;
  330. uint32_t pad03[13];
  331. uint32_t ss;
  332. uint32_t dsdx;
  333. uint32_t dsdy;
  334. uint32_t ts;
  335. uint32_t dtdx;
  336. uint32_t dtdy;
  337. uint32_t qs;
  338. uint32_t dqdx;
  339. uint32_t dqdy;
  340. uint32_t pad04[23];
  341. uint32_t lpn;
  342. uint32_t lxs;
  343. uint32_t lxde;
  344. uint32_t lys;
  345. uint32_t lyde;
  346. uint32_t lzs;
  347. uint32_t lzde;
  348. uint32_t pad05[13];
  349. uint32_t pxdc;
  350. uint32_t pydc;
  351. uint32_t pzdc;
  352. uint32_t pad06[25];
  353. uint32_t rxs;
  354. uint32_t rys;
  355. uint32_t rsizex;
  356. uint32_t rsizey;
  357. uint32_t pad07[12];
  358. uint32_t saddr;
  359. uint32_t sstride;
  360. uint32_t srx;
  361. uint32_t sry;
  362. uint32_t daddr;
  363. uint32_t dstride;
  364. uint32_t drx;
  365. uint32_t dry;
  366. uint32_t brsizex;
  367. uint32_t brsizey;
  368. uint32_t tcolor;
  369. uint32_t pad08[93];
  370. uint32_t blpo;
  371. uint32_t pad09[7];
  372. uint32_t ctr;
  373. uint32_t ifsr;
  374. uint32_t ifcnt;
  375. uint32_t sst;
  376. uint32_t ds;
  377. uint32_t pst;
  378. uint32_t est;
  379. uint32_t pad10;
  380. uint32_t mdr0;
  381. uint32_t mdr1;
  382. uint32_t mdr2;
  383. uint32_t mdr3;
  384. uint32_t mdr4;
  385. uint32_t pad14[2];
  386. uint32_t mdr7;
  387. uint32_t fbr;
  388. uint32_t xres;
  389. uint32_t zbr;
  390. uint32_t tbr;
  391. uint32_t pfbr;
  392. uint32_t cxmin;
  393. uint32_t cxmax;
  394. uint32_t cymin;
  395. uint32_t cymax;
  396. uint32_t txs;
  397. uint32_t tis;
  398. uint32_t toa;
  399. uint32_t sho;
  400. uint32_t abr;
  401. uint32_t pad15[2];
  402. uint32_t fc;
  403. uint32_t bc;
  404. uint32_t alf;
  405. uint32_t blp;
  406. uint32_t pad16;
  407. uint32_t tbc;
  408. uint32_t pad11[42];
  409. uint32_t lx0dc;
  410. uint32_t ly0dc;
  411. uint32_t lx1dc;
  412. uint32_t ly1dc;
  413. uint32_t pad12[12];
  414. uint32_t x0dc;
  415. uint32_t y0dc;
  416. uint32_t x1dc;
  417. uint32_t y1dc;
  418. uint32_t x2dc;
  419. uint32_t y2dc;
  420. uint32_t pad13[666];
  421. };
  422. /* mb86r0x gdc geometry engine */
  423. struct mb86r0x_gdc_geom {
  424. uint32_t gctr;
  425. uint32_t pad00[15];
  426. uint32_t gmdr0;
  427. uint32_t gmdr1;
  428. uint32_t gmdr2;
  429. uint32_t pad01[237];
  430. uint32_t dfifog;
  431. uint32_t pad02[767];
  432. };
  433. /* mb86r0x gdc */
  434. struct mb86r0x_gdc {
  435. uint32_t pad00[2];
  436. uint32_t lts;
  437. uint32_t pad01;
  438. uint32_t lsta;
  439. uint32_t pad02[3];
  440. uint32_t ist;
  441. uint32_t imask;
  442. uint32_t pad03[6];
  443. uint32_t lsa;
  444. uint32_t lco;
  445. uint32_t lreq;
  446. uint32_t pad04[16*1024 - 19];
  447. struct mb86r0x_gdc_dsp dsp0;
  448. struct mb86r0x_gdc_dsp dsp1;
  449. uint32_t pad05[4*1024 - 2];
  450. uint32_t vccc;
  451. uint32_t vcsr;
  452. struct mb86r0x_gdc_cap cap0;
  453. struct mb86r0x_gdc_cap cap1;
  454. uint32_t pad06[4*1024];
  455. uint32_t texture_base[16*1024];
  456. struct mb86r0x_gdc_draw draw;
  457. uint32_t pad07[7*1024];
  458. struct mb86r0x_gdc_geom geom;
  459. uint32_t pad08[7*1024];
  460. };
  461. #endif /* __ASSEMBLY__ */
  462. /*
  463. * Physical Address Defines
  464. */
  465. #define MB86R0x_DDR2_BASE 0xf3000000
  466. #define MB86R0x_GDC_BASE 0xf1fc0000
  467. #define MB86R0x_CCNT_BASE 0xfff42000
  468. #define MB86R0x_CAN0_BASE 0xfff54000
  469. #define MB86R0x_CAN1_BASE 0xfff55000
  470. #define MB86R0x_I2C0_BASE 0xfff56000
  471. #define MB86R0x_I2C1_BASE 0xfff57000
  472. #define MB86R0x_EHCI_BASE 0xfff80000
  473. #define MB86R0x_OHCI_BASE 0xfff81000
  474. #define MB86R0x_IRC1_BASE 0xfffb0000
  475. #define MB86R0x_MEMC_BASE 0xfffc0000
  476. #define MB86R0x_TIMER_BASE 0xfffe0000
  477. #define MB86R0x_UART0_BASE 0xfffe1000
  478. #define MB86R0x_UART1_BASE 0xfffe2000
  479. #define MB86R0x_IRCE_BASE 0xfffe4000
  480. #define MB86R0x_CRG_BASE 0xfffe7000
  481. #define MB86R0x_IRC0_BASE 0xfffe8000
  482. #define MB86R0x_GPIO_BASE 0xfffe9000
  483. #define MB86R0x_PWM0_BASE 0xfff41000
  484. #define MB86R0x_PWM1_BASE 0xfff41100
  485. #define MB86R0x_CRSR_SWRSTREQ (1 << 1)
  486. /*
  487. * Timer register bits
  488. */
  489. #define MB86R0x_TIMER_ENABLE (1 << 7)
  490. #define MB86R0x_TIMER_MODE_MSK (1 << 6)
  491. #define MB86R0x_TIMER_MODE_FR (0 << 6)
  492. #define MB86R0x_TIMER_MODE_PD (1 << 6)
  493. #define MB86R0x_TIMER_INT_EN (1 << 5)
  494. #define MB86R0x_TIMER_PRS_MSK (3 << 2)
  495. #define MB86R0x_TIMER_PRS_4S (1 << 2)
  496. #define MB86R0x_TIMER_PRS_8S (1 << 3)
  497. #define MB86R0x_TIMER_SIZE_32 (1 << 1)
  498. #define MB86R0x_TIMER_ONE_SHT (1 << 0)
  499. /*
  500. * Clock reset generator bits
  501. */
  502. #define MB86R0x_CRG_CRPR_PLLRDY (1 << 8)
  503. #define MB86R0x_CRG_CRPR_PLLMODE (0x1f << 0)
  504. #define MB86R0x_CRG_CRPR_PLLMODE_X49 (0 << 0)
  505. #define MB86R0x_CRG_CRPR_PLLMODE_X46 (1 << 0)
  506. #define MB86R0x_CRG_CRPR_PLLMODE_X37 (2 << 0)
  507. #define MB86R0x_CRG_CRPR_PLLMODE_X20 (3 << 0)
  508. #define MB86R0x_CRG_CRPR_PLLMODE_X47 (4 << 0)
  509. #define MB86R0x_CRG_CRPR_PLLMODE_X44 (5 << 0)
  510. #define MB86R0x_CRG_CRPR_PLLMODE_X36 (6 << 0)
  511. #define MB86R0x_CRG_CRPR_PLLMODE_X19 (7 << 0)
  512. #define MB86R0x_CRG_CRPR_PLLMODE_X39 (8 << 0)
  513. #define MB86R0x_CRG_CRPR_PLLMODE_X38 (9 << 0)
  514. #define MB86R0x_CRG_CRPR_PLLMODE_X30 (10 << 0)
  515. #define MB86R0x_CRG_CRPR_PLLMODE_X15 (11 << 0)
  516. /*
  517. * DDR2 controller bits
  518. */
  519. #define MB86R0x_DDR2_DRCI_DRINI (1 << 15)
  520. #define MB86R0x_DDR2_DRCI_CKEN (1 << 14)
  521. #define MB86R0x_DDR2_DRCI_DRCMD (1 << 0)
  522. #define MB86R0x_DDR2_DRCI_CMD (MB86R0x_DDR2_DRCI_DRINI | \
  523. MB86R0x_DDR2_DRCI_CKEN | \
  524. MB86R0x_DDR2_DRCI_DRCMD)
  525. #define MB86R0x_DDR2_DRCI_INIT (MB86R0x_DDR2_DRCI_DRINI | \
  526. MB86R0x_DDR2_DRCI_CKEN)
  527. #define MB86R0x_DDR2_DRCI_NORMAL MB86R0x_DDR2_DRCI_CKEN
  528. #endif /* MB86R0X_H */