vsp1_regs.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * vsp1_regs.h -- R-Car VSP1 Registers Definitions
  4. *
  5. * Copyright (C) 2013 Renesas Electronics Corporation
  6. *
  7. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  8. */
  9. #ifndef __VSP1_REGS_H__
  10. #define __VSP1_REGS_H__
  11. /* -----------------------------------------------------------------------------
  12. * General Control Registers
  13. */
  14. #define VI6_CMD(n) (0x0000 + (n) * 4)
  15. #define VI6_CMD_UPDHDR (1 << 4)
  16. #define VI6_CMD_STRCMD (1 << 0)
  17. #define VI6_CLK_DCSWT 0x0018
  18. #define VI6_CLK_DCSWT_CSTPW_MASK (0xff << 8)
  19. #define VI6_CLK_DCSWT_CSTPW_SHIFT 8
  20. #define VI6_CLK_DCSWT_CSTRW_MASK (0xff << 0)
  21. #define VI6_CLK_DCSWT_CSTRW_SHIFT 0
  22. #define VI6_SRESET 0x0028
  23. #define VI6_SRESET_SRTS(n) (1 << (n))
  24. #define VI6_STATUS 0x0038
  25. #define VI6_STATUS_FLD_STD(n) (1 << ((n) + 28))
  26. #define VI6_STATUS_SYS_ACT(n) (1 << ((n) + 8))
  27. #define VI6_WPF_IRQ_ENB(n) (0x0048 + (n) * 12)
  28. #define VI6_WFP_IRQ_ENB_DFEE (1 << 1)
  29. #define VI6_WFP_IRQ_ENB_FREE (1 << 0)
  30. #define VI6_WPF_IRQ_STA(n) (0x004c + (n) * 12)
  31. #define VI6_WFP_IRQ_STA_DFE (1 << 1)
  32. #define VI6_WFP_IRQ_STA_FRE (1 << 0)
  33. #define VI6_DISP_IRQ_ENB 0x0078
  34. #define VI6_DISP_IRQ_ENB_DSTE (1 << 8)
  35. #define VI6_DISP_IRQ_ENB_MAEE (1 << 5)
  36. #define VI6_DISP_IRQ_ENB_LNEE(n) (1 << (n))
  37. #define VI6_DISP_IRQ_STA 0x007c
  38. #define VI6_DISP_IRQ_STA_DST (1 << 8)
  39. #define VI6_DISP_IRQ_STA_MAE (1 << 5)
  40. #define VI6_DISP_IRQ_STA_LNE(n) (1 << (n))
  41. #define VI6_WPF_LINE_COUNT(n) (0x0084 + (n) * 4)
  42. #define VI6_WPF_LINE_COUNT_MASK (0x1fffff << 0)
  43. /* -----------------------------------------------------------------------------
  44. * Display List Control Registers
  45. */
  46. #define VI6_DL_CTRL 0x0100
  47. #define VI6_DL_CTRL_AR_WAIT_MASK (0xffff << 16)
  48. #define VI6_DL_CTRL_AR_WAIT_SHIFT 16
  49. #define VI6_DL_CTRL_DC2 (1 << 12)
  50. #define VI6_DL_CTRL_DC1 (1 << 8)
  51. #define VI6_DL_CTRL_DC0 (1 << 4)
  52. #define VI6_DL_CTRL_CFM0 (1 << 2)
  53. #define VI6_DL_CTRL_NH0 (1 << 1)
  54. #define VI6_DL_CTRL_DLE (1 << 0)
  55. #define VI6_DL_HDR_ADDR(n) (0x0104 + (n) * 4)
  56. #define VI6_DL_SWAP 0x0114
  57. #define VI6_DL_SWAP_LWS (1 << 2)
  58. #define VI6_DL_SWAP_WDS (1 << 1)
  59. #define VI6_DL_SWAP_BTS (1 << 0)
  60. #define VI6_DL_EXT_CTRL(n) (0x011c + (n) * 36)
  61. #define VI6_DL_EXT_CTRL_NWE (1 << 16)
  62. #define VI6_DL_EXT_CTRL_POLINT_MASK (0x3f << 8)
  63. #define VI6_DL_EXT_CTRL_POLINT_SHIFT 8
  64. #define VI6_DL_EXT_CTRL_DLPRI (1 << 5)
  65. #define VI6_DL_EXT_CTRL_EXPRI (1 << 4)
  66. #define VI6_DL_EXT_CTRL_EXT (1 << 0)
  67. #define VI6_DL_EXT_AUTOFLD_INT BIT(0)
  68. #define VI6_DL_BODY_SIZE 0x0120
  69. #define VI6_DL_BODY_SIZE_UPD (1 << 24)
  70. #define VI6_DL_BODY_SIZE_BS_MASK (0x1ffff << 0)
  71. #define VI6_DL_BODY_SIZE_BS_SHIFT 0
  72. /* -----------------------------------------------------------------------------
  73. * RPF Control Registers
  74. */
  75. #define VI6_RPF_OFFSET 0x100
  76. #define VI6_RPF_SRC_BSIZE 0x0300
  77. #define VI6_RPF_SRC_BSIZE_BHSIZE_MASK (0x1fff << 16)
  78. #define VI6_RPF_SRC_BSIZE_BHSIZE_SHIFT 16
  79. #define VI6_RPF_SRC_BSIZE_BVSIZE_MASK (0x1fff << 0)
  80. #define VI6_RPF_SRC_BSIZE_BVSIZE_SHIFT 0
  81. #define VI6_RPF_SRC_ESIZE 0x0304
  82. #define VI6_RPF_SRC_ESIZE_EHSIZE_MASK (0x1fff << 16)
  83. #define VI6_RPF_SRC_ESIZE_EHSIZE_SHIFT 16
  84. #define VI6_RPF_SRC_ESIZE_EVSIZE_MASK (0x1fff << 0)
  85. #define VI6_RPF_SRC_ESIZE_EVSIZE_SHIFT 0
  86. #define VI6_RPF_INFMT 0x0308
  87. #define VI6_RPF_INFMT_VIR (1 << 28)
  88. #define VI6_RPF_INFMT_CIPM (1 << 16)
  89. #define VI6_RPF_INFMT_SPYCS (1 << 15)
  90. #define VI6_RPF_INFMT_SPUVS (1 << 14)
  91. #define VI6_RPF_INFMT_CEXT_ZERO (0 << 12)
  92. #define VI6_RPF_INFMT_CEXT_EXT (1 << 12)
  93. #define VI6_RPF_INFMT_CEXT_ONE (2 << 12)
  94. #define VI6_RPF_INFMT_CEXT_MASK (3 << 12)
  95. #define VI6_RPF_INFMT_RDTM_BT601 (0 << 9)
  96. #define VI6_RPF_INFMT_RDTM_BT601_EXT (1 << 9)
  97. #define VI6_RPF_INFMT_RDTM_BT709 (2 << 9)
  98. #define VI6_RPF_INFMT_RDTM_BT709_EXT (3 << 9)
  99. #define VI6_RPF_INFMT_RDTM_MASK (7 << 9)
  100. #define VI6_RPF_INFMT_CSC (1 << 8)
  101. #define VI6_RPF_INFMT_RDFMT_MASK (0x7f << 0)
  102. #define VI6_RPF_INFMT_RDFMT_SHIFT 0
  103. #define VI6_RPF_DSWAP 0x030c
  104. #define VI6_RPF_DSWAP_A_LLS (1 << 11)
  105. #define VI6_RPF_DSWAP_A_LWS (1 << 10)
  106. #define VI6_RPF_DSWAP_A_WDS (1 << 9)
  107. #define VI6_RPF_DSWAP_A_BTS (1 << 8)
  108. #define VI6_RPF_DSWAP_P_LLS (1 << 3)
  109. #define VI6_RPF_DSWAP_P_LWS (1 << 2)
  110. #define VI6_RPF_DSWAP_P_WDS (1 << 1)
  111. #define VI6_RPF_DSWAP_P_BTS (1 << 0)
  112. #define VI6_RPF_LOC 0x0310
  113. #define VI6_RPF_LOC_HCOORD_MASK (0x1fff << 16)
  114. #define VI6_RPF_LOC_HCOORD_SHIFT 16
  115. #define VI6_RPF_LOC_VCOORD_MASK (0x1fff << 0)
  116. #define VI6_RPF_LOC_VCOORD_SHIFT 0
  117. #define VI6_RPF_ALPH_SEL 0x0314
  118. #define VI6_RPF_ALPH_SEL_ASEL_PACKED (0 << 28)
  119. #define VI6_RPF_ALPH_SEL_ASEL_8B_PLANE (1 << 28)
  120. #define VI6_RPF_ALPH_SEL_ASEL_SELECT (2 << 28)
  121. #define VI6_RPF_ALPH_SEL_ASEL_1B_PLANE (3 << 28)
  122. #define VI6_RPF_ALPH_SEL_ASEL_FIXED (4 << 28)
  123. #define VI6_RPF_ALPH_SEL_ASEL_MASK (7 << 28)
  124. #define VI6_RPF_ALPH_SEL_ASEL_SHIFT 28
  125. #define VI6_RPF_ALPH_SEL_IROP_MASK (0xf << 24)
  126. #define VI6_RPF_ALPH_SEL_IROP_SHIFT 24
  127. #define VI6_RPF_ALPH_SEL_BSEL (1 << 23)
  128. #define VI6_RPF_ALPH_SEL_AEXT_ZERO (0 << 18)
  129. #define VI6_RPF_ALPH_SEL_AEXT_EXT (1 << 18)
  130. #define VI6_RPF_ALPH_SEL_AEXT_ONE (2 << 18)
  131. #define VI6_RPF_ALPH_SEL_AEXT_MASK (3 << 18)
  132. #define VI6_RPF_ALPH_SEL_ALPHA1_MASK (0xff << 8)
  133. #define VI6_RPF_ALPH_SEL_ALPHA1_SHIFT 8
  134. #define VI6_RPF_ALPH_SEL_ALPHA0_MASK (0xff << 0)
  135. #define VI6_RPF_ALPH_SEL_ALPHA0_SHIFT 0
  136. #define VI6_RPF_VRTCOL_SET 0x0318
  137. #define VI6_RPF_VRTCOL_SET_LAYA_MASK (0xff << 24)
  138. #define VI6_RPF_VRTCOL_SET_LAYA_SHIFT 24
  139. #define VI6_RPF_VRTCOL_SET_LAYR_MASK (0xff << 16)
  140. #define VI6_RPF_VRTCOL_SET_LAYR_SHIFT 16
  141. #define VI6_RPF_VRTCOL_SET_LAYG_MASK (0xff << 8)
  142. #define VI6_RPF_VRTCOL_SET_LAYG_SHIFT 8
  143. #define VI6_RPF_VRTCOL_SET_LAYB_MASK (0xff << 0)
  144. #define VI6_RPF_VRTCOL_SET_LAYB_SHIFT 0
  145. #define VI6_RPF_MSK_CTRL 0x031c
  146. #define VI6_RPF_MSK_CTRL_MSK_EN (1 << 24)
  147. #define VI6_RPF_MSK_CTRL_MGR_MASK (0xff << 16)
  148. #define VI6_RPF_MSK_CTRL_MGR_SHIFT 16
  149. #define VI6_RPF_MSK_CTRL_MGG_MASK (0xff << 8)
  150. #define VI6_RPF_MSK_CTRL_MGG_SHIFT 8
  151. #define VI6_RPF_MSK_CTRL_MGB_MASK (0xff << 0)
  152. #define VI6_RPF_MSK_CTRL_MGB_SHIFT 0
  153. #define VI6_RPF_MSK_SET0 0x0320
  154. #define VI6_RPF_MSK_SET1 0x0324
  155. #define VI6_RPF_MSK_SET_MSA_MASK (0xff << 24)
  156. #define VI6_RPF_MSK_SET_MSA_SHIFT 24
  157. #define VI6_RPF_MSK_SET_MSR_MASK (0xff << 16)
  158. #define VI6_RPF_MSK_SET_MSR_SHIFT 16
  159. #define VI6_RPF_MSK_SET_MSG_MASK (0xff << 8)
  160. #define VI6_RPF_MSK_SET_MSG_SHIFT 8
  161. #define VI6_RPF_MSK_SET_MSB_MASK (0xff << 0)
  162. #define VI6_RPF_MSK_SET_MSB_SHIFT 0
  163. #define VI6_RPF_CKEY_CTRL 0x0328
  164. #define VI6_RPF_CKEY_CTRL_CV (1 << 4)
  165. #define VI6_RPF_CKEY_CTRL_SAPE1 (1 << 1)
  166. #define VI6_RPF_CKEY_CTRL_SAPE0 (1 << 0)
  167. #define VI6_RPF_CKEY_SET0 0x032c
  168. #define VI6_RPF_CKEY_SET1 0x0330
  169. #define VI6_RPF_CKEY_SET_AP_MASK (0xff << 24)
  170. #define VI6_RPF_CKEY_SET_AP_SHIFT 24
  171. #define VI6_RPF_CKEY_SET_R_MASK (0xff << 16)
  172. #define VI6_RPF_CKEY_SET_R_SHIFT 16
  173. #define VI6_RPF_CKEY_SET_GY_MASK (0xff << 8)
  174. #define VI6_RPF_CKEY_SET_GY_SHIFT 8
  175. #define VI6_RPF_CKEY_SET_B_MASK (0xff << 0)
  176. #define VI6_RPF_CKEY_SET_B_SHIFT 0
  177. #define VI6_RPF_SRCM_PSTRIDE 0x0334
  178. #define VI6_RPF_SRCM_PSTRIDE_Y_SHIFT 16
  179. #define VI6_RPF_SRCM_PSTRIDE_C_SHIFT 0
  180. #define VI6_RPF_SRCM_ASTRIDE 0x0338
  181. #define VI6_RPF_SRCM_PSTRIDE_A_SHIFT 0
  182. #define VI6_RPF_SRCM_ADDR_Y 0x033c
  183. #define VI6_RPF_SRCM_ADDR_C0 0x0340
  184. #define VI6_RPF_SRCM_ADDR_C1 0x0344
  185. #define VI6_RPF_SRCM_ADDR_AI 0x0348
  186. #define VI6_RPF_MULT_ALPHA 0x036c
  187. #define VI6_RPF_MULT_ALPHA_A_MMD_NONE (0 << 12)
  188. #define VI6_RPF_MULT_ALPHA_A_MMD_RATIO (1 << 12)
  189. #define VI6_RPF_MULT_ALPHA_P_MMD_NONE (0 << 8)
  190. #define VI6_RPF_MULT_ALPHA_P_MMD_RATIO (1 << 8)
  191. #define VI6_RPF_MULT_ALPHA_P_MMD_IMAGE (2 << 8)
  192. #define VI6_RPF_MULT_ALPHA_P_MMD_BOTH (3 << 8)
  193. #define VI6_RPF_MULT_ALPHA_RATIO_MASK (0xff << 0)
  194. #define VI6_RPF_MULT_ALPHA_RATIO_SHIFT 0
  195. /* -----------------------------------------------------------------------------
  196. * WPF Control Registers
  197. */
  198. #define VI6_WPF_OFFSET 0x100
  199. #define VI6_WPF_SRCRPF 0x1000
  200. #define VI6_WPF_SRCRPF_VIRACT_DIS (0 << 28)
  201. #define VI6_WPF_SRCRPF_VIRACT_SUB (1 << 28)
  202. #define VI6_WPF_SRCRPF_VIRACT_MST (2 << 28)
  203. #define VI6_WPF_SRCRPF_VIRACT_MASK (3 << 28)
  204. #define VI6_WPF_SRCRPF_VIRACT2_DIS (0 << 24)
  205. #define VI6_WPF_SRCRPF_VIRACT2_SUB (1 << 24)
  206. #define VI6_WPF_SRCRPF_VIRACT2_MST (2 << 24)
  207. #define VI6_WPF_SRCRPF_VIRACT2_MASK (3 << 24)
  208. #define VI6_WPF_SRCRPF_RPF_ACT_DIS(n) (0 << ((n) * 2))
  209. #define VI6_WPF_SRCRPF_RPF_ACT_SUB(n) (1 << ((n) * 2))
  210. #define VI6_WPF_SRCRPF_RPF_ACT_MST(n) (2 << ((n) * 2))
  211. #define VI6_WPF_SRCRPF_RPF_ACT_MASK(n) (3 << ((n) * 2))
  212. #define VI6_WPF_HSZCLIP 0x1004
  213. #define VI6_WPF_VSZCLIP 0x1008
  214. #define VI6_WPF_SZCLIP_EN (1 << 28)
  215. #define VI6_WPF_SZCLIP_OFST_MASK (0xff << 16)
  216. #define VI6_WPF_SZCLIP_OFST_SHIFT 16
  217. #define VI6_WPF_SZCLIP_SIZE_MASK (0xfff << 0)
  218. #define VI6_WPF_SZCLIP_SIZE_SHIFT 0
  219. #define VI6_WPF_OUTFMT 0x100c
  220. #define VI6_WPF_OUTFMT_PDV_MASK (0xff << 24)
  221. #define VI6_WPF_OUTFMT_PDV_SHIFT 24
  222. #define VI6_WPF_OUTFMT_PXA (1 << 23)
  223. #define VI6_WPF_OUTFMT_ROT (1 << 18)
  224. #define VI6_WPF_OUTFMT_HFLP (1 << 17)
  225. #define VI6_WPF_OUTFMT_FLP (1 << 16)
  226. #define VI6_WPF_OUTFMT_SPYCS (1 << 15)
  227. #define VI6_WPF_OUTFMT_SPUVS (1 << 14)
  228. #define VI6_WPF_OUTFMT_DITH_DIS (0 << 12)
  229. #define VI6_WPF_OUTFMT_DITH_EN (3 << 12)
  230. #define VI6_WPF_OUTFMT_DITH_MASK (3 << 12)
  231. #define VI6_WPF_OUTFMT_WRTM_BT601 (0 << 9)
  232. #define VI6_WPF_OUTFMT_WRTM_BT601_EXT (1 << 9)
  233. #define VI6_WPF_OUTFMT_WRTM_BT709 (2 << 9)
  234. #define VI6_WPF_OUTFMT_WRTM_BT709_EXT (3 << 9)
  235. #define VI6_WPF_OUTFMT_WRTM_MASK (7 << 9)
  236. #define VI6_WPF_OUTFMT_CSC (1 << 8)
  237. #define VI6_WPF_OUTFMT_WRFMT_MASK (0x7f << 0)
  238. #define VI6_WPF_OUTFMT_WRFMT_SHIFT 0
  239. #define VI6_WPF_DSWAP 0x1010
  240. #define VI6_WPF_DSWAP_P_LLS (1 << 3)
  241. #define VI6_WPF_DSWAP_P_LWS (1 << 2)
  242. #define VI6_WPF_DSWAP_P_WDS (1 << 1)
  243. #define VI6_WPF_DSWAP_P_BTS (1 << 0)
  244. #define VI6_WPF_RNDCTRL 0x1014
  245. #define VI6_WPF_RNDCTRL_CBRM (1 << 28)
  246. #define VI6_WPF_RNDCTRL_ABRM_TRUNC (0 << 24)
  247. #define VI6_WPF_RNDCTRL_ABRM_ROUND (1 << 24)
  248. #define VI6_WPF_RNDCTRL_ABRM_THRESH (2 << 24)
  249. #define VI6_WPF_RNDCTRL_ABRM_MASK (3 << 24)
  250. #define VI6_WPF_RNDCTRL_ATHRESH_MASK (0xff << 16)
  251. #define VI6_WPF_RNDCTRL_ATHRESH_SHIFT 16
  252. #define VI6_WPF_RNDCTRL_CLMD_FULL (0 << 12)
  253. #define VI6_WPF_RNDCTRL_CLMD_CLIP (1 << 12)
  254. #define VI6_WPF_RNDCTRL_CLMD_EXT (2 << 12)
  255. #define VI6_WPF_RNDCTRL_CLMD_MASK (3 << 12)
  256. #define VI6_WPF_ROT_CTRL 0x1018
  257. #define VI6_WPF_ROT_CTRL_LN16 (1 << 17)
  258. #define VI6_WPF_ROT_CTRL_LMEM_WD_MASK (0x1fff << 0)
  259. #define VI6_WPF_ROT_CTRL_LMEM_WD_SHIFT 0
  260. #define VI6_WPF_DSTM_STRIDE_Y 0x101c
  261. #define VI6_WPF_DSTM_STRIDE_C 0x1020
  262. #define VI6_WPF_DSTM_ADDR_Y 0x1024
  263. #define VI6_WPF_DSTM_ADDR_C0 0x1028
  264. #define VI6_WPF_DSTM_ADDR_C1 0x102c
  265. #define VI6_WPF_WRBCK_CTRL 0x1034
  266. #define VI6_WPF_WRBCK_CTRL_WBMD (1 << 0)
  267. /* -----------------------------------------------------------------------------
  268. * UIF Control Registers
  269. */
  270. #define VI6_UIF_OFFSET 0x100
  271. #define VI6_UIF_DISCOM_DOCMCR 0x1c00
  272. #define VI6_UIF_DISCOM_DOCMCR_CMPRU (1 << 16)
  273. #define VI6_UIF_DISCOM_DOCMCR_CMPR (1 << 0)
  274. #define VI6_UIF_DISCOM_DOCMSTR 0x1c04
  275. #define VI6_UIF_DISCOM_DOCMSTR_CMPPRE (1 << 1)
  276. #define VI6_UIF_DISCOM_DOCMSTR_CMPST (1 << 0)
  277. #define VI6_UIF_DISCOM_DOCMCLSTR 0x1c08
  278. #define VI6_UIF_DISCOM_DOCMCLSTR_CMPCLPRE (1 << 1)
  279. #define VI6_UIF_DISCOM_DOCMCLSTR_CMPCLST (1 << 0)
  280. #define VI6_UIF_DISCOM_DOCMIENR 0x1c0c
  281. #define VI6_UIF_DISCOM_DOCMIENR_CMPPREIEN (1 << 1)
  282. #define VI6_UIF_DISCOM_DOCMIENR_CMPIEN (1 << 0)
  283. #define VI6_UIF_DISCOM_DOCMMDR 0x1c10
  284. #define VI6_UIF_DISCOM_DOCMMDR_INTHRH(n) ((n) << 16)
  285. #define VI6_UIF_DISCOM_DOCMPMR 0x1c14
  286. #define VI6_UIF_DISCOM_DOCMPMR_CMPDFF(n) ((n) << 17)
  287. #define VI6_UIF_DISCOM_DOCMPMR_CMPDFA(n) ((n) << 8)
  288. #define VI6_UIF_DISCOM_DOCMPMR_CMPDAUF (1 << 7)
  289. #define VI6_UIF_DISCOM_DOCMPMR_SEL(n) ((n) << 0)
  290. #define VI6_UIF_DISCOM_DOCMECRCR 0x1c18
  291. #define VI6_UIF_DISCOM_DOCMCCRCR 0x1c1c
  292. #define VI6_UIF_DISCOM_DOCMSPXR 0x1c20
  293. #define VI6_UIF_DISCOM_DOCMSPYR 0x1c24
  294. #define VI6_UIF_DISCOM_DOCMSZXR 0x1c28
  295. #define VI6_UIF_DISCOM_DOCMSZYR 0x1c2c
  296. /* -----------------------------------------------------------------------------
  297. * DPR Control Registers
  298. */
  299. #define VI6_DPR_RPF_ROUTE(n) (0x2000 + (n) * 4)
  300. #define VI6_DPR_WPF_FPORCH(n) (0x2014 + (n) * 4)
  301. #define VI6_DPR_WPF_FPORCH_FP_WPFN (5 << 8)
  302. #define VI6_DPR_SRU_ROUTE 0x2024
  303. #define VI6_DPR_UDS_ROUTE(n) (0x2028 + (n) * 4)
  304. #define VI6_DPR_LUT_ROUTE 0x203c
  305. #define VI6_DPR_CLU_ROUTE 0x2040
  306. #define VI6_DPR_HST_ROUTE 0x2044
  307. #define VI6_DPR_HSI_ROUTE 0x2048
  308. #define VI6_DPR_BRU_ROUTE 0x204c
  309. #define VI6_DPR_ILV_BRS_ROUTE 0x2050
  310. #define VI6_DPR_ROUTE_BRSSEL (1 << 28)
  311. #define VI6_DPR_ROUTE_FXA_MASK (0xff << 16)
  312. #define VI6_DPR_ROUTE_FXA_SHIFT 16
  313. #define VI6_DPR_ROUTE_FP_MASK (0x3f << 8)
  314. #define VI6_DPR_ROUTE_FP_SHIFT 8
  315. #define VI6_DPR_ROUTE_RT_MASK (0x3f << 0)
  316. #define VI6_DPR_ROUTE_RT_SHIFT 0
  317. #define VI6_DPR_HGO_SMPPT 0x2054
  318. #define VI6_DPR_HGT_SMPPT 0x2058
  319. #define VI6_DPR_SMPPT_TGW_MASK (7 << 8)
  320. #define VI6_DPR_SMPPT_TGW_SHIFT 8
  321. #define VI6_DPR_SMPPT_PT_MASK (0x3f << 0)
  322. #define VI6_DPR_SMPPT_PT_SHIFT 0
  323. #define VI6_DPR_UIF_ROUTE(n) (0x2074 + (n) * 4)
  324. #define VI6_DPR_NODE_RPF(n) (n)
  325. #define VI6_DPR_NODE_UIF(n) (12 + (n))
  326. #define VI6_DPR_NODE_SRU 16
  327. #define VI6_DPR_NODE_UDS(n) (17 + (n))
  328. #define VI6_DPR_NODE_LUT 22
  329. #define VI6_DPR_NODE_BRU_IN(n) (((n) <= 3) ? 23 + (n) : 49)
  330. #define VI6_DPR_NODE_BRU_OUT 27
  331. #define VI6_DPR_NODE_CLU 29
  332. #define VI6_DPR_NODE_HST 30
  333. #define VI6_DPR_NODE_HSI 31
  334. #define VI6_DPR_NODE_BRS_IN(n) (38 + (n))
  335. #define VI6_DPR_NODE_LIF 55 /* Gen2 only */
  336. #define VI6_DPR_NODE_WPF(n) (56 + (n))
  337. #define VI6_DPR_NODE_UNUSED 63
  338. /* -----------------------------------------------------------------------------
  339. * SRU Control Registers
  340. */
  341. #define VI6_SRU_CTRL0 0x2200
  342. #define VI6_SRU_CTRL0_PARAM0_MASK (0x1ff << 16)
  343. #define VI6_SRU_CTRL0_PARAM0_SHIFT 16
  344. #define VI6_SRU_CTRL0_PARAM1_MASK (0x1f << 8)
  345. #define VI6_SRU_CTRL0_PARAM1_SHIFT 8
  346. #define VI6_SRU_CTRL0_MODE_UPSCALE (4 << 4)
  347. #define VI6_SRU_CTRL0_PARAM2 (1 << 3)
  348. #define VI6_SRU_CTRL0_PARAM3 (1 << 2)
  349. #define VI6_SRU_CTRL0_PARAM4 (1 << 1)
  350. #define VI6_SRU_CTRL0_EN (1 << 0)
  351. #define VI6_SRU_CTRL1 0x2204
  352. #define VI6_SRU_CTRL1_PARAM5 0x7ff
  353. #define VI6_SRU_CTRL2 0x2208
  354. #define VI6_SRU_CTRL2_PARAM6_SHIFT 16
  355. #define VI6_SRU_CTRL2_PARAM7_SHIFT 8
  356. #define VI6_SRU_CTRL2_PARAM8_SHIFT 0
  357. /* -----------------------------------------------------------------------------
  358. * UDS Control Registers
  359. */
  360. #define VI6_UDS_OFFSET 0x100
  361. #define VI6_UDS_CTRL 0x2300
  362. #define VI6_UDS_CTRL_AMD (1 << 30)
  363. #define VI6_UDS_CTRL_FMD (1 << 29)
  364. #define VI6_UDS_CTRL_BLADV (1 << 28)
  365. #define VI6_UDS_CTRL_AON (1 << 25)
  366. #define VI6_UDS_CTRL_ATHON (1 << 24)
  367. #define VI6_UDS_CTRL_BC (1 << 20)
  368. #define VI6_UDS_CTRL_NE_A (1 << 19)
  369. #define VI6_UDS_CTRL_NE_RCR (1 << 18)
  370. #define VI6_UDS_CTRL_NE_GY (1 << 17)
  371. #define VI6_UDS_CTRL_NE_BCB (1 << 16)
  372. #define VI6_UDS_CTRL_AMDSLH (1 << 2)
  373. #define VI6_UDS_CTRL_TDIPC (1 << 1)
  374. #define VI6_UDS_SCALE 0x2304
  375. #define VI6_UDS_SCALE_HMANT_MASK (0xf << 28)
  376. #define VI6_UDS_SCALE_HMANT_SHIFT 28
  377. #define VI6_UDS_SCALE_HFRAC_MASK (0xfff << 16)
  378. #define VI6_UDS_SCALE_HFRAC_SHIFT 16
  379. #define VI6_UDS_SCALE_VMANT_MASK (0xf << 12)
  380. #define VI6_UDS_SCALE_VMANT_SHIFT 12
  381. #define VI6_UDS_SCALE_VFRAC_MASK (0xfff << 0)
  382. #define VI6_UDS_SCALE_VFRAC_SHIFT 0
  383. #define VI6_UDS_ALPTH 0x2308
  384. #define VI6_UDS_ALPTH_TH1_MASK (0xff << 8)
  385. #define VI6_UDS_ALPTH_TH1_SHIFT 8
  386. #define VI6_UDS_ALPTH_TH0_MASK (0xff << 0)
  387. #define VI6_UDS_ALPTH_TH0_SHIFT 0
  388. #define VI6_UDS_ALPVAL 0x230c
  389. #define VI6_UDS_ALPVAL_VAL2_MASK (0xff << 16)
  390. #define VI6_UDS_ALPVAL_VAL2_SHIFT 16
  391. #define VI6_UDS_ALPVAL_VAL1_MASK (0xff << 8)
  392. #define VI6_UDS_ALPVAL_VAL1_SHIFT 8
  393. #define VI6_UDS_ALPVAL_VAL0_MASK (0xff << 0)
  394. #define VI6_UDS_ALPVAL_VAL0_SHIFT 0
  395. #define VI6_UDS_PASS_BWIDTH 0x2310
  396. #define VI6_UDS_PASS_BWIDTH_H_MASK (0x7f << 16)
  397. #define VI6_UDS_PASS_BWIDTH_H_SHIFT 16
  398. #define VI6_UDS_PASS_BWIDTH_V_MASK (0x7f << 0)
  399. #define VI6_UDS_PASS_BWIDTH_V_SHIFT 0
  400. #define VI6_UDS_HPHASE 0x2314
  401. #define VI6_UDS_HPHASE_HSTP_MASK (0xfff << 16)
  402. #define VI6_UDS_HPHASE_HSTP_SHIFT 16
  403. #define VI6_UDS_HPHASE_HEDP_MASK (0xfff << 0)
  404. #define VI6_UDS_HPHASE_HEDP_SHIFT 0
  405. #define VI6_UDS_IPC 0x2318
  406. #define VI6_UDS_IPC_FIELD (1 << 27)
  407. #define VI6_UDS_IPC_VEDP_MASK (0xfff << 0)
  408. #define VI6_UDS_IPC_VEDP_SHIFT 0
  409. #define VI6_UDS_HSZCLIP 0x231c
  410. #define VI6_UDS_HSZCLIP_HCEN (1 << 28)
  411. #define VI6_UDS_HSZCLIP_HCL_OFST_MASK (0xff << 16)
  412. #define VI6_UDS_HSZCLIP_HCL_OFST_SHIFT 16
  413. #define VI6_UDS_HSZCLIP_HCL_SIZE_MASK (0x1fff << 0)
  414. #define VI6_UDS_HSZCLIP_HCL_SIZE_SHIFT 0
  415. #define VI6_UDS_CLIP_SIZE 0x2324
  416. #define VI6_UDS_CLIP_SIZE_HSIZE_MASK (0x1fff << 16)
  417. #define VI6_UDS_CLIP_SIZE_HSIZE_SHIFT 16
  418. #define VI6_UDS_CLIP_SIZE_VSIZE_MASK (0x1fff << 0)
  419. #define VI6_UDS_CLIP_SIZE_VSIZE_SHIFT 0
  420. #define VI6_UDS_FILL_COLOR 0x2328
  421. #define VI6_UDS_FILL_COLOR_RFILC_MASK (0xff << 16)
  422. #define VI6_UDS_FILL_COLOR_RFILC_SHIFT 16
  423. #define VI6_UDS_FILL_COLOR_GFILC_MASK (0xff << 8)
  424. #define VI6_UDS_FILL_COLOR_GFILC_SHIFT 8
  425. #define VI6_UDS_FILL_COLOR_BFILC_MASK (0xff << 0)
  426. #define VI6_UDS_FILL_COLOR_BFILC_SHIFT 0
  427. /* -----------------------------------------------------------------------------
  428. * LUT Control Registers
  429. */
  430. #define VI6_LUT_CTRL 0x2800
  431. #define VI6_LUT_CTRL_EN (1 << 0)
  432. /* -----------------------------------------------------------------------------
  433. * CLU Control Registers
  434. */
  435. #define VI6_CLU_CTRL 0x2900
  436. #define VI6_CLU_CTRL_AAI (1 << 28)
  437. #define VI6_CLU_CTRL_MVS (1 << 24)
  438. #define VI6_CLU_CTRL_AX1I_2D (3 << 14)
  439. #define VI6_CLU_CTRL_AX2I_2D (1 << 12)
  440. #define VI6_CLU_CTRL_OS0_2D (3 << 8)
  441. #define VI6_CLU_CTRL_OS1_2D (1 << 6)
  442. #define VI6_CLU_CTRL_OS2_2D (3 << 4)
  443. #define VI6_CLU_CTRL_M2D (1 << 1)
  444. #define VI6_CLU_CTRL_EN (1 << 0)
  445. /* -----------------------------------------------------------------------------
  446. * HST Control Registers
  447. */
  448. #define VI6_HST_CTRL 0x2a00
  449. #define VI6_HST_CTRL_EN (1 << 0)
  450. /* -----------------------------------------------------------------------------
  451. * HSI Control Registers
  452. */
  453. #define VI6_HSI_CTRL 0x2b00
  454. #define VI6_HSI_CTRL_EN (1 << 0)
  455. /* -----------------------------------------------------------------------------
  456. * BRS and BRU Control Registers
  457. */
  458. #define VI6_ROP_NOP 0
  459. #define VI6_ROP_AND 1
  460. #define VI6_ROP_AND_REV 2
  461. #define VI6_ROP_COPY 3
  462. #define VI6_ROP_AND_INV 4
  463. #define VI6_ROP_CLEAR 5
  464. #define VI6_ROP_XOR 6
  465. #define VI6_ROP_OR 7
  466. #define VI6_ROP_NOR 8
  467. #define VI6_ROP_EQUIV 9
  468. #define VI6_ROP_INVERT 10
  469. #define VI6_ROP_OR_REV 11
  470. #define VI6_ROP_COPY_INV 12
  471. #define VI6_ROP_OR_INV 13
  472. #define VI6_ROP_NAND 14
  473. #define VI6_ROP_SET 15
  474. #define VI6_BRU_BASE 0x2c00
  475. #define VI6_BRS_BASE 0x3900
  476. #define VI6_BRU_INCTRL 0x0000
  477. #define VI6_BRU_INCTRL_NRM (1 << 28)
  478. #define VI6_BRU_INCTRL_DnON (1 << (16 + (n)))
  479. #define VI6_BRU_INCTRL_DITHn_OFF (0 << ((n) * 4))
  480. #define VI6_BRU_INCTRL_DITHn_18BPP (1 << ((n) * 4))
  481. #define VI6_BRU_INCTRL_DITHn_16BPP (2 << ((n) * 4))
  482. #define VI6_BRU_INCTRL_DITHn_15BPP (3 << ((n) * 4))
  483. #define VI6_BRU_INCTRL_DITHn_12BPP (4 << ((n) * 4))
  484. #define VI6_BRU_INCTRL_DITHn_8BPP (5 << ((n) * 4))
  485. #define VI6_BRU_INCTRL_DITHn_MASK (7 << ((n) * 4))
  486. #define VI6_BRU_INCTRL_DITHn_SHIFT ((n) * 4)
  487. #define VI6_BRU_VIRRPF_SIZE 0x0004
  488. #define VI6_BRU_VIRRPF_SIZE_HSIZE_MASK (0x1fff << 16)
  489. #define VI6_BRU_VIRRPF_SIZE_HSIZE_SHIFT 16
  490. #define VI6_BRU_VIRRPF_SIZE_VSIZE_MASK (0x1fff << 0)
  491. #define VI6_BRU_VIRRPF_SIZE_VSIZE_SHIFT 0
  492. #define VI6_BRU_VIRRPF_LOC 0x0008
  493. #define VI6_BRU_VIRRPF_LOC_HCOORD_MASK (0x1fff << 16)
  494. #define VI6_BRU_VIRRPF_LOC_HCOORD_SHIFT 16
  495. #define VI6_BRU_VIRRPF_LOC_VCOORD_MASK (0x1fff << 0)
  496. #define VI6_BRU_VIRRPF_LOC_VCOORD_SHIFT 0
  497. #define VI6_BRU_VIRRPF_COL 0x000c
  498. #define VI6_BRU_VIRRPF_COL_A_MASK (0xff << 24)
  499. #define VI6_BRU_VIRRPF_COL_A_SHIFT 24
  500. #define VI6_BRU_VIRRPF_COL_RCR_MASK (0xff << 16)
  501. #define VI6_BRU_VIRRPF_COL_RCR_SHIFT 16
  502. #define VI6_BRU_VIRRPF_COL_GY_MASK (0xff << 8)
  503. #define VI6_BRU_VIRRPF_COL_GY_SHIFT 8
  504. #define VI6_BRU_VIRRPF_COL_BCB_MASK (0xff << 0)
  505. #define VI6_BRU_VIRRPF_COL_BCB_SHIFT 0
  506. #define VI6_BRU_CTRL(n) (0x0010 + (n) * 8 + ((n) <= 3 ? 0 : 4))
  507. #define VI6_BRU_CTRL_RBC (1 << 31)
  508. #define VI6_BRU_CTRL_DSTSEL_BRUIN(n) (((n) <= 3 ? (n) : (n)+1) << 20)
  509. #define VI6_BRU_CTRL_DSTSEL_VRPF (4 << 20)
  510. #define VI6_BRU_CTRL_DSTSEL_MASK (7 << 20)
  511. #define VI6_BRU_CTRL_SRCSEL_BRUIN(n) (((n) <= 3 ? (n) : (n)+1) << 16)
  512. #define VI6_BRU_CTRL_SRCSEL_VRPF (4 << 16)
  513. #define VI6_BRU_CTRL_SRCSEL_MASK (7 << 16)
  514. #define VI6_BRU_CTRL_CROP(rop) ((rop) << 4)
  515. #define VI6_BRU_CTRL_CROP_MASK (0xf << 4)
  516. #define VI6_BRU_CTRL_AROP(rop) ((rop) << 0)
  517. #define VI6_BRU_CTRL_AROP_MASK (0xf << 0)
  518. #define VI6_BRU_BLD(n) (0x0014 + (n) * 8 + ((n) <= 3 ? 0 : 4))
  519. #define VI6_BRU_BLD_CBES (1 << 31)
  520. #define VI6_BRU_BLD_CCMDX_DST_A (0 << 28)
  521. #define VI6_BRU_BLD_CCMDX_255_DST_A (1 << 28)
  522. #define VI6_BRU_BLD_CCMDX_SRC_A (2 << 28)
  523. #define VI6_BRU_BLD_CCMDX_255_SRC_A (3 << 28)
  524. #define VI6_BRU_BLD_CCMDX_COEFX (4 << 28)
  525. #define VI6_BRU_BLD_CCMDX_MASK (7 << 28)
  526. #define VI6_BRU_BLD_CCMDY_DST_A (0 << 24)
  527. #define VI6_BRU_BLD_CCMDY_255_DST_A (1 << 24)
  528. #define VI6_BRU_BLD_CCMDY_SRC_A (2 << 24)
  529. #define VI6_BRU_BLD_CCMDY_255_SRC_A (3 << 24)
  530. #define VI6_BRU_BLD_CCMDY_COEFY (4 << 24)
  531. #define VI6_BRU_BLD_CCMDY_MASK (7 << 24)
  532. #define VI6_BRU_BLD_CCMDY_SHIFT 24
  533. #define VI6_BRU_BLD_ABES (1 << 23)
  534. #define VI6_BRU_BLD_ACMDX_DST_A (0 << 20)
  535. #define VI6_BRU_BLD_ACMDX_255_DST_A (1 << 20)
  536. #define VI6_BRU_BLD_ACMDX_SRC_A (2 << 20)
  537. #define VI6_BRU_BLD_ACMDX_255_SRC_A (3 << 20)
  538. #define VI6_BRU_BLD_ACMDX_COEFX (4 << 20)
  539. #define VI6_BRU_BLD_ACMDX_MASK (7 << 20)
  540. #define VI6_BRU_BLD_ACMDY_DST_A (0 << 16)
  541. #define VI6_BRU_BLD_ACMDY_255_DST_A (1 << 16)
  542. #define VI6_BRU_BLD_ACMDY_SRC_A (2 << 16)
  543. #define VI6_BRU_BLD_ACMDY_255_SRC_A (3 << 16)
  544. #define VI6_BRU_BLD_ACMDY_COEFY (4 << 16)
  545. #define VI6_BRU_BLD_ACMDY_MASK (7 << 16)
  546. #define VI6_BRU_BLD_COEFX_MASK (0xff << 8)
  547. #define VI6_BRU_BLD_COEFX_SHIFT 8
  548. #define VI6_BRU_BLD_COEFY_MASK (0xff << 0)
  549. #define VI6_BRU_BLD_COEFY_SHIFT 0
  550. #define VI6_BRU_ROP 0x0030 /* Only available on BRU */
  551. #define VI6_BRU_ROP_DSTSEL_BRUIN(n) (((n) <= 3 ? (n) : (n)+1) << 20)
  552. #define VI6_BRU_ROP_DSTSEL_VRPF (4 << 20)
  553. #define VI6_BRU_ROP_DSTSEL_MASK (7 << 20)
  554. #define VI6_BRU_ROP_CROP(rop) ((rop) << 4)
  555. #define VI6_BRU_ROP_CROP_MASK (0xf << 4)
  556. #define VI6_BRU_ROP_AROP(rop) ((rop) << 0)
  557. #define VI6_BRU_ROP_AROP_MASK (0xf << 0)
  558. /* -----------------------------------------------------------------------------
  559. * HGO Control Registers
  560. */
  561. #define VI6_HGO_OFFSET 0x3000
  562. #define VI6_HGO_OFFSET_HOFFSET_SHIFT 16
  563. #define VI6_HGO_OFFSET_VOFFSET_SHIFT 0
  564. #define VI6_HGO_SIZE 0x3004
  565. #define VI6_HGO_SIZE_HSIZE_SHIFT 16
  566. #define VI6_HGO_SIZE_VSIZE_SHIFT 0
  567. #define VI6_HGO_MODE 0x3008
  568. #define VI6_HGO_MODE_STEP (1 << 10)
  569. #define VI6_HGO_MODE_MAXRGB (1 << 7)
  570. #define VI6_HGO_MODE_OFSB_R (1 << 6)
  571. #define VI6_HGO_MODE_OFSB_G (1 << 5)
  572. #define VI6_HGO_MODE_OFSB_B (1 << 4)
  573. #define VI6_HGO_MODE_HRATIO_SHIFT 2
  574. #define VI6_HGO_MODE_VRATIO_SHIFT 0
  575. #define VI6_HGO_LB_TH 0x300c
  576. #define VI6_HGO_LBn_H(n) (0x3010 + (n) * 8)
  577. #define VI6_HGO_LBn_V(n) (0x3014 + (n) * 8)
  578. #define VI6_HGO_R_HISTO(n) (0x3030 + (n) * 4)
  579. #define VI6_HGO_R_MAXMIN 0x3130
  580. #define VI6_HGO_R_SUM 0x3134
  581. #define VI6_HGO_R_LB_DET 0x3138
  582. #define VI6_HGO_G_HISTO(n) (0x3140 + (n) * 4)
  583. #define VI6_HGO_G_MAXMIN 0x3240
  584. #define VI6_HGO_G_SUM 0x3244
  585. #define VI6_HGO_G_LB_DET 0x3248
  586. #define VI6_HGO_B_HISTO(n) (0x3250 + (n) * 4)
  587. #define VI6_HGO_B_MAXMIN 0x3350
  588. #define VI6_HGO_B_SUM 0x3354
  589. #define VI6_HGO_B_LB_DET 0x3358
  590. #define VI6_HGO_EXT_HIST_ADDR 0x335c
  591. #define VI6_HGO_EXT_HIST_DATA 0x3360
  592. #define VI6_HGO_REGRST 0x33fc
  593. #define VI6_HGO_REGRST_RCLEA (1 << 0)
  594. /* -----------------------------------------------------------------------------
  595. * HGT Control Registers
  596. */
  597. #define VI6_HGT_OFFSET 0x3400
  598. #define VI6_HGT_OFFSET_HOFFSET_SHIFT 16
  599. #define VI6_HGT_OFFSET_VOFFSET_SHIFT 0
  600. #define VI6_HGT_SIZE 0x3404
  601. #define VI6_HGT_SIZE_HSIZE_SHIFT 16
  602. #define VI6_HGT_SIZE_VSIZE_SHIFT 0
  603. #define VI6_HGT_MODE 0x3408
  604. #define VI6_HGT_MODE_HRATIO_SHIFT 2
  605. #define VI6_HGT_MODE_VRATIO_SHIFT 0
  606. #define VI6_HGT_HUE_AREA(n) (0x340c + (n) * 4)
  607. #define VI6_HGT_HUE_AREA_LOWER_SHIFT 16
  608. #define VI6_HGT_HUE_AREA_UPPER_SHIFT 0
  609. #define VI6_HGT_LB_TH 0x3424
  610. #define VI6_HGT_LBn_H(n) (0x3438 + (n) * 8)
  611. #define VI6_HGT_LBn_V(n) (0x342c + (n) * 8)
  612. #define VI6_HGT_HISTO(m, n) (0x3450 + (m) * 128 + (n) * 4)
  613. #define VI6_HGT_MAXMIN 0x3750
  614. #define VI6_HGT_SUM 0x3754
  615. #define VI6_HGT_LB_DET 0x3758
  616. #define VI6_HGT_REGRST 0x37fc
  617. #define VI6_HGT_REGRST_RCLEA (1 << 0)
  618. /* -----------------------------------------------------------------------------
  619. * LIF Control Registers
  620. */
  621. #define VI6_LIF_OFFSET (-0x100)
  622. #define VI6_LIF_CTRL 0x3b00
  623. #define VI6_LIF_CTRL_OBTH_MASK (0x7ff << 16)
  624. #define VI6_LIF_CTRL_OBTH_SHIFT 16
  625. #define VI6_LIF_CTRL_CFMT (1 << 4)
  626. #define VI6_LIF_CTRL_REQSEL (1 << 1)
  627. #define VI6_LIF_CTRL_LIF_EN (1 << 0)
  628. #define VI6_LIF_CSBTH 0x3b04
  629. #define VI6_LIF_CSBTH_HBTH_MASK (0x7ff << 16)
  630. #define VI6_LIF_CSBTH_HBTH_SHIFT 16
  631. #define VI6_LIF_CSBTH_LBTH_MASK (0x7ff << 0)
  632. #define VI6_LIF_CSBTH_LBTH_SHIFT 0
  633. #define VI6_LIF_LBA 0x3b0c
  634. #define VI6_LIF_LBA_LBA0 (1 << 31)
  635. #define VI6_LIF_LBA_LBA1_MASK (0xfff << 16)
  636. #define VI6_LIF_LBA_LBA1_SHIFT 16
  637. /* -----------------------------------------------------------------------------
  638. * Security Control Registers
  639. */
  640. #define VI6_SECURITY_CTRL0 0x3d00
  641. #define VI6_SECURITY_CTRL1 0x3d04
  642. /* -----------------------------------------------------------------------------
  643. * IP Version Registers
  644. */
  645. #define VI6_IP_VERSION 0x3f00
  646. #define VI6_IP_VERSION_MASK (0xffff << 0)
  647. #define VI6_IP_VERSION_MODEL_MASK (0xff << 8)
  648. #define VI6_IP_VERSION_MODEL_VSPS_H2 (0x09 << 8)
  649. #define VI6_IP_VERSION_MODEL_VSPR_H2 (0x0a << 8)
  650. #define VI6_IP_VERSION_MODEL_VSPD_GEN2 (0x0b << 8)
  651. #define VI6_IP_VERSION_MODEL_VSPS_M2 (0x0c << 8)
  652. #define VI6_IP_VERSION_MODEL_VSPS_V2H (0x12 << 8)
  653. #define VI6_IP_VERSION_MODEL_VSPD_V2H (0x13 << 8)
  654. #define VI6_IP_VERSION_MODEL_VSPI_GEN3 (0x14 << 8)
  655. #define VI6_IP_VERSION_MODEL_VSPBD_GEN3 (0x15 << 8)
  656. #define VI6_IP_VERSION_MODEL_VSPBC_GEN3 (0x16 << 8)
  657. #define VI6_IP_VERSION_MODEL_VSPD_GEN3 (0x17 << 8)
  658. #define VI6_IP_VERSION_MODEL_VSPD_V3 (0x18 << 8)
  659. #define VI6_IP_VERSION_MODEL_VSPDL_GEN3 (0x19 << 8)
  660. #define VI6_IP_VERSION_MODEL_VSPBS_GEN3 (0x1a << 8)
  661. #define VI6_IP_VERSION_SOC_MASK (0xff << 0)
  662. #define VI6_IP_VERSION_SOC_H2 (0x01 << 0)
  663. #define VI6_IP_VERSION_SOC_V2H (0x01 << 0)
  664. #define VI6_IP_VERSION_SOC_V3M (0x01 << 0)
  665. #define VI6_IP_VERSION_SOC_M2 (0x02 << 0)
  666. #define VI6_IP_VERSION_SOC_M3W (0x02 << 0)
  667. #define VI6_IP_VERSION_SOC_V3H (0x02 << 0)
  668. #define VI6_IP_VERSION_SOC_H3 (0x03 << 0)
  669. #define VI6_IP_VERSION_SOC_D3 (0x04 << 0)
  670. #define VI6_IP_VERSION_SOC_M3N (0x04 << 0)
  671. #define VI6_IP_VERSION_SOC_E3 (0x04 << 0)
  672. /* -----------------------------------------------------------------------------
  673. * RPF CLUT Registers
  674. */
  675. #define VI6_CLUT_TABLE 0x4000
  676. /* -----------------------------------------------------------------------------
  677. * 1D LUT Registers
  678. */
  679. #define VI6_LUT_TABLE 0x7000
  680. /* -----------------------------------------------------------------------------
  681. * 3D LUT Registers
  682. */
  683. #define VI6_CLU_ADDR 0x7400
  684. #define VI6_CLU_DATA 0x7404
  685. /* -----------------------------------------------------------------------------
  686. * Formats
  687. */
  688. #define VI6_FMT_RGB_332 0x00
  689. #define VI6_FMT_XRGB_4444 0x01
  690. #define VI6_FMT_RGBX_4444 0x02
  691. #define VI6_FMT_XRGB_1555 0x04
  692. #define VI6_FMT_RGBX_5551 0x05
  693. #define VI6_FMT_RGB_565 0x06
  694. #define VI6_FMT_AXRGB_86666 0x07
  695. #define VI6_FMT_RGBXA_66668 0x08
  696. #define VI6_FMT_XRGBA_66668 0x09
  697. #define VI6_FMT_ARGBX_86666 0x0a
  698. #define VI6_FMT_AXRXGXB_8262626 0x0b
  699. #define VI6_FMT_XRXGXBA_2626268 0x0c
  700. #define VI6_FMT_ARXGXBX_8626262 0x0d
  701. #define VI6_FMT_RXGXBXA_6262628 0x0e
  702. #define VI6_FMT_XRGB_6666 0x0f
  703. #define VI6_FMT_RGBX_6666 0x10
  704. #define VI6_FMT_XRXGXB_262626 0x11
  705. #define VI6_FMT_RXGXBX_626262 0x12
  706. #define VI6_FMT_ARGB_8888 0x13
  707. #define VI6_FMT_RGBA_8888 0x14
  708. #define VI6_FMT_RGB_888 0x15
  709. #define VI6_FMT_XRGXGB_763763 0x16
  710. #define VI6_FMT_XXRGB_86666 0x17
  711. #define VI6_FMT_BGR_888 0x18
  712. #define VI6_FMT_ARGB_4444 0x19
  713. #define VI6_FMT_RGBA_4444 0x1a
  714. #define VI6_FMT_ARGB_1555 0x1b
  715. #define VI6_FMT_RGBA_5551 0x1c
  716. #define VI6_FMT_ABGR_4444 0x1d
  717. #define VI6_FMT_BGRA_4444 0x1e
  718. #define VI6_FMT_ABGR_1555 0x1f
  719. #define VI6_FMT_BGRA_5551 0x20
  720. #define VI6_FMT_XBXGXR_262626 0x21
  721. #define VI6_FMT_ABGR_8888 0x22
  722. #define VI6_FMT_XXRGB_88565 0x23
  723. #define VI6_FMT_Y_UV_444 0x40
  724. #define VI6_FMT_Y_UV_422 0x41
  725. #define VI6_FMT_Y_UV_420 0x42
  726. #define VI6_FMT_YUV_444 0x46
  727. #define VI6_FMT_YUYV_422 0x47
  728. #define VI6_FMT_YYUV_422 0x48
  729. #define VI6_FMT_YUV_420 0x49
  730. #define VI6_FMT_Y_U_V_444 0x4a
  731. #define VI6_FMT_Y_U_V_422 0x4b
  732. #define VI6_FMT_Y_U_V_420 0x4c
  733. #endif /* __VSP1_REGS_H__ */