au1200fb.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /*
  2. * BRIEF MODULE DESCRIPTION
  3. * Hardware definitions for the Au1200 LCD controller
  4. *
  5. * Copyright 2004 AMD
  6. * Author: AMD
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  14. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  16. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. *
  24. * You should have received a copy of the GNU General Public License along
  25. * with this program; if not, write to the Free Software Foundation, Inc.,
  26. * 675 Mass Ave, Cambridge, MA 02139, USA.
  27. */
  28. #ifndef _AU1200LCD_H
  29. #define _AU1200LCD_H
  30. /********************************************************************/
  31. #define AU1200_LCD_ADDR 0xB5000000
  32. #define uint8 unsigned char
  33. #define uint32 unsigned int
  34. struct au1200_lcd {
  35. volatile uint32 reserved0;
  36. volatile uint32 screen;
  37. volatile uint32 backcolor;
  38. volatile uint32 horztiming;
  39. volatile uint32 verttiming;
  40. volatile uint32 clkcontrol;
  41. volatile uint32 pwmdiv;
  42. volatile uint32 pwmhi;
  43. volatile uint32 reserved1;
  44. volatile uint32 winenable;
  45. volatile uint32 colorkey;
  46. volatile uint32 colorkeymsk;
  47. struct
  48. {
  49. volatile uint32 cursorctrl;
  50. volatile uint32 cursorpos;
  51. volatile uint32 cursorcolor0;
  52. volatile uint32 cursorcolor1;
  53. volatile uint32 cursorcolor2;
  54. uint32 cursorcolor3;
  55. } hwc;
  56. volatile uint32 intstatus;
  57. volatile uint32 intenable;
  58. volatile uint32 outmask;
  59. volatile uint32 fifoctrl;
  60. uint32 reserved2[(0x0100-0x0058)/4];
  61. struct
  62. {
  63. volatile uint32 winctrl0;
  64. volatile uint32 winctrl1;
  65. volatile uint32 winctrl2;
  66. volatile uint32 winbuf0;
  67. volatile uint32 winbuf1;
  68. volatile uint32 winbufctrl;
  69. uint32 winreserved0;
  70. uint32 winreserved1;
  71. } window[4];
  72. uint32 reserved3[(0x0400-0x0180)/4];
  73. volatile uint32 palette[(0x0800-0x0400)/4];
  74. volatile uint8 cursorpattern[256];
  75. };
  76. /* lcd_screen */
  77. #define LCD_SCREEN_SEN (1<<31)
  78. #define LCD_SCREEN_SX (0x07FF<<19)
  79. #define LCD_SCREEN_SY (0x07FF<< 8)
  80. #define LCD_SCREEN_SWP (1<<7)
  81. #define LCD_SCREEN_SWD (1<<6)
  82. #define LCD_SCREEN_PT (7<<0)
  83. #define LCD_SCREEN_PT_TFT (0<<0)
  84. #define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
  85. #define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
  86. #define LCD_SCREEN_PT_CSTN (1<<0)
  87. #define LCD_SCREEN_PT_CDSTN (2<<0)
  88. #define LCD_SCREEN_PT_M8STN (3<<0)
  89. #define LCD_SCREEN_PT_M4STN (4<<0)
  90. /* lcd_backcolor */
  91. #define LCD_BACKCOLOR_SBGR (0xFF<<16)
  92. #define LCD_BACKCOLOR_SBGG (0xFF<<8)
  93. #define LCD_BACKCOLOR_SBGB (0xFF<<0)
  94. #define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
  95. #define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
  96. #define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
  97. /* lcd_winenable */
  98. #define LCD_WINENABLE_WEN3 (1<<3)
  99. #define LCD_WINENABLE_WEN2 (1<<2)
  100. #define LCD_WINENABLE_WEN1 (1<<1)
  101. #define LCD_WINENABLE_WEN0 (1<<0)
  102. /* lcd_colorkey */
  103. #define LCD_COLORKEY_CKR (0xFF<<16)
  104. #define LCD_COLORKEY_CKG (0xFF<<8)
  105. #define LCD_COLORKEY_CKB (0xFF<<0)
  106. #define LCD_COLORKEY_CKR_N(N) ((N)<<16)
  107. #define LCD_COLORKEY_CKG_N(N) ((N)<<8)
  108. #define LCD_COLORKEY_CKB_N(N) ((N)<<0)
  109. /* lcd_colorkeymsk */
  110. #define LCD_COLORKEYMSK_CKMR (0xFF<<16)
  111. #define LCD_COLORKEYMSK_CKMG (0xFF<<8)
  112. #define LCD_COLORKEYMSK_CKMB (0xFF<<0)
  113. #define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
  114. #define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
  115. #define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
  116. /* lcd windows control 0 */
  117. #define LCD_WINCTRL0_OX (0x07FF<<21)
  118. #define LCD_WINCTRL0_OY (0x07FF<<10)
  119. #define LCD_WINCTRL0_A (0x00FF<<2)
  120. #define LCD_WINCTRL0_AEN (1<<1)
  121. #define LCD_WINCTRL0_OX_N(N) ((N)<<21)
  122. #define LCD_WINCTRL0_OY_N(N) ((N)<<10)
  123. #define LCD_WINCTRL0_A_N(N) ((N)<<2)
  124. /* lcd windows control 1 */
  125. #define LCD_WINCTRL1_PRI (3<<30)
  126. #define LCD_WINCTRL1_PIPE (1<<29)
  127. #define LCD_WINCTRL1_FRM (0xF<<25)
  128. #define LCD_WINCTRL1_CCO (1<<24)
  129. #define LCD_WINCTRL1_PO (3<<22)
  130. #define LCD_WINCTRL1_SZX (0x07FF<<11)
  131. #define LCD_WINCTRL1_SZY (0x07FF<<0)
  132. #define LCD_WINCTRL1_FRM_1BPP (0<<25)
  133. #define LCD_WINCTRL1_FRM_2BPP (1<<25)
  134. #define LCD_WINCTRL1_FRM_4BPP (2<<25)
  135. #define LCD_WINCTRL1_FRM_8BPP (3<<25)
  136. #define LCD_WINCTRL1_FRM_12BPP (4<<25)
  137. #define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
  138. #define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
  139. #define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
  140. #define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
  141. #define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
  142. #define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
  143. #define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
  144. #define LCD_WINCTRL1_FRM_24BPP (12<<25)
  145. #define LCD_WINCTRL1_FRM_32BPP (13<<25)
  146. #define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
  147. #define LCD_WINCTRL1_PO_00 (0<<22)
  148. #define LCD_WINCTRL1_PO_01 (1<<22)
  149. #define LCD_WINCTRL1_PO_10 (2<<22)
  150. #define LCD_WINCTRL1_PO_11 (3<<22)
  151. #define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
  152. #define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
  153. /* lcd windows control 2 */
  154. #define LCD_WINCTRL2_CKMODE (3<<24)
  155. #define LCD_WINCTRL2_DBM (1<<23)
  156. #define LCD_WINCTRL2_RAM (3<<21)
  157. #define LCD_WINCTRL2_BX (0x1FFF<<8)
  158. #define LCD_WINCTRL2_SCX (0xF<<4)
  159. #define LCD_WINCTRL2_SCY (0xF<<0)
  160. #define LCD_WINCTRL2_CKMODE_00 (0<<24)
  161. #define LCD_WINCTRL2_CKMODE_01 (1<<24)
  162. #define LCD_WINCTRL2_CKMODE_10 (2<<24)
  163. #define LCD_WINCTRL2_CKMODE_11 (3<<24)
  164. #define LCD_WINCTRL2_RAM_NONE (0<<21)
  165. #define LCD_WINCTRL2_RAM_PALETTE (1<<21)
  166. #define LCD_WINCTRL2_RAM_GAMMA (2<<21)
  167. #define LCD_WINCTRL2_RAM_BUFFER (3<<21)
  168. #define LCD_WINCTRL2_BX_N(N) ((N)<<8)
  169. #define LCD_WINCTRL2_SCX_1 (0<<4)
  170. #define LCD_WINCTRL2_SCX_2 (1<<4)
  171. #define LCD_WINCTRL2_SCX_4 (2<<4)
  172. #define LCD_WINCTRL2_SCY_1 (0<<0)
  173. #define LCD_WINCTRL2_SCY_2 (1<<0)
  174. #define LCD_WINCTRL2_SCY_4 (2<<0)
  175. /* lcd windows buffer control */
  176. #define LCD_WINBUFCTRL_DB (1<<1)
  177. #define LCD_WINBUFCTRL_DBN (1<<0)
  178. /* lcd_intstatus, lcd_intenable */
  179. #define LCD_INT_IFO (0xF<<14)
  180. #define LCD_INT_IFU (0xF<<10)
  181. #define LCD_INT_OFO (1<<9)
  182. #define LCD_INT_OFU (1<<8)
  183. #define LCD_INT_WAIT (1<<3)
  184. #define LCD_INT_SD (1<<2)
  185. #define LCD_INT_SA (1<<1)
  186. #define LCD_INT_SS (1<<0)
  187. /* lcd_horztiming */
  188. #define LCD_HORZTIMING_HND2 (0x1FF<<18)
  189. #define LCD_HORZTIMING_HND1 (0x1FF<<9)
  190. #define LCD_HORZTIMING_HPW (0x1FF<<0)
  191. #define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
  192. #define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
  193. #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
  194. /* lcd_verttiming */
  195. #define LCD_VERTTIMING_VND2 (0x1FF<<18)
  196. #define LCD_VERTTIMING_VND1 (0x1FF<<9)
  197. #define LCD_VERTTIMING_VPW (0x1FF<<0)
  198. #define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
  199. #define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
  200. #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
  201. /* lcd_clkcontrol */
  202. #define LCD_CLKCONTROL_EXT (1<<22)
  203. #define LCD_CLKCONTROL_DELAY (3<<20)
  204. #define LCD_CLKCONTROL_CDD (1<<19)
  205. #define LCD_CLKCONTROL_IB (1<<18)
  206. #define LCD_CLKCONTROL_IC (1<<17)
  207. #define LCD_CLKCONTROL_IH (1<<16)
  208. #define LCD_CLKCONTROL_IV (1<<15)
  209. #define LCD_CLKCONTROL_BF (0x1F<<10)
  210. #define LCD_CLKCONTROL_PCD (0x3FF<<0)
  211. #define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
  212. #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
  213. /* lcd_pwmdiv */
  214. #define LCD_PWMDIV_EN (1<<31)
  215. #define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
  216. #define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
  217. /* lcd_pwmhi */
  218. #define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
  219. #define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
  220. #define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
  221. #define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
  222. /* lcd_hwccon */
  223. #define LCD_HWCCON_EN (1<<0)
  224. /* lcd_cursorpos */
  225. #define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
  226. #define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
  227. #define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
  228. #define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
  229. #define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
  230. #define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
  231. #define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
  232. #define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
  233. /* lcd_cursorcolor */
  234. #define LCD_CURSORCOLOR_HWCA (0xFF<<24)
  235. #define LCD_CURSORCOLOR_HWCR (0xFF<<16)
  236. #define LCD_CURSORCOLOR_HWCG (0xFF<<8)
  237. #define LCD_CURSORCOLOR_HWCB (0xFF<<0)
  238. #define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
  239. #define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
  240. #define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
  241. #define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
  242. /* lcd_fifoctrl */
  243. #define LCD_FIFOCTRL_F3IF (1<<29)
  244. #define LCD_FIFOCTRL_F3REQ (0x1F<<24)
  245. #define LCD_FIFOCTRL_F2IF (1<<29)
  246. #define LCD_FIFOCTRL_F2REQ (0x1F<<16)
  247. #define LCD_FIFOCTRL_F1IF (1<<29)
  248. #define LCD_FIFOCTRL_F1REQ (0x1F<<8)
  249. #define LCD_FIFOCTRL_F0IF (1<<29)
  250. #define LCD_FIFOCTRL_F0REQ (0x1F<<0)
  251. #define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
  252. #define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
  253. #define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
  254. #define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
  255. /* lcd_outmask */
  256. #define LCD_OUTMASK_MASK (0x00FFFFFF)
  257. /********************************************************************/
  258. #endif /* _AU1200LCD_H */
  259. /*
  260. * BRIEF MODULE DESCRIPTION
  261. * Hardware definitions for the Au1200 LCD controller
  262. *
  263. * Copyright 2004 AMD
  264. * Author: AMD
  265. *
  266. * This program is free software; you can redistribute it and/or modify it
  267. * under the terms of the GNU General Public License as published by the
  268. * Free Software Foundation; either version 2 of the License, or (at your
  269. * option) any later version.
  270. *
  271. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  272. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  273. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  274. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  275. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  276. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  277. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  278. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  279. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  280. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  281. *
  282. * You should have received a copy of the GNU General Public License along
  283. * with this program; if not, write to the Free Software Foundation, Inc.,
  284. * 675 Mass Ave, Cambridge, MA 02139, USA.
  285. */
  286. #ifndef _AU1200LCD_H
  287. #define _AU1200LCD_H
  288. /********************************************************************/
  289. #define AU1200_LCD_ADDR 0xB5000000
  290. #define uint8 unsigned char
  291. #define uint32 unsigned int
  292. struct au1200_lcd {
  293. volatile uint32 reserved0;
  294. volatile uint32 screen;
  295. volatile uint32 backcolor;
  296. volatile uint32 horztiming;
  297. volatile uint32 verttiming;
  298. volatile uint32 clkcontrol;
  299. volatile uint32 pwmdiv;
  300. volatile uint32 pwmhi;
  301. volatile uint32 reserved1;
  302. volatile uint32 winenable;
  303. volatile uint32 colorkey;
  304. volatile uint32 colorkeymsk;
  305. struct
  306. {
  307. volatile uint32 cursorctrl;
  308. volatile uint32 cursorpos;
  309. volatile uint32 cursorcolor0;
  310. volatile uint32 cursorcolor1;
  311. volatile uint32 cursorcolor2;
  312. uint32 cursorcolor3;
  313. } hwc;
  314. volatile uint32 intstatus;
  315. volatile uint32 intenable;
  316. volatile uint32 outmask;
  317. volatile uint32 fifoctrl;
  318. uint32 reserved2[(0x0100-0x0058)/4];
  319. struct
  320. {
  321. volatile uint32 winctrl0;
  322. volatile uint32 winctrl1;
  323. volatile uint32 winctrl2;
  324. volatile uint32 winbuf0;
  325. volatile uint32 winbuf1;
  326. volatile uint32 winbufctrl;
  327. uint32 winreserved0;
  328. uint32 winreserved1;
  329. } window[4];
  330. uint32 reserved3[(0x0400-0x0180)/4];
  331. volatile uint32 palette[(0x0800-0x0400)/4];
  332. volatile uint8 cursorpattern[256];
  333. };
  334. /* lcd_screen */
  335. #define LCD_SCREEN_SEN (1<<31)
  336. #define LCD_SCREEN_SX (0x07FF<<19)
  337. #define LCD_SCREEN_SY (0x07FF<< 8)
  338. #define LCD_SCREEN_SWP (1<<7)
  339. #define LCD_SCREEN_SWD (1<<6)
  340. #define LCD_SCREEN_PT (7<<0)
  341. #define LCD_SCREEN_PT_TFT (0<<0)
  342. #define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
  343. #define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
  344. #define LCD_SCREEN_PT_CSTN (1<<0)
  345. #define LCD_SCREEN_PT_CDSTN (2<<0)
  346. #define LCD_SCREEN_PT_M8STN (3<<0)
  347. #define LCD_SCREEN_PT_M4STN (4<<0)
  348. /* lcd_backcolor */
  349. #define LCD_BACKCOLOR_SBGR (0xFF<<16)
  350. #define LCD_BACKCOLOR_SBGG (0xFF<<8)
  351. #define LCD_BACKCOLOR_SBGB (0xFF<<0)
  352. #define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
  353. #define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
  354. #define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
  355. /* lcd_winenable */
  356. #define LCD_WINENABLE_WEN3 (1<<3)
  357. #define LCD_WINENABLE_WEN2 (1<<2)
  358. #define LCD_WINENABLE_WEN1 (1<<1)
  359. #define LCD_WINENABLE_WEN0 (1<<0)
  360. /* lcd_colorkey */
  361. #define LCD_COLORKEY_CKR (0xFF<<16)
  362. #define LCD_COLORKEY_CKG (0xFF<<8)
  363. #define LCD_COLORKEY_CKB (0xFF<<0)
  364. #define LCD_COLORKEY_CKR_N(N) ((N)<<16)
  365. #define LCD_COLORKEY_CKG_N(N) ((N)<<8)
  366. #define LCD_COLORKEY_CKB_N(N) ((N)<<0)
  367. /* lcd_colorkeymsk */
  368. #define LCD_COLORKEYMSK_CKMR (0xFF<<16)
  369. #define LCD_COLORKEYMSK_CKMG (0xFF<<8)
  370. #define LCD_COLORKEYMSK_CKMB (0xFF<<0)
  371. #define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
  372. #define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
  373. #define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
  374. /* lcd windows control 0 */
  375. #define LCD_WINCTRL0_OX (0x07FF<<21)
  376. #define LCD_WINCTRL0_OY (0x07FF<<10)
  377. #define LCD_WINCTRL0_A (0x00FF<<2)
  378. #define LCD_WINCTRL0_AEN (1<<1)
  379. #define LCD_WINCTRL0_OX_N(N) ((N)<<21)
  380. #define LCD_WINCTRL0_OY_N(N) ((N)<<10)
  381. #define LCD_WINCTRL0_A_N(N) ((N)<<2)
  382. /* lcd windows control 1 */
  383. #define LCD_WINCTRL1_PRI (3<<30)
  384. #define LCD_WINCTRL1_PIPE (1<<29)
  385. #define LCD_WINCTRL1_FRM (0xF<<25)
  386. #define LCD_WINCTRL1_CCO (1<<24)
  387. #define LCD_WINCTRL1_PO (3<<22)
  388. #define LCD_WINCTRL1_SZX (0x07FF<<11)
  389. #define LCD_WINCTRL1_SZY (0x07FF<<0)
  390. #define LCD_WINCTRL1_FRM_1BPP (0<<25)
  391. #define LCD_WINCTRL1_FRM_2BPP (1<<25)
  392. #define LCD_WINCTRL1_FRM_4BPP (2<<25)
  393. #define LCD_WINCTRL1_FRM_8BPP (3<<25)
  394. #define LCD_WINCTRL1_FRM_12BPP (4<<25)
  395. #define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
  396. #define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
  397. #define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
  398. #define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
  399. #define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
  400. #define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
  401. #define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
  402. #define LCD_WINCTRL1_FRM_24BPP (12<<25)
  403. #define LCD_WINCTRL1_FRM_32BPP (13<<25)
  404. #define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
  405. #define LCD_WINCTRL1_PO_00 (0<<22)
  406. #define LCD_WINCTRL1_PO_01 (1<<22)
  407. #define LCD_WINCTRL1_PO_10 (2<<22)
  408. #define LCD_WINCTRL1_PO_11 (3<<22)
  409. #define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
  410. #define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
  411. /* lcd windows control 2 */
  412. #define LCD_WINCTRL2_CKMODE (3<<24)
  413. #define LCD_WINCTRL2_DBM (1<<23)
  414. #define LCD_WINCTRL2_RAM (3<<21)
  415. #define LCD_WINCTRL2_BX (0x1FFF<<8)
  416. #define LCD_WINCTRL2_SCX (0xF<<4)
  417. #define LCD_WINCTRL2_SCY (0xF<<0)
  418. #define LCD_WINCTRL2_CKMODE_00 (0<<24)
  419. #define LCD_WINCTRL2_CKMODE_01 (1<<24)
  420. #define LCD_WINCTRL2_CKMODE_10 (2<<24)
  421. #define LCD_WINCTRL2_CKMODE_11 (3<<24)
  422. #define LCD_WINCTRL2_RAM_NONE (0<<21)
  423. #define LCD_WINCTRL2_RAM_PALETTE (1<<21)
  424. #define LCD_WINCTRL2_RAM_GAMMA (2<<21)
  425. #define LCD_WINCTRL2_RAM_BUFFER (3<<21)
  426. #define LCD_WINCTRL2_BX_N(N) ((N)<<8)
  427. #define LCD_WINCTRL2_SCX_1 (0<<4)
  428. #define LCD_WINCTRL2_SCX_2 (1<<4)
  429. #define LCD_WINCTRL2_SCX_4 (2<<4)
  430. #define LCD_WINCTRL2_SCY_1 (0<<0)
  431. #define LCD_WINCTRL2_SCY_2 (1<<0)
  432. #define LCD_WINCTRL2_SCY_4 (2<<0)
  433. /* lcd windows buffer control */
  434. #define LCD_WINBUFCTRL_DB (1<<1)
  435. #define LCD_WINBUFCTRL_DBN (1<<0)
  436. /* lcd_intstatus, lcd_intenable */
  437. #define LCD_INT_IFO (0xF<<14)
  438. #define LCD_INT_IFU (0xF<<10)
  439. #define LCD_INT_OFO (1<<9)
  440. #define LCD_INT_OFU (1<<8)
  441. #define LCD_INT_WAIT (1<<3)
  442. #define LCD_INT_SD (1<<2)
  443. #define LCD_INT_SA (1<<1)
  444. #define LCD_INT_SS (1<<0)
  445. /* lcd_horztiming */
  446. #define LCD_HORZTIMING_HND2 (0x1FF<<18)
  447. #define LCD_HORZTIMING_HND1 (0x1FF<<9)
  448. #define LCD_HORZTIMING_HPW (0x1FF<<0)
  449. #define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
  450. #define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
  451. #define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
  452. /* lcd_verttiming */
  453. #define LCD_VERTTIMING_VND2 (0x1FF<<18)
  454. #define LCD_VERTTIMING_VND1 (0x1FF<<9)
  455. #define LCD_VERTTIMING_VPW (0x1FF<<0)
  456. #define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
  457. #define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
  458. #define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
  459. /* lcd_clkcontrol */
  460. #define LCD_CLKCONTROL_EXT (1<<22)
  461. #define LCD_CLKCONTROL_DELAY (3<<20)
  462. #define LCD_CLKCONTROL_CDD (1<<19)
  463. #define LCD_CLKCONTROL_IB (1<<18)
  464. #define LCD_CLKCONTROL_IC (1<<17)
  465. #define LCD_CLKCONTROL_IH (1<<16)
  466. #define LCD_CLKCONTROL_IV (1<<15)
  467. #define LCD_CLKCONTROL_BF (0x1F<<10)
  468. #define LCD_CLKCONTROL_PCD (0x3FF<<0)
  469. #define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
  470. #define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
  471. /* lcd_pwmdiv */
  472. #define LCD_PWMDIV_EN (1<<31)
  473. #define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
  474. #define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
  475. /* lcd_pwmhi */
  476. #define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
  477. #define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
  478. #define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
  479. #define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
  480. /* lcd_hwccon */
  481. #define LCD_HWCCON_EN (1<<0)
  482. /* lcd_cursorpos */
  483. #define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
  484. #define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
  485. #define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
  486. #define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
  487. #define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
  488. #define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
  489. #define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
  490. #define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
  491. /* lcd_cursorcolor */
  492. #define LCD_CURSORCOLOR_HWCA (0xFF<<24)
  493. #define LCD_CURSORCOLOR_HWCR (0xFF<<16)
  494. #define LCD_CURSORCOLOR_HWCG (0xFF<<8)
  495. #define LCD_CURSORCOLOR_HWCB (0xFF<<0)
  496. #define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
  497. #define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
  498. #define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
  499. #define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
  500. /* lcd_fifoctrl */
  501. #define LCD_FIFOCTRL_F3IF (1<<29)
  502. #define LCD_FIFOCTRL_F3REQ (0x1F<<24)
  503. #define LCD_FIFOCTRL_F2IF (1<<29)
  504. #define LCD_FIFOCTRL_F2REQ (0x1F<<16)
  505. #define LCD_FIFOCTRL_F1IF (1<<29)
  506. #define LCD_FIFOCTRL_F1REQ (0x1F<<8)
  507. #define LCD_FIFOCTRL_F0IF (1<<29)
  508. #define LCD_FIFOCTRL_F0REQ (0x1F<<0)
  509. #define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
  510. #define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
  511. #define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
  512. #define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
  513. /* lcd_outmask */
  514. #define LCD_OUTMASK_MASK (0x00FFFFFF)
  515. /********************************************************************/
  516. #endif /* _AU1200LCD_H */