x1000_slcdc.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. /*
  2. * File : x1000_slcdc.h
  3. * COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team
  4. *
  5. * Change Logs:
  6. * Date Author Notes
  7. * 2017Äê3ÔÂ20ÈÕ Urey the first version
  8. */
  9. #ifndef _X1000_SLCDC_H_
  10. #define _X1000_SLCDC_H_
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /*************************************************************************
  15. * SLCD (Smart LCD Controller)
  16. *************************************************************************/
  17. #define LCDC0_BASE LCD_BASE
  18. #define SLCDC_CFG (LCDC0_BASE + 0xA0) /* SLCDC Configure Register */
  19. #define SLCDC_CTRL (LCDC0_BASE + 0xA4) /* SLCDC Control Register */
  20. #define SLCDC_STATE (LCDC0_BASE + 0xA8) /* SLCDC Status Register */
  21. #define SLCDC_DATA (LCDC0_BASE + 0xAC) /* SLCDC Data Register */
  22. #define SLCDC_CFG_NEW (LCDC0_BASE + 0xB8)
  23. #define SLCDC_WTIME (LCDC0_BASE + 0xB0)
  24. #define SLCDC_TAS (LCDC0_BASE + 0xB4)
  25. #define SLCDC_SLOW_TIME (LCDC0_BASE + 0xBC)
  26. /* SLCDC Configure Register */
  27. #define SLCDC_CFG_DWIDTH_BIT 10
  28. #define SLCDC_CFG_DWIDTH_MASK (0x7 << SLCDC_CFG_DWIDTH_BIT)
  29. #define SLCDC_CFG_DWIDTH_18BIT (0 << SLCDC_CFG_DWIDTH_BIT)
  30. #define SLCDC_CFG_DWIDTH_16BIT (1 << SLCDC_CFG_DWIDTH_BIT)
  31. #define SLCDC_CFG_DWIDTH_8BIT_x3 (2 << SLCDC_CFG_DWIDTH_BIT)
  32. #define SLCDC_CFG_DWIDTH_8BIT_x2 (3 << SLCDC_CFG_DWIDTH_BIT)
  33. #define SLCDC_CFG_DWIDTH_8BIT_x1 (4 << SLCDC_CFG_DWIDTH_BIT)
  34. #define SLCDC_CFG_DWIDTH_24BIT (5 << SLCDC_CFG_DWIDTH_BIT)
  35. #define SLCDC_CFG_DWIDTH_9BIT_x2 (7 << SLCDC_CFG_DWIDTH_BIT)
  36. #define SLCDC_CFG_CWIDTH_BIT (8)
  37. #define SLCDC_CFG_CWIDTH_MASK (0x3 << SLCDC_CFG_CWIDTH_BIT)
  38. #define SLCDC_CFG_CWIDTH_16BIT (0 << SLCDC_CFG_CWIDTH_BIT)
  39. #define SLCDC_CFG_CWIDTH_8BIT (1 << SLCDC_CFG_CWIDTH_BIT)
  40. #define SLCDC_CFG_CWIDTH_18BIT (2 << SLCDC_CFG_CWIDTH_BIT)
  41. #define SLCDC_CFG_CWIDTH_24BIT (3 << SLCDC_CFG_CWIDTH_BIT)
  42. #define SLCDC_CFG_CS_ACTIVE_LOW (0 << 4)
  43. #define SLCDC_CFG_CS_ACTIVE_HIGH (1 << 4)
  44. #define SLCDC_CFG_RS_CMD_LOW (0 << 3)
  45. #define SLCDC_CFG_RS_CMD_HIGH (1 << 3)
  46. #define SLCDC_CFG_CLK_ACTIVE_FALLING (0 << 1)
  47. #define SLCDC_CFG_CLK_ACTIVE_RISING (1 << 1)
  48. #define SLCDC_CFG_TYPE_PARALLEL (0 << 0)
  49. #define SLCDC_CFG_TYPE_SERIAL (1 << 0)
  50. /* SLCD New Configure Register */
  51. #define SLCDC_NEW_CFG_DWIDTH_BIT 13
  52. #define SLCDC_NEW_CFG_DWIDTH_MASK (0x7 << SLCDC_NEW_CFG_DWIDTH_BIT)
  53. #define SLCDC_NEW_CFG_DWIDTH_8BIT (0 << SLCDC_NEW_CFG_DWIDTH_BIT)
  54. #define SLCDC_NEW_CFG_DWIDTH_9BIT (1 << SLCDC_NEW_CFG_DWIDTH_BIT)
  55. #define SLCDC_NEW_CFG_DWIDTH_16BIT (2 << SLCDC_NEW_CFG_DWIDTH_BIT)
  56. #define SLCDC_NEW_CFG_DWIDTH_18BIT (3 << SLCDC_NEW_CFG_DWIDTH_BIT)
  57. #define SLCDC_NEW_CFG_DWIDTH_24BIT (4 << SLCDC_NEW_CFG_DWIDTH_BIT)
  58. #define SLCDC_NEW_CFG_6800_MD (1 << 11)
  59. #define SLCDC_NEW_CFG_CMD_9BIT (1 << 10) /* only use in old slcd */
  60. #define SLCDC_NEW_CFG_CMD_16BIT (0 << 10) /* only use in old slcd */
  61. #define SLCDC_NEW_CFG_DTIME_BIT 8
  62. #define SLCDC_NEW_CFG_DTIME_MASK (0x3 << SLCDC_NEW_CFG_DTIME_BIT)
  63. #define SLCDC_NEW_CFG_DTIME_ONCE (0 << SLCDC_NEW_CFG_DTIME_BIT)
  64. #define SLCDC_NEW_CFG_DTIME_TWICE (1 << SLCDC_NEW_CFG_DTIME_BIT)
  65. #define SLCDC_NEW_CFG_DTIME_THREE (2 << SLCDC_NEW_CFG_DTIME_BIT)
  66. #define SLCDC_NEW_CFG_CS_HIGH_IDLE (0 << 5)
  67. #define SLCDC_NEW_CFG_CS_LOW_IDLE (1 << 5)
  68. #define SLCDC_NEW_CFG_RS_CMD_LOW (0 << 4)
  69. #define SLCDC_NEW_CFG_RS_CMD_HIGH (1 << 4)
  70. #define SLCDC_NEW_CFG_CLK_ACTIVE_FALLING (0 << 3)
  71. #define SLCDC_NEW_CFG_CLK_ACTIVE_RISING (1 << 3)
  72. #define SLCDC_NEW_CFG_DTYPE_PARALLEL (0 << 2)
  73. #define SLCDC_NEW_CFG_DTYPE_SERIAL (1 << 2)
  74. #define SLCDC_NEW_CFG_CTYPE_PARALLEL (0 << 1)
  75. #define SLCDC_NEW_CFG_CTYPE_SERIAL (1 << 1)
  76. #define SLCDC_NEW_CFG_FMT_CONV_EN (1 << 0)
  77. /* SLCD Control Register */
  78. #define SLCDC_CTRL_TE_INV (1 << 9)
  79. #define SLCDC_CTRL_NOT_USE_TE (1 << 8)
  80. #define SLCDC_CTRL_DCSI_SEL (1 << 7)
  81. #define SLCDC_CTRL_MIPI_MODE (1 << 6)
  82. #define SLCDC_CTRL_NEW_MODE (1 << 5)
  83. #define SLCDC_CTRL_FAST_MODE (1 << 4)
  84. #define SLCDC_CTRL_GATE_MASK (1 << 3)
  85. #define SLCDC_CTRL_DMA_MODE (1 << 2)
  86. #define SLCDC_CTRL_DMA_START (1 << 1)
  87. #define SLCDC_CTRL_DMA_EN (1 << 0)
  88. /* SLCD Status Register */
  89. #define SLCDC_STATE_BUSY (1 << 0)
  90. /* SLCD Data Register */
  91. #define SLCDC_DATA_RS_DATA (0 << 30)
  92. #define SLCDC_DATA_RS_COMMAND (1 << 30)
  93. /*************************************************************************
  94. * LCDC (LCD Controller)
  95. *************************************************************************/
  96. #define LCDC_CFG (LCDC0_BASE + 0x00)
  97. #define LCDC_CTRL (LCDC0_BASE + 0x30)
  98. #define LCDC_STATE (LCDC0_BASE + 0x34)
  99. #define LCDC_OSDC (LCDC0_BASE + 0x100)
  100. #define LCDC_OSDCTRL (LCDC0_BASE + 0x104)
  101. #define LCDC_OSDS (LCDC0_BASE + 0x108)
  102. #define LCDC_BGC0 (LCDC0_BASE + 0x10C)
  103. #define LCDC_BGC1 (LCDC0_BASE + 0x2C4)
  104. #define LCDC_KEY0 (LCDC0_BASE + 0x110)
  105. #define LCDC_KEY1 (LCDC0_BASE + 0x114)
  106. #define LCDC_ALPHA (LCDC0_BASE + 0x118)
  107. #define LCDC_RGBC (LCDC0_BASE + 0x90)
  108. #define LCDC_VAT (LCDC0_BASE + 0x0c)
  109. #define LCDC_DAH (LCDC0_BASE + 0x10)
  110. #define LCDC_DAV (LCDC0_BASE + 0x14)
  111. #define LCDC_XYP0 (LCDC0_BASE + 0x120)
  112. #define LCDC_XYP1 (LCDC0_BASE + 0x124)
  113. #define LCDC_SIZE0 (LCDC0_BASE + 0x128)
  114. #define LCDC_SIZE1 (LCDC0_BASE + 0x12C)
  115. #define LCDC_VSYNC (LCDC0_BASE + 0x04)
  116. #define LCDC_HSYNC (LCDC0_BASE + 0x08)
  117. #define LCDC_PS (LCDC0_BASE + 0x18)
  118. #define LCDC_CLS (LCDC0_BASE + 0x1c)
  119. #define LCDC_SPL (LCDC0_BASE + 0x20)
  120. #define LCDC_REV (LCDC0_BASE + 0x24)
  121. #define LCDC_IID (LCDC0_BASE + 0x38)
  122. #define LCDC_DA0 (LCDC0_BASE + 0x40)
  123. #define LCDC_SA0 (LCDC0_BASE + 0x44)
  124. #define LCDC_FID0 (LCDC0_BASE + 0x48)
  125. #define LCDC_CMD0 (LCDC0_BASE + 0x4c)
  126. #define LCDC_DA1 (LCDC0_BASE + 0x50)
  127. #define LCDC_SA1 (LCDC0_BASE + 0x54)
  128. #define LCDC_FID1 (LCDC0_BASE + 0x58)
  129. #define LCDC_CMD1 (LCDC0_BASE + 0x5c)
  130. #define LCDC_OFFS0 (LCDC0_BASE + 0x60)
  131. #define LCDC_PW0 (LCDC0_BASE + 0x64)
  132. #define LCDC_CNUM0 (LCDC0_BASE + 0x68)
  133. #define LCDC_DESSIZE0 (LCDC0_BASE + 0x6C)
  134. #define LCDC_OFFS1 (LCDC0_BASE + 0x70)
  135. #define LCDC_PW1 (LCDC0_BASE + 0x74)
  136. #define LCDC_CNUM1 (LCDC0_BASE + 0x78)
  137. #define LCDC_DESSIZE1 (LCDC0_BASE + 0x7C)
  138. #define LCDC_PCFG (LCDC0_BASE + 0x2C0)
  139. #define LCDC_CPOS1 (0x78)
  140. #define LCDC_DUAL_CTRL (0x2c8)
  141. #define LCDC_ENH_CFG (0x400)
  142. #define LCDC_ENH_CSCCFG (0x404)
  143. #define LCDC_ENH_LUMACFG (0x408)
  144. #define LCDC_ENH_CHROCFG0 (0x40c)
  145. #define LCDC_ENH_CHROCFG1 (0x410)
  146. #define LCDC_ENH_DITHERCFG (0x414)
  147. #define LCDC_ENH_STATUS (0x418)
  148. #define LCDC_ENH_GAMMA (0x800)
  149. #define LCDC_ENH_VEE (0x1000)
  150. /* LCD Configure Register */
  151. #define LCDC_CFG_LCDPIN_BIT 31
  152. #define LCDC_CFG_LCDPIN_MASK (0x1 << LCDC_CFG_LCDPIN_BIT)
  153. #define LCDC_CFG_LCDPIN_LCD (0x0 << LCDC_CFG_LCDPIN_BIT)
  154. #define LCDC_CFG_LCDPIN_SLCD (0x1 << LCDC_CFG_LCDPIN_BIT)
  155. #define LCDC_CFG_TVEPEH (1 << 30)
  156. #define LCDC_CFG_NEWDES (1 << 28)
  157. #define LCDC_CFG_PALBP (1 << 27)
  158. #define LCDC_CFG_TVEN (1 << 26)
  159. #define LCDC_CFG_RECOVER (1 << 25)
  160. #define LCDC_CFG_PSM (1 << 23)
  161. #define LCDC_CFG_CLSM (1 << 22)
  162. #define LCDC_CFG_SPLM (1 << 21)
  163. #define LCDC_CFG_REVM (1 << 20)
  164. #define LCDC_CFG_HSYNM (1 << 19)
  165. #define LCDC_CFG_PCLKM (1 << 18)
  166. #define LCDC_CFG_INVDAT (1 << 17)
  167. #define LCDC_CFG_SYNDIR_IN (1 << 16)
  168. #define LCDC_CFG_PSP (1 << 15)
  169. #define LCDC_CFG_CLSP (1 << 14)
  170. #define LCDC_CFG_SPLP (1 << 13)
  171. #define LCDC_CFG_REVP (1 << 12)
  172. #define LCDC_CFG_HSP (1 << 11)
  173. #define LCDC_CFG_PCP (1 << 10)
  174. #define LCDC_CFG_DEP (1 << 9)
  175. #define LCDC_CFG_VSP (1 << 8)
  176. #define LCDC_CFG_MODE_TFT_18BIT (1 << 7)
  177. #define LCDC_CFG_MODE_TFT_16BIT (0 << 7)
  178. #define LCDC_CFG_MODE_TFT_24BIT (1 << 6)
  179. #define LCDC_CFG_MODE_BIT 0
  180. #define LCDC_CFG_MODE_MASK (0x0f << LCDC_CFG_MODE_BIT)
  181. #define LCDC_CFG_MODE_GENERIC_TFT (0 << LCDC_CFG_MODE_BIT)
  182. #define LCDC_CFG_MODE_SPECIAL_TFT_1 (1 << LCDC_CFG_MODE_BIT)
  183. #define LCDC_CFG_MODE_SPECIAL_TFT_2 (2 << LCDC_CFG_MODE_BIT)
  184. #define LCDC_CFG_MODE_SPECIAL_TFT_3 (3 << LCDC_CFG_MODE_BIT)
  185. #define LCDC_CFG_MODE_NONINTER_CCIR656 (4 << LCDC_CFG_MODE_BIT)
  186. #define LCDC_CFG_MODE_INTER_CCIR656 (6 << LCDC_CFG_MODE_BIT)
  187. #define LCDC_CFG_MODE_SERIAL_TFT (12 << LCDC_CFG_MODE_BIT)
  188. #define LCDC_CFG_MODE_LCM (13 << LCDC_CFG_MODE_BIT)
  189. /* LCD Control Register */
  190. #define LCDC_CTRL_PINMD (1 << 31)
  191. #define LCDC_CTRL_BST_BIT 28
  192. #define LCDC_CTRL_BST_MASK (0x7 << LCDC_CTRL_BST_BIT)
  193. #define LCDC_CTRL_BST_4 (0 << LCDC_CTRL_BST_BIT)
  194. #define LCDC_CTRL_BST_8 (1 << LCDC_CTRL_BST_BIT)
  195. #define LCDC_CTRL_BST_16 (2 << LCDC_CTRL_BST_BIT)
  196. #define LCDC_CTRL_BST_32 (3 << LCDC_CTRL_BST_BIT)
  197. #define LCDC_CTRL_BST_64 (4 << LCDC_CTRL_BST_BIT)
  198. #define LCDC_CTRL_RGB565 (0 << 27)
  199. #define LCDC_CTRL_RGB555 (1 << 27)
  200. #define LCDC_CTRL_OFUP (1 << 26)
  201. #define LCDC_CTRL_PDD_BIT 16
  202. #define LCDC_CTRL_PDD_MASK (0xff << LCDC_CTRL_PDD_BIT)
  203. #define LCDC_CTRL_DACTE (1 << 14)
  204. #define LCDC_CTRL_EOFM (1 << 13)
  205. #define LCDC_CTRL_SOFM (1 << 12)
  206. #define LCDC_CTRL_OFUM (1 << 11)
  207. #define LCDC_CTRL_IFUM0 (1 << 10)
  208. #define LCDC_CTRL_IFUM1 (1 << 9)
  209. #define LCDC_CTRL_LDDM (1 << 8)
  210. #define LCDC_CTRL_QDM (1 << 7)
  211. #define LCDC_CTRL_BEDN (1 << 6)
  212. #define LCDC_CTRL_PEDN (1 << 5)
  213. #define LCDC_CTRL_DIS (1 << 4)
  214. #define LCDC_CTRL_ENA (1 << 3)
  215. #define LCDC_CTRL_BPP_BIT 0
  216. #define LCDC_CTRL_BPP_MASK (0x07 << LCDC_CTRL_BPP_BIT)
  217. #define LCDC_CTRL_BPP_1 (0 << LCDC_CTRL_BPP_BIT)
  218. #define LCDC_CTRL_BPP_2 (1 << LCDC_CTRL_BPP_BIT)
  219. #define LCDC_CTRL_BPP_4 (2 << LCDC_CTRL_BPP_BIT)
  220. #define LCDC_CTRL_BPP_8 (3 << LCDC_CTRL_BPP_BIT)
  221. #define LCDC_CTRL_BPP_16 (4 << LCDC_CTRL_BPP_BIT)
  222. #define LCDC_CTRL_BPP_18_24 (5 << LCDC_CTRL_BPP_BIT)
  223. #define LCDC_CTRL_BPP_CMPS_24 (6 << LCDC_CTRL_BPP_BIT)
  224. #define LCDC_CTRL_BPP_30 (7 << LCDC_CTRL_BPP_BIT)
  225. /* LCD Status Register */
  226. #define LCDC_STATE_QD (1 << 7)
  227. #define LCDC_STATE_EOF (1 << 5)
  228. #define LCDC_STATE_SOF (1 << 4)
  229. #define LCDC_STATE_OFU (1 << 3)
  230. #define LCDC_STATE_IFU0 (1 << 2)
  231. #define LCDC_STATE_IFU1 (1 << 1)
  232. #define LCDC_STATE_LDD (1 << 0)
  233. /* OSD Configure Register */
  234. #define LCDC_OSDC_PREMULTI1 (1 << 23)
  235. #define LCDC_OSDC_COEF_SLE1_BIT 21
  236. #define LCDC_OSDC_COEF_SLE1_MASK (0x03 << LCDC_OSDC_COEF_SLE1_BIT)
  237. #define LCDC_OSDC_COEF_SLE1_0 (0 << LCDC_OSDC_COEF_SLE1_BIT)
  238. #define LCDC_OSDC_COEF_SLE1_1 (1 << LCDC_OSDC_COEF_SLE1_BIT)
  239. #define LCDC_OSDC_COEF_SLE1_2 (2 << LCDC_OSDC_COEF_SLE1_BIT)
  240. #define LCDC_OSDC_COEF_SLE1_3 (3 << LCDC_OSDC_COEF_SLE1_BIT)
  241. #define LCDC_OSDC_PREMULTI0 (1 << 20)
  242. #define LCDC_OSDC_COEF_SLE0_BIT 18
  243. #define LCDC_OSDC_COEF_SLE0_MASK (0x03 << LCDC_OSDC_COEF_SLE0_BIT)
  244. #define LCDC_OSDC_COEF_SLE0_0 (0 << LCDC_OSDC_COEF_SLE0_BIT)
  245. #define LCDC_OSDC_COEF_SLE0_1 (1 << LCDC_OSDC_COEF_SLE0_BIT)
  246. #define LCDC_OSDC_COEF_SLE0_2 (2 << LCDC_OSDC_COEF_SLE0_BIT)
  247. #define LCDC_OSDC_COEF_SLE0_3 (3 << LCDC_OSDC_COEF_SLE0_BIT)
  248. #define LCDC_OSDC_ALPHAMD1 (1 << 17)
  249. #define LCDC_OSDC_SOFM1 (1 << 15)
  250. #define LCDC_OSDC_EOFM1 (1 << 14)
  251. #define LCDC_OSDC_SOFM0 (1 << 11)
  252. #define LCDC_OSDC_EOFM0 (1 << 10)
  253. #define LCDC_OSDC_DENDM (1 << 9)
  254. #define LCDC_OSDC_F1EN (1 << 4)
  255. #define LCDC_OSDC_F0EN (1 << 3)
  256. #define LCDC_OSDC_ALPHAEN (1 << 2)
  257. #define LCDC_OSDC_ALPHAMD0 (1 << 1)
  258. #define LCDC_OSDC_OSDEN (1 << 0)
  259. /* OSD Controll Register */
  260. #define LCDC_OSDCTRL_IPU_CLKEN (1 << 15)
  261. #define LCDC_OSDCTRL_RGB0_RGB565 (0 << 5)
  262. #define LCDC_OSDCTRL_RGB0_RGB555 (1 << 5)
  263. #define LCDC_OSDCTRL_RGB1_RGB565 (0 << 4)
  264. #define LCDC_OSDCTRL_RGB1_RGB555 (1 << 4)
  265. #define LCDC_OSDCTRL_BPP_BIT 0
  266. #define LCDC_OSDCTRL_BPP_MASK (0x7<<LCDC_OSDCTRL_BPP_BIT)
  267. #define LCDC_OSDCTRL_BPP_15_16 (4 << LCDC_OSDCTRL_BPP_BIT)
  268. #define LCDC_OSDCTRL_BPP_18_24 (5 << LCDC_OSDCTRL_BPP_BIT)
  269. #define LCDC_OSDCTRL_BPP_CMPS_24 (6 << LCDC_OSDCTRL_BPP_BIT)
  270. #define LCDC_OSDCTRL_BPP_30 (7 << LCDC_OSDCTRL_BPP_BIT)
  271. /* OSD State Register */
  272. #define LCDC_OSDS_SOF1 (1 << 15)
  273. #define LCDC_OSDS_EOF1 (1 << 14)
  274. #define LCDC_OSDS_SOF0 (1 << 11)
  275. #define LCDC_OSDS_EOF0 (1 << 10)
  276. #define LCDC_OSDS_DEND (1 << 8)
  277. /* Background 0 or Background 1 Color Register */
  278. #define LCDC_BGC_RED_OFFSET 16
  279. #define LCDC_BGC_RED_MASK (0xFF << LCDC_BGC_RED_OFFSET)
  280. #define LCDC_BGC_GREEN_OFFSET 8
  281. #define LCDC_BGC_GREEN_MASK (0xFF << LCDC_BGC_GREEN_OFFSET)
  282. #define LCDC_BGC_BLUE_OFFSET 0
  283. #define LCDC_BGC_BLUE_MASK (0xFF << LCDC_BGC_BLUE_OFFSET)
  284. /* Foreground 0 or Foreground 1 Color Key Register */
  285. #define LCDC_KEY_KEYEN (1 << 31)
  286. #define LCDC_KEY_KEYMD (1 << 30)
  287. #define LCDC_KEY_RED_OFFSET 16
  288. #define LCDC_KEY_RED_MASK (0xFF << LCDC_KEY_RED_OFFSET)
  289. #define LCDC_KEY_GREEN_OFFSET 8
  290. #define LCDC_KEY_GREEN_MASK (0xFF << LCDC_KEY_GREEN_OFFSET)
  291. #define LCDC_KEY_BLUE_OFFSET 0
  292. #define LCDC_KEY_BLUE_MASK (0xFF << LCDC_KEY_BLUE_OFFSET)
  293. #define LCDC_KEY_MASK (LCDC_KEY_RED_MASK | LCDC_KEY_GREEN_MASK\
  294. /* ALPHA Register */
  295. #define LCDC_ALPHA1_OFFSET 8
  296. #define LCDC_ALPHA1_MASK (0xFF << LCDC_ALPHA1_OFFSET)
  297. #define LCDC_ALPHA0_OFFSET 0
  298. #define LCDC_ALPHA0_MASK (0xFF << LCDC_ALPHA0_OFFSET)
  299. /* IPU Restart Register */
  300. #define LCDC_IPUR_IPUREN (1 << 31)
  301. #define LCDC_IPUR_IPURMASK (0xFFFFFF)
  302. /* RGB Control Register */
  303. #define LCDC_RGBC_RGBDM (1 << 15)
  304. #define LCDC_RGBC_DMM (1 << 14)
  305. #define LCDC_RGBC_RGBFMT (1 << 7)
  306. #define LCDC_RGBC_ODDRGB_BIT 4
  307. #define LCDC_RGBC_ODDRGB_MASK (0x7 << LCDC_RGBC_ODDRGB_BIT)
  308. #define LCDC_RGBC_ODD_RGB (0 << LCDC_RGBC_ODDRGB_BIT)
  309. #define LCDC_RGBC_ODD_RBG (1 << LCDC_RGBC_ODDRGB_BIT)
  310. #define LCDC_RGBC_ODD_GRB (2 << LCDC_RGBC_ODDRGB_BIT)
  311. #define LCDC_RGBC_ODD_GBR (3 << LCDC_RGBC_ODDRGB_BIT)
  312. #define LCDC_RGBC_ODD_BRG (4 << LCDC_RGBC_ODDRGB_BIT)
  313. #define LCDC_RGBC_ODD_BGR (5 << LCDC_RGBC_ODDRGB_BIT)
  314. #define LCDC_RGBC_EVENRGB_BIT 0
  315. #define LCDC_RGBC_EVENRGB_MASK (0x7<<LCDC_RGBC_EVENRGB_BIT)
  316. #define LCDC_RGBC_EVEN_RGB 0
  317. #define LCDC_RGBC_EVEN_RBG 1
  318. #define LCDC_RGBC_EVEN_GRB 2
  319. #define LCDC_RGBC_EVEN_GBR 3
  320. #define LCDC_RGBC_EVEN_BRG 4
  321. #define LCDC_RGBC_EVEN_BGR 5
  322. /* Vertical Synchronize Register */
  323. #define LCDC_VSYNC_VPS_BIT 16
  324. #define LCDC_VSYNC_VPS_MASK (0xfff << LCDC_VSYNC_VPS_BIT)
  325. #define LCDC_VSYNC_VPE_BIT 0
  326. #define LCDC_VSYNC_VPE_MASK (0xfff << LCDC_VSYNC_VPE_BIT)
  327. /* Horizontal Synchronize Register */
  328. #define LCDC_HSYNC_HPS_BIT 16
  329. #define LCDC_HSYNC_HPS_MASK (0xfff << LCDC_HSYNC_HPS_BIT)
  330. #define LCDC_HSYNC_HPE_BIT 0
  331. #define LCDC_HSYNC_HPE_MASK (0xfff << LCDC_HSYNC_HPE_BIT)
  332. /* Virtual Area Setting Register */
  333. #define LCDC_VAT_HT_BIT 16
  334. #define LCDC_VAT_HT_MASK (0xfff << LCDC_VAT_HT_BIT)
  335. #define LCDC_VAT_VT_BIT 0
  336. #define LCDC_VAT_VT_MASK (0xfff << LCDC_VAT_VT_BIT)
  337. /* Display Area Horizontal Start/End Point Register */
  338. #define LCDC_DAH_HDS_BIT 16
  339. #define LCDC_DAH_HDS_MASK (0xfff << LCDC_DAH_HDS_BIT)
  340. #define LCDC_DAH_HDE_BIT 0
  341. #define LCDC_DAH_HDE_MASK (0xfff << LCDC_DAH_HDE_BIT)
  342. /* Display Area Vertical Start/End Point Register */
  343. #define LCDC_DAV_VDS_BIT 16
  344. #define LCDC_DAV_VDS_MASK (0xfff << LCDC_DAV_VDS_BIT)
  345. #define LCDC_DAV_VDE_BIT 0
  346. #define LCDC_DAV_VDE_MASK (0xfff << LCDC_DAV_VDE_BIT)
  347. /* Foreground 0 or Foreground 1 XY Position Register */
  348. #define LCDC_XYP_YPOS_BIT 16
  349. #define LCDC_XYP_YPOS_MASK (0xfff << LCDC_XYP_YPOS_BIT)
  350. #define LCDC_XYP_XPOS_BIT 0
  351. #define LCDC_XYP_XPOS_MASK (0xfff << LCDC_XYP_XPOS_BIT)
  352. /* Foreground 0 or Foreground 1 Size Register */
  353. #define LCDC_SIZE_HEIGHT_BIT 16
  354. #define LCDC_SIZE_HEIGHT_MASK (0xfff << LCDC_SIZE_HEIGHT_BIT)
  355. #define LCDC_SIZE_WIDTH_BIT 0
  356. #define LCDC_SIZE_WIDTH_MASK (0xfff << LCDC_SIZE_WIDTH_BIT)
  357. /* PS Signal Setting */
  358. #define LCDC_PS_PSS_BIT 16
  359. #define LCDC_PS_PSS_MASK (0xfff << LCDC_PS_PSS_BIT)
  360. #define LCDC_PS_PSE_BIT 0
  361. #define LCDC_PS_PSE_MASK (0xfff << LCDC_PS_PSE_BIT)
  362. /* CLS Signal Setting */
  363. #define LCDC_CLS_CLSS_BIT 16
  364. #define LCDC_CLS_CLSS_MASK (0xfff << LCDC_CLS_CLSS_BIT)
  365. #define LCDC_CLS_CLSE_BIT 0
  366. #define LCDC_CLS_CLSE_MASK (0xfff << LCDC_CLS_CLSE_BIT)
  367. /* SPL Signal Setting */
  368. #define LCDC_SPL_SPLS_BIT 16
  369. #define LCDC_SPL_SPLS_MASK (0xfff << LCDC_SPL_SPLS_BIT)
  370. #define LCDC_SPL_SPLE_BIT 0
  371. #define LCDC_SPL_SPLE_MASK (0xfff << LCDC_SPL_SPLE_BIT)
  372. /* REV Signal Setting */
  373. #define LCDC_REV_REVS_BIT 16
  374. #define LCDC_REV_REVS_MASK (0xfff << LCDC_REV_REVS_BIT)
  375. /* DMA Command 0 or 1 Register */
  376. #define LCDC_CMD_SOFINT (1 << 31)
  377. #define LCDC_CMD_EOFINT (1 << 30)
  378. #define LCDC_CMD_CMD (1 << 29)
  379. #define LCDC_CMD_PAL (1 << 28)
  380. #define LCDC_CMD_COMPEN (1 << 27)
  381. #define LCDC_CMD_FRM_EN (1 << 26)
  382. #define LCDC_CMD_FIELD_SEL (1 << 25)
  383. #define LCDC_CMD_16X16BLOCK (1 << 24)
  384. #define LCDC_CMD_LEN_BIT 0
  385. #define LCDC_CMD_LEN_MASK (0xffffff << LCDC_CMD_LEN_BIT)
  386. /* DMA Offsize Register 0,1 */
  387. #define LCDC_OFFS_BIT 0
  388. #define LCDC_OFFS_OFFSIZE_MASK (0xffffff << LCDC_OFFS_BIT)
  389. /* DMA Page Width Register 0,1 */
  390. #define LCDC_PW_BIT 0
  391. #define LCDC_PW_PAGEWIDTH_MASK (0xffffff << LCDC_PW_BIT)
  392. /* DMA Command Counter Register 0,1 */
  393. #define LCDC_CNUM_BIT 0
  394. #define LCDC_CNUM_CNUM_MASK (0xff << LCDC_CNUM_BIT)
  395. #define LCDC_CPOS_ALPHAMD1 (1 << 31)
  396. #define LCDC_CPOS_RGB_RGB565 (0 << 30)
  397. #define LCDC_CPOS_RGB_RGB555 (1 << 30)
  398. #define LCDC_CPOS_BPP_BIT 27
  399. #define LCDC_CPOS_BPP_MASK (0x07 << LCDC_CPOS_BPP_BIT)
  400. #define LCDC_CPOS_BPP_16 (4 << LCDC_CPOS_BPP_BIT)
  401. #define LCDC_CPOS_BPP_18_24 (5 << LCDC_CPOS_BPP_BIT)
  402. #define LCDC_CPOS_BPP_CMPS_24 (6 << LCDC_CPOS_BPP_BIT)
  403. #define LCDC_CPOS_BPP_30 (7 << LCDC_CPOS_BPP_BIT)
  404. #define LCDC_CPOS_PREMULTI (1 << 26)
  405. #define LCDC_CPOS_COEF_SLE_BIT 24
  406. #define LCDC_CPOS_COEF_SLE_MASK (0x3 << LCDC_CPOS_COEF_SLE_BIT)
  407. #define LCDC_CPOS_COEF_SLE_0 (0 << LCDC_CPOS_COEF_SLE_BIT)
  408. #define LCDC_CPOS_COEF_SLE_1 (1 << LCDC_CPOS_COEF_SLE_BIT)
  409. #define LCDC_CPOS_COEF_SLE_2 (2 << LCDC_CPOS_COEF_SLE_BIT)
  410. #define LCDC_CPOS_COEF_SLE_3 (3 << LCDC_CPOS_COEF_SLE_BIT)
  411. #define LCDC_CPOS_YPOS_BIT 12
  412. #define LCDC_CPOS_YPOS_MASK (0xfff << LCDC_CPOS_YPOS_BIT)
  413. #define LCDC_CPOS_XPOS_BIT 0
  414. #define LCDC_CPOS_XPOS_MASK (0xfff << LCDC_CPOS_XPOS_BIT)
  415. /* Foreground 0,1 Size Register */
  416. #define LCDC_DESSIZE_ALPHA_BIT 24
  417. #define LCDC_DESSIZE_ALPHA_MASK (0xff << LCDC_DESSIZE_ALPHA_BIT)
  418. #define LCDC_DESSIZE_HEIGHT_BIT 12
  419. #define LCDC_DESSIZE_HEIGHT_MASK (0xfff << LCDC_DESSIZE_HEIGHT_BIT)
  420. #define LCDC_DESSIZE_WIDTH_BIT 0
  421. #define LCDC_DESSIZE_WIDTH_MASK (0xfff << LCDC_DESSIZE_WIDTH_BIT)
  422. /* Priority level threshold configure Register */
  423. #define LCDC_PCFG_LCDC_PRI_MD (1 << 31)
  424. #define LCDC_PCFG_HP_BST_BIT 28
  425. #define LCDC_PCFG_HP_BST_MASK (0x7 << LCDC_PCFG_HP_BST_BIT)
  426. #define LCDC_PCFG_HP_BST_4 (0 << LCDC_PCFG_HP_BST_BIT)
  427. #define LCDC_PCFG_HP_BST_8 (1 << LCDC_PCFG_HP_BST_BIT)
  428. #define LCDC_PCFG_HP_BST_16 (2 << LCDC_PCFG_HP_BST_BIT)
  429. #define LCDC_PCFG_HP_BST_32 (3 << LCDC_PCFG_HP_BST_BIT)
  430. #define LCDC_PCFG_HP_BST_C16 (5 << LCDC_PCFG_HP_BST_BIT)
  431. #define LCDC_PCFG_HP_BST_64 (4 << LCDC_PCFG_HP_BST_BIT)
  432. #define LCDC_PCFG_HP_BST_DIS (7 << LCDC_PCFG_HP_BST_BIT)
  433. #define LCDC_PCFG_PCFG2_BIT 18
  434. #define LCDC_PCFG_PCFG2_MASK (0x1ff << LCDC_PCFG_PCFG2_BIT)
  435. #define LCDC_PCFG_PCFG1_BIT 9
  436. #define LCDC_PCFG_PCFG1_MASK (0x1ff << LCDC_PCFG_PCFG1_BIT)
  437. #define LCDC_PCFG_PCFG0_BIT 0
  438. #define LCDC_PCFG_PCFG0_MASK (0x1ff << LCDC_PCFG_PCFG0_BIT)
  439. /* Dual LCDC Channel Control register */
  440. #define LCDC_DUAL_CTRL_IPU_WR_SEL (1 << 8)
  441. #define LCDC_DUAL_CTRL_TFT_SEL (1 << 6)
  442. #define LCDC_DUAL_CTRL_PRI_IPU_EN (1 << 5)
  443. #define LCDC_DUAL_CTRL_PRI_IPU_BIT 3
  444. #define LCDC_DUAL_CTRL_PRI_IPU_MASK (0x3 << LCDC_DUAL_CTRL_PRI_IPU_BIT)
  445. #ifdef __cplusplus
  446. }
  447. #endif
  448. #endif /* _X1000_SLCDC_H_ */