reg_bits.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. #ifndef __REG_BITS_2700G_
  2. #define __REG_BITS_2700G_
  3. /* use defines from asm-arm/arch-pxa/bitfields.h for bit fields access */
  4. #define UData(Data) ((unsigned long) (Data))
  5. #define Fld(Size, Shft) (((Size) << 16) + (Shft))
  6. #define FSize(Field) ((Field) >> 16)
  7. #define FShft(Field) ((Field) & 0x0000FFFF)
  8. #define FMsk(Field) (((UData (1) << FSize (Field)) - 1) << FShft (Field))
  9. #define FAlnMsk(Field) ((UData (1) << FSize (Field)) - 1)
  10. #define F1stBit(Field) (UData (1) << FShft (Field))
  11. #define SYSRST_RST (1 << 0)
  12. /* SYSCLKSRC - SYSCLK Source Control Register */
  13. #define SYSCLKSRC_SEL Fld(2,0)
  14. #define SYSCLKSRC_REF ((0x0) << FShft(SYSCLKSRC_SEL))
  15. #define SYSCLKSRC_PLL_1 ((0x1) << FShft(SYSCLKSRC_SEL))
  16. #define SYSCLKSRC_PLL_2 ((0x2) << FShft(SYSCLKSRC_SEL))
  17. /* PIXCLKSRC - PIXCLK Source Control Register */
  18. #define PIXCLKSRC_SEL Fld(2,0)
  19. #define PIXCLKSRC_REF ((0x0) << FShft(PIXCLKSRC_SEL))
  20. #define PIXCLKSRC_PLL_1 ((0x1) << FShft(PIXCLKSRC_SEL))
  21. #define PIXCLKSRC_PLL_2 ((0x2) << FShft(PIXCLKSRC_SEL))
  22. /* Clock Disable Register */
  23. #define CLKSLEEP_SLP (1 << 0)
  24. /* Core PLL Control Register */
  25. #define CORE_PLL_M Fld(6,7)
  26. #define Core_Pll_M(x) ((x) << FShft(CORE_PLL_M))
  27. #define CORE_PLL_N Fld(3,4)
  28. #define Core_Pll_N(x) ((x) << FShft(CORE_PLL_N))
  29. #define CORE_PLL_P Fld(3,1)
  30. #define Core_Pll_P(x) ((x) << FShft(CORE_PLL_P))
  31. #define CORE_PLL_EN (1 << 0)
  32. /* Display PLL Control Register */
  33. #define DISP_PLL_M Fld(6,7)
  34. #define Disp_Pll_M(x) ((x) << FShft(DISP_PLL_M))
  35. #define DISP_PLL_N Fld(3,4)
  36. #define Disp_Pll_N(x) ((x) << FShft(DISP_PLL_N))
  37. #define DISP_PLL_P Fld(3,1)
  38. #define Disp_Pll_P(x) ((x) << FShft(DISP_PLL_P))
  39. #define DISP_PLL_EN (1 << 0)
  40. /* PLL status register */
  41. #define PLLSTAT_CORE_PLL_LOST_L (1 << 3)
  42. #define PLLSTAT_CORE_PLL_LSTS (1 << 2)
  43. #define PLLSTAT_DISP_PLL_LOST_L (1 << 1)
  44. #define PLLSTAT_DISP_PLL_LSTS (1 << 0)
  45. /* Video and scale clock control register */
  46. #define VOVRCLK_EN (1 << 0)
  47. /* Pixel clock control register */
  48. #define PIXCLK_EN (1 << 0)
  49. /* Memory clock control register */
  50. #define MEMCLK_EN (1 << 0)
  51. /* MBX clock control register */
  52. #define MBXCLK_DIV Fld(2,2)
  53. #define MBXCLK_DIV_1 ((0x0) << FShft(MBXCLK_DIV))
  54. #define MBXCLK_DIV_2 ((0x1) << FShft(MBXCLK_DIV))
  55. #define MBXCLK_DIV_3 ((0x2) << FShft(MBXCLK_DIV))
  56. #define MBXCLK_DIV_4 ((0x3) << FShft(MBXCLK_DIV))
  57. #define MBXCLK_EN Fld(2,0)
  58. #define MBXCLK_EN_NONE ((0x0) << FShft(MBXCLK_EN))
  59. #define MBXCLK_EN_2D ((0x1) << FShft(MBXCLK_EN))
  60. #define MBXCLK_EN_BOTH ((0x2) << FShft(MBXCLK_EN))
  61. /* M24 clock control register */
  62. #define M24CLK_DIV Fld(2,1)
  63. #define M24CLK_DIV_1 ((0x0) << FShft(M24CLK_DIV))
  64. #define M24CLK_DIV_2 ((0x1) << FShft(M24CLK_DIV))
  65. #define M24CLK_DIV_3 ((0x2) << FShft(M24CLK_DIV))
  66. #define M24CLK_DIV_4 ((0x3) << FShft(M24CLK_DIV))
  67. #define M24CLK_EN (1 << 0)
  68. /* SDRAM clock control register */
  69. #define SDCLK_EN (1 << 0)
  70. /* PixClk Divisor Register */
  71. #define PIXCLKDIV_PD Fld(9,0)
  72. #define Pixclkdiv_Pd(x) ((x) << FShft(PIXCLKDIV_PD))
  73. /* LCD Config control register */
  74. #define LCDCFG_IN_FMT Fld(3,28)
  75. #define Lcdcfg_In_Fmt(x) ((x) << FShft(LCDCFG_IN_FMT))
  76. #define LCDCFG_LCD1DEN_POL (1 << 27)
  77. #define LCDCFG_LCD1FCLK_POL (1 << 26)
  78. #define LCDCFG_LCD1LCLK_POL (1 << 25)
  79. #define LCDCFG_LCD1D_POL (1 << 24)
  80. #define LCDCFG_LCD2DEN_POL (1 << 23)
  81. #define LCDCFG_LCD2FCLK_POL (1 << 22)
  82. #define LCDCFG_LCD2LCLK_POL (1 << 21)
  83. #define LCDCFG_LCD2D_POL (1 << 20)
  84. #define LCDCFG_LCD1_TS (1 << 19)
  85. #define LCDCFG_LCD1D_DS (1 << 18)
  86. #define LCDCFG_LCD1C_DS (1 << 17)
  87. #define LCDCFG_LCD1_IS_IN (1 << 16)
  88. #define LCDCFG_LCD2_TS (1 << 3)
  89. #define LCDCFG_LCD2D_DS (1 << 2)
  90. #define LCDCFG_LCD2C_DS (1 << 1)
  91. #define LCDCFG_LCD2_IS_IN (1 << 0)
  92. /* On-Die Frame Buffer Power Control Register */
  93. #define ODFBPWR_SLOW (1 << 2)
  94. #define ODFBPWR_MODE Fld(2,0)
  95. #define ODFBPWR_MODE_ACT ((0x0) << FShft(ODFBPWR_MODE))
  96. #define ODFBPWR_MODE_ACT_LP ((0x1) << FShft(ODFBPWR_MODE))
  97. #define ODFBPWR_MODE_SLEEP ((0x2) << FShft(ODFBPWR_MODE))
  98. #define ODFBPWR_MODE_SHUTD ((0x3) << FShft(ODFBPWR_MODE))
  99. /* On-Die Frame Buffer Power State Status Register */
  100. #define ODFBSTAT_ACT (1 << 2)
  101. #define ODFBSTAT_SLP (1 << 1)
  102. #define ODFBSTAT_SDN (1 << 0)
  103. /* LMRST - Local Memory (SDRAM) Reset */
  104. #define LMRST_MC_RST (1 << 0)
  105. /* LMCFG - Local Memory (SDRAM) Configuration Register */
  106. #define LMCFG_LMC_DS (1 << 5)
  107. #define LMCFG_LMD_DS (1 << 4)
  108. #define LMCFG_LMA_DS (1 << 3)
  109. #define LMCFG_LMC_TS (1 << 2)
  110. #define LMCFG_LMD_TS (1 << 1)
  111. #define LMCFG_LMA_TS (1 << 0)
  112. /* LMPWR - Local Memory (SDRAM) Power Control Register */
  113. #define LMPWR_MC_PWR_CNT Fld(2,0)
  114. #define LMPWR_MC_PWR_ACT ((0x0) << FShft(LMPWR_MC_PWR_CNT)) /* Active */
  115. #define LMPWR_MC_PWR_SRM ((0x1) << FShft(LMPWR_MC_PWR_CNT)) /* Self-refresh */
  116. #define LMPWR_MC_PWR_DPD ((0x3) << FShft(LMPWR_MC_PWR_CNT)) /* deep power down */
  117. /* LMPWRSTAT - Local Memory (SDRAM) Power Status Register */
  118. #define LMPWRSTAT_MC_PWR_CNT Fld(2,0)
  119. #define LMPWRSTAT_MC_PWR_ACT ((0x0) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* Active */
  120. #define LMPWRSTAT_MC_PWR_SRM ((0x1) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* Self-refresh */
  121. #define LMPWRSTAT_MC_PWR_DPD ((0x3) << FShft(LMPWRSTAT_MC_PWR_CNT)) /* deep power down */
  122. /* LMTYPE - Local Memory (SDRAM) Type Register */
  123. #define LMTYPE_CASLAT Fld(3,10)
  124. #define LMTYPE_CASLAT_1 ((0x1) << FShft(LMTYPE_CASLAT))
  125. #define LMTYPE_CASLAT_2 ((0x2) << FShft(LMTYPE_CASLAT))
  126. #define LMTYPE_CASLAT_3 ((0x3) << FShft(LMTYPE_CASLAT))
  127. #define LMTYPE_BKSZ Fld(2,8)
  128. #define LMTYPE_BKSZ_1 ((0x1) << FShft(LMTYPE_BKSZ))
  129. #define LMTYPE_BKSZ_2 ((0x2) << FShft(LMTYPE_BKSZ))
  130. #define LMTYPE_ROWSZ Fld(4,4)
  131. #define LMTYPE_ROWSZ_11 ((0xb) << FShft(LMTYPE_ROWSZ))
  132. #define LMTYPE_ROWSZ_12 ((0xc) << FShft(LMTYPE_ROWSZ))
  133. #define LMTYPE_ROWSZ_13 ((0xd) << FShft(LMTYPE_ROWSZ))
  134. #define LMTYPE_COLSZ Fld(4,0)
  135. #define LMTYPE_COLSZ_7 ((0x7) << FShft(LMTYPE_COLSZ))
  136. #define LMTYPE_COLSZ_8 ((0x8) << FShft(LMTYPE_COLSZ))
  137. #define LMTYPE_COLSZ_9 ((0x9) << FShft(LMTYPE_COLSZ))
  138. #define LMTYPE_COLSZ_10 ((0xa) << FShft(LMTYPE_COLSZ))
  139. #define LMTYPE_COLSZ_11 ((0xb) << FShft(LMTYPE_COLSZ))
  140. #define LMTYPE_COLSZ_12 ((0xc) << FShft(LMTYPE_COLSZ))
  141. /* LMTIM - Local Memory (SDRAM) Timing Register */
  142. #define LMTIM_TRAS Fld(4,16)
  143. #define Lmtim_Tras(x) ((x) << FShft(LMTIM_TRAS))
  144. #define LMTIM_TRP Fld(4,12)
  145. #define Lmtim_Trp(x) ((x) << FShft(LMTIM_TRP))
  146. #define LMTIM_TRCD Fld(4,8)
  147. #define Lmtim_Trcd(x) ((x) << FShft(LMTIM_TRCD))
  148. #define LMTIM_TRC Fld(4,4)
  149. #define Lmtim_Trc(x) ((x) << FShft(LMTIM_TRC))
  150. #define LMTIM_TDPL Fld(4,0)
  151. #define Lmtim_Tdpl(x) ((x) << FShft(LMTIM_TDPL))
  152. /* LMREFRESH - Local Memory (SDRAM) tREF Control Register */
  153. #define LMREFRESH_TREF Fld(2,0)
  154. #define Lmrefresh_Tref(x) ((x) << FShft(LMREFRESH_TREF))
  155. /* GSCTRL - Graphics surface control register */
  156. #define GSCTRL_LUT_EN (1 << 31)
  157. #define GSCTRL_GPIXFMT Fld(4,27)
  158. #define GSCTRL_GPIXFMT_INDEXED ((0x0) << FShft(GSCTRL_GPIXFMT))
  159. #define GSCTRL_GPIXFMT_ARGB4444 ((0x4) << FShft(GSCTRL_GPIXFMT))
  160. #define GSCTRL_GPIXFMT_ARGB1555 ((0x5) << FShft(GSCTRL_GPIXFMT))
  161. #define GSCTRL_GPIXFMT_RGB888 ((0x6) << FShft(GSCTRL_GPIXFMT))
  162. #define GSCTRL_GPIXFMT_RGB565 ((0x7) << FShft(GSCTRL_GPIXFMT))
  163. #define GSCTRL_GPIXFMT_ARGB8888 ((0x8) << FShft(GSCTRL_GPIXFMT))
  164. #define GSCTRL_GAMMA_EN (1 << 26)
  165. #define GSCTRL_GSWIDTH Fld(11,11)
  166. #define Gsctrl_Width(Pixel) /* Display Width [1..2048 pix.] */ \
  167. (((Pixel) - 1) << FShft(GSCTRL_GSWIDTH))
  168. #define GSCTRL_GSHEIGHT Fld(11,0)
  169. #define Gsctrl_Height(Pixel) /* Display Height [1..2048 pix.] */ \
  170. (((Pixel) - 1) << FShft(GSCTRL_GSHEIGHT))
  171. /* GBBASE fileds */
  172. #define GBBASE_GLALPHA Fld(8,24)
  173. #define Gbbase_Glalpha(x) ((x) << FShft(GBBASE_GLALPHA))
  174. #define GBBASE_COLKEY Fld(24,0)
  175. #define Gbbase_Colkey(x) ((x) << FShft(GBBASE_COLKEY))
  176. /* GDRCTRL fields */
  177. #define GDRCTRL_PIXDBL (1 << 31)
  178. #define GDRCTRL_PIXHLV (1 << 30)
  179. #define GDRCTRL_LNDBL (1 << 29)
  180. #define GDRCTRL_LNHLV (1 << 28)
  181. #define GDRCTRL_COLKEYM Fld(24,0)
  182. #define Gdrctrl_Colkeym(x) ((x) << FShft(GDRCTRL_COLKEYM))
  183. /* GSCADR graphics stream control address register fields */
  184. #define GSCADR_STR_EN (1 << 31)
  185. #define GSCADR_COLKEY_EN (1 << 30)
  186. #define GSCADR_COLKEYSRC (1 << 29)
  187. #define GSCADR_BLEND_M Fld(2,27)
  188. #define GSCADR_BLEND_NONE ((0x0) << FShft(GSCADR_BLEND_M))
  189. #define GSCADR_BLEND_INV ((0x1) << FShft(GSCADR_BLEND_M))
  190. #define GSCADR_BLEND_GLOB ((0x2) << FShft(GSCADR_BLEND_M))
  191. #define GSCADR_BLEND_PIX ((0x3) << FShft(GSCADR_BLEND_M))
  192. #define GSCADR_BLEND_POS Fld(2,24)
  193. #define GSCADR_BLEND_GFX ((0x0) << FShft(GSCADR_BLEND_POS))
  194. #define GSCADR_BLEND_VID ((0x1) << FShft(GSCADR_BLEND_POS))
  195. #define GSCADR_BLEND_CUR ((0x2) << FShft(GSCADR_BLEND_POS))
  196. #define GSCADR_GBASE_ADR Fld(23,0)
  197. #define Gscadr_Gbase_Adr(x) ((x) << FShft(GSCADR_GBASE_ADR))
  198. /* GSADR graphics stride address register fields */
  199. #define GSADR_SRCSTRIDE Fld(10,22)
  200. #define Gsadr_Srcstride(x) ((x) << FShft(GSADR_SRCSTRIDE))
  201. #define GSADR_XSTART Fld(11,11)
  202. #define Gsadr_Xstart(x) ((x) << FShft(GSADR_XSTART))
  203. #define GSADR_YSTART Fld(11,0)
  204. #define Gsadr_Ystart(y) ((y) << FShft(GSADR_YSTART))
  205. /* GPLUT graphics palette register fields */
  206. #define GPLUT_LUTADR Fld(8,24)
  207. #define Gplut_Lutadr(x) ((x) << FShft(GPLUT_LUTADR))
  208. #define GPLUT_LUTDATA Fld(24,0)
  209. #define Gplut_Lutdata(x) ((x) << FShft(GPLUT_LUTDATA))
  210. /* VSCTRL - Video Surface Control Register */
  211. #define VSCTRL_VPIXFMT Fld(4,27)
  212. #define VSCTRL_VPIXFMT_YUV12 ((0x9) << FShft(VSCTRL_VPIXFMT))
  213. #define VSCTRL_VPIXFMT_UY0VY1 ((0xc) << FShft(VSCTRL_VPIXFMT))
  214. #define VSCTRL_VPIXFMT_VY0UY1 ((0xd) << FShft(VSCTRL_VPIXFMT))
  215. #define VSCTRL_VPIXFMT_Y0UY1V ((0xe) << FShft(VSCTRL_VPIXFMT))
  216. #define VSCTRL_VPIXFMT_Y0VY1U ((0xf) << FShft(VSCTRL_VPIXFMT))
  217. #define VSCTRL_GAMMA_EN (1 << 26)
  218. #define VSCTRL_CSC_EN (1 << 25)
  219. #define VSCTRL_COSITED (1 << 22)
  220. #define VSCTRL_VSWIDTH Fld(11,11)
  221. #define Vsctrl_Width(Pixels) /* Video Width [1-2048] */ \
  222. (((Pixels) - 1) << FShft(VSCTRL_VSWIDTH))
  223. #define VSCTRL_VSHEIGHT Fld(11,0)
  224. #define Vsctrl_Height(Pixels) /* Video Height [1-2048] */ \
  225. (((Pixels) - 1) << FShft(VSCTRL_VSHEIGHT))
  226. /* VBBASE - Video Blending Base Register */
  227. #define VBBASE_GLALPHA Fld(8,24)
  228. #define Vbbase_Glalpha(x) ((x) << FShft(VBBASE_GLALPHA))
  229. #define VBBASE_COLKEY Fld(24,0)
  230. #define Vbbase_Colkey(x) ((x) << FShft(VBBASE_COLKEY))
  231. /* VCMSK - Video Color Key Mask Register */
  232. #define VCMSK_COLKEY_M Fld(24,0)
  233. #define Vcmsk_colkey_m(x) ((x) << FShft(VCMSK_COLKEY_M))
  234. /* VSCADR - Video Stream Control Rddress Register */
  235. #define VSCADR_STR_EN (1 << 31)
  236. #define VSCADR_COLKEY_EN (1 << 30)
  237. #define VSCADR_COLKEYSRC (1 << 29)
  238. #define VSCADR_BLEND_M Fld(2,27)
  239. #define VSCADR_BLEND_NONE ((0x0) << FShft(VSCADR_BLEND_M))
  240. #define VSCADR_BLEND_INV ((0x1) << FShft(VSCADR_BLEND_M))
  241. #define VSCADR_BLEND_GLOB ((0x2) << FShft(VSCADR_BLEND_M))
  242. #define VSCADR_BLEND_PIX ((0x3) << FShft(VSCADR_BLEND_M))
  243. #define VSCADR_BLEND_POS Fld(2,24)
  244. #define VSCADR_BLEND_GFX ((0x0) << FShft(VSCADR_BLEND_POS))
  245. #define VSCADR_BLEND_VID ((0x1) << FShft(VSCADR_BLEND_POS))
  246. #define VSCADR_BLEND_CUR ((0x2) << FShft(VSCADR_BLEND_POS))
  247. #define VSCADR_VBASE_ADR Fld(23,0)
  248. #define Vscadr_Vbase_Adr(x) ((x) << FShft(VSCADR_VBASE_ADR))
  249. /* VUBASE - Video U Base Register */
  250. #define VUBASE_UVHALFSTR (1 << 31)
  251. #define VUBASE_UBASE_ADR Fld(24,0)
  252. #define Vubase_Ubase_Adr(x) ((x) << FShft(VUBASE_UBASE_ADR))
  253. /* VVBASE - Video V Base Register */
  254. #define VVBASE_VBASE_ADR Fld(24,0)
  255. #define Vvbase_Vbase_Adr(x) ((x) << FShft(VVBASE_VBASE_ADR))
  256. /* VSADR - Video Stride Address Register */
  257. #define VSADR_SRCSTRIDE Fld(10,22)
  258. #define Vsadr_Srcstride(x) ((x) << FShft(VSADR_SRCSTRIDE))
  259. #define VSADR_XSTART Fld(11,11)
  260. #define Vsadr_Xstart(x) ((x) << FShft(VSADR_XSTART))
  261. #define VSADR_YSTART Fld(11,0)
  262. #define Vsadr_Ystart(x) ((x) << FShft(VSADR_YSTART))
  263. /* VSCTRL - Video Surface Control Register */
  264. #define VSCTRL_VPIXFMT Fld(4,27)
  265. #define VSCTRL_VPIXFMT_YUV12 ((0x9) << FShft(VSCTRL_VPIXFMT))
  266. #define VSCTRL_VPIXFMT_UY0VY1 ((0xc) << FShft(VSCTRL_VPIXFMT))
  267. #define VSCTRL_VPIXFMT_VY0UY1 ((0xd) << FShft(VSCTRL_VPIXFMT))
  268. #define VSCTRL_VPIXFMT_Y0UY1V ((0xe) << FShft(VSCTRL_VPIXFMT))
  269. #define VSCTRL_VPIXFMT_Y0VY1U ((0xf) << FShft(VSCTRL_VPIXFMT))
  270. #define VSCTRL_GAMMA_EN (1 << 26)
  271. #define VSCTRL_CSC_EN (1 << 25)
  272. #define VSCTRL_COSITED (1 << 22)
  273. #define VSCTRL_VSWIDTH Fld(11,11)
  274. #define Vsctrl_Width(Pixels) /* Video Width [1-2048] */ \
  275. (((Pixels) - 1) << FShft(VSCTRL_VSWIDTH))
  276. #define VSCTRL_VSHEIGHT Fld(11,0)
  277. #define Vsctrl_Height(Pixels) /* Video Height [1-2048] */ \
  278. (((Pixels) - 1) << FShft(VSCTRL_VSHEIGHT))
  279. /* VBBASE - Video Blending Base Register */
  280. #define VBBASE_GLALPHA Fld(8,24)
  281. #define Vbbase_Glalpha(x) ((x) << FShft(VBBASE_GLALPHA))
  282. #define VBBASE_COLKEY Fld(24,0)
  283. #define Vbbase_Colkey(x) ((x) << FShft(VBBASE_COLKEY))
  284. /* VCMSK - Video Color Key Mask Register */
  285. #define VCMSK_COLKEY_M Fld(24,0)
  286. #define Vcmsk_colkey_m(x) ((x) << FShft(VCMSK_COLKEY_M))
  287. /* VSCADR - Video Stream Control Rddress Register */
  288. #define VSCADR_STR_EN (1 << 31)
  289. #define VSCADR_COLKEY_EN (1 << 30)
  290. #define VSCADR_COLKEYSRC (1 << 29)
  291. #define VSCADR_BLEND_M Fld(2,27)
  292. #define VSCADR_BLEND_NONE ((0x0) << FShft(VSCADR_BLEND_M))
  293. #define VSCADR_BLEND_INV ((0x1) << FShft(VSCADR_BLEND_M))
  294. #define VSCADR_BLEND_GLOB ((0x2) << FShft(VSCADR_BLEND_M))
  295. #define VSCADR_BLEND_PIX ((0x3) << FShft(VSCADR_BLEND_M))
  296. #define VSCADR_BLEND_POS Fld(2,24)
  297. #define VSCADR_BLEND_GFX ((0x0) << FShft(VSCADR_BLEND_POS))
  298. #define VSCADR_BLEND_VID ((0x1) << FShft(VSCADR_BLEND_POS))
  299. #define VSCADR_BLEND_CUR ((0x2) << FShft(VSCADR_BLEND_POS))
  300. #define VSCADR_VBASE_ADR Fld(23,0)
  301. #define Vscadr_Vbase_Adr(x) ((x) << FShft(VSCADR_VBASE_ADR))
  302. /* VUBASE - Video U Base Register */
  303. #define VUBASE_UVHALFSTR (1 << 31)
  304. #define VUBASE_UBASE_ADR Fld(24,0)
  305. #define Vubase_Ubase_Adr(x) ((x) << FShft(VUBASE_UBASE_ADR))
  306. /* VVBASE - Video V Base Register */
  307. #define VVBASE_VBASE_ADR Fld(24,0)
  308. #define Vvbase_Vbase_Adr(x) ((x) << FShft(VVBASE_VBASE_ADR))
  309. /* VSADR - Video Stride Address Register */
  310. #define VSADR_SRCSTRIDE Fld(10,22)
  311. #define Vsadr_Srcstride(x) ((x) << FShft(VSADR_SRCSTRIDE))
  312. #define VSADR_XSTART Fld(11,11)
  313. #define Vsadr_Xstart(x) ((x) << FShft(VSADR_XSTART))
  314. #define VSADR_YSTART Fld(11,0)
  315. #define Vsadr_Ystart(x) ((x) << FShft(VSADR_YSTART))
  316. /* HCCTRL - Hardware Cursor Register fields */
  317. #define HCCTRL_CUR_EN (1 << 31)
  318. #define HCCTRL_COLKEY_EN (1 << 29)
  319. #define HCCTRL_COLKEYSRC (1 << 28)
  320. #define HCCTRL_BLEND_M Fld(2,26)
  321. #define HCCTRL_BLEND_NONE ((0x0) << FShft(HCCTRL_BLEND_M))
  322. #define HCCTRL_BLEND_INV ((0x1) << FShft(HCCTRL_BLEND_M))
  323. #define HCCTRL_BLEND_GLOB ((0x2) << FShft(HCCTRL_BLEND_M))
  324. #define HCCTRL_BLEND_PIX ((0x3) << FShft(HCCTRL_BLEND_M))
  325. #define HCCTRL_CPIXFMT Fld(3,23)
  326. #define HCCTRL_CPIXFMT_RGB332 ((0x3) << FShft(HCCTRL_CPIXFMT))
  327. #define HCCTRL_CPIXFMT_ARGB4444 ((0x4) << FShft(HCCTRL_CPIXFMT))
  328. #define HCCTRL_CPIXFMT_ARGB1555 ((0x5) << FShft(HCCTRL_CPIXFMT))
  329. #define HCCTRL_CBASE_ADR Fld(23,0)
  330. #define Hcctrl_Cbase_Adr(x) ((x) << FShft(HCCTRL_CBASE_ADR))
  331. /* HCSIZE Hardware Cursor Size Register fields */
  332. #define HCSIZE_BLEND_POS Fld(2,29)
  333. #define HCSIZE_BLEND_GFX ((0x0) << FShft(HCSIZE_BLEND_POS))
  334. #define HCSIZE_BLEND_VID ((0x1) << FShft(HCSIZE_BLEND_POS))
  335. #define HCSIZE_BLEND_CUR ((0x2) << FShft(HCSIZE_BLEND_POS))
  336. #define HCSIZE_CWIDTH Fld(3,16)
  337. #define Hcsize_Cwidth(x) ((x) << FShft(HCSIZE_CWIDTH))
  338. #define HCSIZE_CHEIGHT Fld(3,0)
  339. #define Hcsize_Cheight(x) ((x) << FShft(HCSIZE_CHEIGHT))
  340. /* HCPOS Hardware Cursor Position Register fields */
  341. #define HCPOS_SWITCHSRC (1 << 30)
  342. #define HCPOS_CURBLINK Fld(6,24)
  343. #define Hcpos_Curblink(x) ((x) << FShft(HCPOS_CURBLINK))
  344. #define HCPOS_XSTART Fld(12,12)
  345. #define Hcpos_Xstart(x) ((x) << FShft(HCPOS_XSTART))
  346. #define HCPOS_YSTART Fld(12,0)
  347. #define Hcpos_Ystart(y) ((y) << FShft(HCPOS_YSTART))
  348. /* HCBADR Hardware Cursor Blend Address Register */
  349. #define HCBADR_GLALPHA Fld(8,24)
  350. #define Hcbadr_Glalpha(x) ((x) << FShft(HCBADR_GLALPHA))
  351. #define HCBADR_COLKEY Fld(24,0)
  352. #define Hcbadr_Colkey(x) ((x) << FShft(HCBADR_COLKEY))
  353. /* HCCKMSK - Hardware Cursor Color Key Mask Register */
  354. #define HCCKMSK_COLKEY_M Fld(24,0)
  355. #define Hcckmsk_Colkey_M(x) ((x) << FShft(HCCKMSK_COLKEY_M))
  356. /* DSCTRL - Display sync control register */
  357. #define DSCTRL_SYNCGEN_EN (1 << 31)
  358. #define DSCTRL_DPL_RST (1 << 29)
  359. #define DSCTRL_PWRDN_M (1 << 28)
  360. #define DSCTRL_UPDSYNCCNT (1 << 26)
  361. #define DSCTRL_UPDINTCNT (1 << 25)
  362. #define DSCTRL_UPDCNT (1 << 24)
  363. #define DSCTRL_UPDWAIT Fld(4,16)
  364. #define Dsctrl_Updwait(x) ((x) << FShft(DSCTRL_UPDWAIT))
  365. #define DSCTRL_CLKPOL (1 << 11)
  366. #define DSCTRL_CSYNC_EN (1 << 10)
  367. #define DSCTRL_VS_SLAVE (1 << 7)
  368. #define DSCTRL_HS_SLAVE (1 << 6)
  369. #define DSCTRL_BLNK_POL (1 << 5)
  370. #define DSCTRL_BLNK_DIS (1 << 4)
  371. #define DSCTRL_VS_POL (1 << 3)
  372. #define DSCTRL_VS_DIS (1 << 2)
  373. #define DSCTRL_HS_POL (1 << 1)
  374. #define DSCTRL_HS_DIS (1 << 0)
  375. /* DHT01 - Display horizontal timing register 01 */
  376. #define DHT01_HBPS Fld(12,16)
  377. #define Dht01_Hbps(x) ((x) << FShft(DHT01_HBPS))
  378. #define DHT01_HT Fld(12,0)
  379. #define Dht01_Ht(x) ((x) << FShft(DHT01_HT))
  380. /* DHT02 - Display horizontal timing register 02 */
  381. #define DHT02_HAS Fld(12,16)
  382. #define Dht02_Has(x) ((x) << FShft(DHT02_HAS))
  383. #define DHT02_HLBS Fld(12,0)
  384. #define Dht02_Hlbs(x) ((x) << FShft(DHT02_HLBS))
  385. /* DHT03 - Display horizontal timing register 03 */
  386. #define DHT03_HFPS Fld(12,16)
  387. #define Dht03_Hfps(x) ((x) << FShft(DHT03_HFPS))
  388. #define DHT03_HRBS Fld(12,0)
  389. #define Dht03_Hrbs(x) ((x) << FShft(DHT03_HRBS))
  390. /* DVT01 - Display vertical timing register 01 */
  391. #define DVT01_VBPS Fld(12,16)
  392. #define Dvt01_Vbps(x) ((x) << FShft(DVT01_VBPS))
  393. #define DVT01_VT Fld(12,0)
  394. #define Dvt01_Vt(x) ((x) << FShft(DVT01_VT))
  395. /* DVT02 - Display vertical timing register 02 */
  396. #define DVT02_VAS Fld(12,16)
  397. #define Dvt02_Vas(x) ((x) << FShft(DVT02_VAS))
  398. #define DVT02_VTBS Fld(12,0)
  399. #define Dvt02_Vtbs(x) ((x) << FShft(DVT02_VTBS))
  400. /* DVT03 - Display vertical timing register 03 */
  401. #define DVT03_VFPS Fld(12,16)
  402. #define Dvt03_Vfps(x) ((x) << FShft(DVT03_VFPS))
  403. #define DVT03_VBBS Fld(12,0)
  404. #define Dvt03_Vbbs(x) ((x) << FShft(DVT03_VBBS))
  405. /* DVECTRL - display vertical event control register */
  406. #define DVECTRL_VEVENT Fld(12,16)
  407. #define Dvectrl_Vevent(x) ((x) << FShft(DVECTRL_VEVENT))
  408. #define DVECTRL_VFETCH Fld(12,0)
  409. #define Dvectrl_Vfetch(x) ((x) << FShft(DVECTRL_VFETCH))
  410. /* DHDET - display horizontal DE timing register */
  411. #define DHDET_HDES Fld(12,16)
  412. #define Dhdet_Hdes(x) ((x) << FShft(DHDET_HDES))
  413. #define DHDET_HDEF Fld(12,0)
  414. #define Dhdet_Hdef(x) ((x) << FShft(DHDET_HDEF))
  415. /* DVDET - display vertical DE timing register */
  416. #define DVDET_VDES Fld(12,16)
  417. #define Dvdet_Vdes(x) ((x) << FShft(DVDET_VDES))
  418. #define DVDET_VDEF Fld(12,0)
  419. #define Dvdet_Vdef(x) ((x) << FShft(DVDET_VDEF))
  420. /* DODMSK - display output data mask register */
  421. #define DODMSK_MASK_LVL (1 << 31)
  422. #define DODMSK_BLNK_LVL (1 << 30)
  423. #define DODMSK_MASK_B Fld(8,16)
  424. #define Dodmsk_Mask_B(x) ((x) << FShft(DODMSK_MASK_B))
  425. #define DODMSK_MASK_G Fld(8,8)
  426. #define Dodmsk_Mask_G(x) ((x) << FShft(DODMSK_MASK_G))
  427. #define DODMSK_MASK_R Fld(8,0)
  428. #define Dodmsk_Mask_R(x) ((x) << FShft(DODMSK_MASK_R))
  429. /* DBCOL - display border color control register */
  430. #define DBCOL_BORDCOL Fld(24,0)
  431. #define Dbcol_Bordcol(x) ((x) << FShft(DBCOL_BORDCOL))
  432. /* DVLNUM - display vertical line number register */
  433. #define DVLNUM_VLINE Fld(12,0)
  434. #define Dvlnum_Vline(x) ((x) << FShft(DVLNUM_VLINE))
  435. /* DMCTRL - Display Memory Control Register */
  436. #define DMCTRL_MEM_REF Fld(2,30)
  437. #define DMCTRL_MEM_REF_ACT ((0x0) << FShft(DMCTRL_MEM_REF))
  438. #define DMCTRL_MEM_REF_HB ((0x1) << FShft(DMCTRL_MEM_REF))
  439. #define DMCTRL_MEM_REF_VB ((0x2) << FShft(DMCTRL_MEM_REF))
  440. #define DMCTRL_MEM_REF_BOTH ((0x3) << FShft(DMCTRL_MEM_REF))
  441. #define DMCTRL_UV_THRHLD Fld(6,24)
  442. #define Dmctrl_Uv_Thrhld(x) ((x) << FShft(DMCTRL_UV_THRHLD))
  443. #define DMCTRL_V_THRHLD Fld(7,16)
  444. #define Dmctrl_V_Thrhld(x) ((x) << FShft(DMCTRL_V_THRHLD))
  445. #define DMCTRL_D_THRHLD Fld(7,8)
  446. #define Dmctrl_D_Thrhld(x) ((x) << FShft(DMCTRL_D_THRHLD))
  447. #define DMCTRL_BURSTLEN Fld(6,0)
  448. #define Dmctrl_Burstlen(x) ((x) << FShft(DMCTRL_BURSTLEN))
  449. /* DINTRS - Display Interrupt Status Register */
  450. #define DINTRS_CUR_OR_S (1 << 18)
  451. #define DINTRS_STR2_OR_S (1 << 17)
  452. #define DINTRS_STR1_OR_S (1 << 16)
  453. #define DINTRS_CUR_UR_S (1 << 6)
  454. #define DINTRS_STR2_UR_S (1 << 5)
  455. #define DINTRS_STR1_UR_S (1 << 4)
  456. #define DINTRS_VEVENT1_S (1 << 3)
  457. #define DINTRS_VEVENT0_S (1 << 2)
  458. #define DINTRS_HBLNK1_S (1 << 1)
  459. #define DINTRS_HBLNK0_S (1 << 0)
  460. /* DINTRE - Display Interrupt Enable Register */
  461. #define DINTRE_CUR_OR_EN (1 << 18)
  462. #define DINTRE_STR2_OR_EN (1 << 17)
  463. #define DINTRE_STR1_OR_EN (1 << 16)
  464. #define DINTRE_CUR_UR_EN (1 << 6)
  465. #define DINTRE_STR2_UR_EN (1 << 5)
  466. #define DINTRE_STR1_UR_EN (1 << 4)
  467. #define DINTRE_VEVENT1_EN (1 << 3)
  468. #define DINTRE_VEVENT0_EN (1 << 2)
  469. #define DINTRE_HBLNK1_EN (1 << 1)
  470. #define DINTRE_HBLNK0_EN (1 << 0)
  471. /* DINTRS - Display Interrupt Status Register */
  472. #define DINTRS_CUR_OR_S (1 << 18)
  473. #define DINTRS_STR2_OR_S (1 << 17)
  474. #define DINTRS_STR1_OR_S (1 << 16)
  475. #define DINTRS_CUR_UR_S (1 << 6)
  476. #define DINTRS_STR2_UR_S (1 << 5)
  477. #define DINTRS_STR1_UR_S (1 << 4)
  478. #define DINTRS_VEVENT1_S (1 << 3)
  479. #define DINTRS_VEVENT0_S (1 << 2)
  480. #define DINTRS_HBLNK1_S (1 << 1)
  481. #define DINTRS_HBLNK0_S (1 << 0)
  482. /* DINTRE - Display Interrupt Enable Register */
  483. #define DINTRE_CUR_OR_EN (1 << 18)
  484. #define DINTRE_STR2_OR_EN (1 << 17)
  485. #define DINTRE_STR1_OR_EN (1 << 16)
  486. #define DINTRE_CUR_UR_EN (1 << 6)
  487. #define DINTRE_STR2_UR_EN (1 << 5)
  488. #define DINTRE_STR1_UR_EN (1 << 4)
  489. #define DINTRE_VEVENT1_EN (1 << 3)
  490. #define DINTRE_VEVENT0_EN (1 << 2)
  491. #define DINTRE_HBLNK1_EN (1 << 1)
  492. #define DINTRE_HBLNK0_EN (1 << 0)
  493. /* DLSTS - display load status register */
  494. #define DLSTS_RLD_ADONE (1 << 23)
  495. /* #define DLSTS_RLD_ADOUT Fld(23,0) */
  496. /* DLLCTRL - display list load control register */
  497. #define DLLCTRL_RLD_ADRLN Fld(8,24)
  498. #define Dllctrl_Rld_Adrln(x) ((x) << FShft(DLLCTRL_RLD_ADRLN))
  499. /* CLIPCTRL - Clipping Control Register */
  500. #define CLIPCTRL_HSKIP Fld(11,16)
  501. #define Clipctrl_Hskip ((x) << FShft(CLIPCTRL_HSKIP))
  502. #define CLIPCTRL_VSKIP Fld(11,0)
  503. #define Clipctrl_Vskip ((x) << FShft(CLIPCTRL_VSKIP))
  504. /* SPOCTRL - Scale Pitch/Order Control Register */
  505. #define SPOCTRL_H_SC_BP (1 << 31)
  506. #define SPOCTRL_V_SC_BP (1 << 30)
  507. #define SPOCTRL_HV_SC_OR (1 << 29)
  508. #define SPOCTRL_VS_UR_C (1 << 27)
  509. #define SPOCTRL_VORDER Fld(2,16)
  510. #define SPOCTRL_VORDER_1TAP ((0x0) << FShft(SPOCTRL_VORDER))
  511. #define SPOCTRL_VORDER_2TAP ((0x1) << FShft(SPOCTRL_VORDER))
  512. #define SPOCTRL_VORDER_4TAP ((0x3) << FShft(SPOCTRL_VORDER))
  513. #define SPOCTRL_VPITCH Fld(16,0)
  514. #define Spoctrl_Vpitch(x) ((x) << FShft(SPOCTRL_VPITCH))
  515. /* SVCTRL - Scale Vertical Control Register */
  516. #define SVCTRL_INITIAL1 Fld(16,16)
  517. #define Svctrl_Initial1(x) ((x) << FShft(SVCTRL_INITIAL1))
  518. #define SVCTRL_INITIAL2 Fld(16,0)
  519. #define Svctrl_Initial2(x) ((x) << FShft(SVCTRL_INITIAL2))
  520. /* SHCTRL - Scale Horizontal Control Register */
  521. #define SHCTRL_HINITIAL Fld(16,16)
  522. #define Shctrl_Hinitial(x) ((x) << FShft(SHCTRL_HINITIAL))
  523. #define SHCTRL_HDECIM (1 << 15)
  524. #define SHCTRL_HPITCH Fld(15,0)
  525. #define Shctrl_Hpitch(x) ((x) << FShft(SHCTRL_HPITCH))
  526. /* SSSIZE - Scale Surface Size Register */
  527. #define SSSIZE_SC_WIDTH Fld(11,16)
  528. #define Sssize_Sc_Width(x) ((x) << FShft(SSSIZE_SC_WIDTH))
  529. #define SSSIZE_SC_HEIGHT Fld(11,0)
  530. #define Sssize_Sc_Height(x) ((x) << FShft(SSSIZE_SC_HEIGHT))
  531. #endif /* __REG_BITS_2700G_ */