vpe_regs.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /*
  2. * Copyright (c) 2013 Texas Instruments Inc.
  3. *
  4. * David Griego, <dagriego@biglakesoftware.com>
  5. * Dale Farnsworth, <dale@farnsworth.org>
  6. * Archit Taneja, <archit@ti.com>
  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 version 2 as published by
  10. * the Free Software Foundation.
  11. */
  12. #ifndef __TI_VPE_REGS_H
  13. #define __TI_VPE_REGS_H
  14. /* VPE register offsets and field selectors */
  15. /* VPE top level regs */
  16. #define VPE_PID 0x0000
  17. #define VPE_PID_MINOR_MASK 0x3f
  18. #define VPE_PID_MINOR_SHIFT 0
  19. #define VPE_PID_CUSTOM_MASK 0x03
  20. #define VPE_PID_CUSTOM_SHIFT 6
  21. #define VPE_PID_MAJOR_MASK 0x07
  22. #define VPE_PID_MAJOR_SHIFT 8
  23. #define VPE_PID_RTL_MASK 0x1f
  24. #define VPE_PID_RTL_SHIFT 11
  25. #define VPE_PID_FUNC_MASK 0xfff
  26. #define VPE_PID_FUNC_SHIFT 16
  27. #define VPE_PID_SCHEME_MASK 0x03
  28. #define VPE_PID_SCHEME_SHIFT 30
  29. #define VPE_SYSCONFIG 0x0010
  30. #define VPE_SYSCONFIG_IDLE_MASK 0x03
  31. #define VPE_SYSCONFIG_IDLE_SHIFT 2
  32. #define VPE_SYSCONFIG_STANDBY_MASK 0x03
  33. #define VPE_SYSCONFIG_STANDBY_SHIFT 4
  34. #define VPE_FORCE_IDLE_MODE 0
  35. #define VPE_NO_IDLE_MODE 1
  36. #define VPE_SMART_IDLE_MODE 2
  37. #define VPE_SMART_IDLE_WAKEUP_MODE 3
  38. #define VPE_FORCE_STANDBY_MODE 0
  39. #define VPE_NO_STANDBY_MODE 1
  40. #define VPE_SMART_STANDBY_MODE 2
  41. #define VPE_SMART_STANDBY_WAKEUP_MODE 3
  42. #define VPE_INT0_STATUS0_RAW_SET 0x0020
  43. #define VPE_INT0_STATUS0_RAW VPE_INT0_STATUS0_RAW_SET
  44. #define VPE_INT0_STATUS0_CLR 0x0028
  45. #define VPE_INT0_STATUS0 VPE_INT0_STATUS0_CLR
  46. #define VPE_INT0_ENABLE0_SET 0x0030
  47. #define VPE_INT0_ENABLE0 VPE_INT0_ENABLE0_SET
  48. #define VPE_INT0_ENABLE0_CLR 0x0038
  49. #define VPE_INT0_LIST0_COMPLETE (1 << 0)
  50. #define VPE_INT0_LIST0_NOTIFY (1 << 1)
  51. #define VPE_INT0_LIST1_COMPLETE (1 << 2)
  52. #define VPE_INT0_LIST1_NOTIFY (1 << 3)
  53. #define VPE_INT0_LIST2_COMPLETE (1 << 4)
  54. #define VPE_INT0_LIST2_NOTIFY (1 << 5)
  55. #define VPE_INT0_LIST3_COMPLETE (1 << 6)
  56. #define VPE_INT0_LIST3_NOTIFY (1 << 7)
  57. #define VPE_INT0_LIST4_COMPLETE (1 << 8)
  58. #define VPE_INT0_LIST4_NOTIFY (1 << 9)
  59. #define VPE_INT0_LIST5_COMPLETE (1 << 10)
  60. #define VPE_INT0_LIST5_NOTIFY (1 << 11)
  61. #define VPE_INT0_LIST6_COMPLETE (1 << 12)
  62. #define VPE_INT0_LIST6_NOTIFY (1 << 13)
  63. #define VPE_INT0_LIST7_COMPLETE (1 << 14)
  64. #define VPE_INT0_LIST7_NOTIFY (1 << 15)
  65. #define VPE_INT0_DESCRIPTOR (1 << 16)
  66. #define VPE_DEI_FMD_INT (1 << 18)
  67. #define VPE_INT0_STATUS1_RAW_SET 0x0024
  68. #define VPE_INT0_STATUS1_RAW VPE_INT0_STATUS1_RAW_SET
  69. #define VPE_INT0_STATUS1_CLR 0x002c
  70. #define VPE_INT0_STATUS1 VPE_INT0_STATUS1_CLR
  71. #define VPE_INT0_ENABLE1_SET 0x0034
  72. #define VPE_INT0_ENABLE1 VPE_INT0_ENABLE1_SET
  73. #define VPE_INT0_ENABLE1_CLR 0x003c
  74. #define VPE_INT0_CHANNEL_GROUP0 (1 << 0)
  75. #define VPE_INT0_CHANNEL_GROUP1 (1 << 1)
  76. #define VPE_INT0_CHANNEL_GROUP2 (1 << 2)
  77. #define VPE_INT0_CHANNEL_GROUP3 (1 << 3)
  78. #define VPE_INT0_CHANNEL_GROUP4 (1 << 4)
  79. #define VPE_INT0_CHANNEL_GROUP5 (1 << 5)
  80. #define VPE_INT0_CLIENT (1 << 7)
  81. #define VPE_DEI_ERROR_INT (1 << 16)
  82. #define VPE_DS1_UV_ERROR_INT (1 << 22)
  83. #define VPE_INTC_EOI 0x00a0
  84. #define VPE_CLK_ENABLE 0x0100
  85. #define VPE_VPEDMA_CLK_ENABLE (1 << 0)
  86. #define VPE_DATA_PATH_CLK_ENABLE (1 << 1)
  87. #define VPE_CLK_RESET 0x0104
  88. #define VPE_VPDMA_CLK_RESET_MASK 0x1
  89. #define VPE_VPDMA_CLK_RESET_SHIFT 0
  90. #define VPE_DATA_PATH_CLK_RESET_MASK 0x1
  91. #define VPE_DATA_PATH_CLK_RESET_SHIFT 1
  92. #define VPE_MAIN_RESET_MASK 0x1
  93. #define VPE_MAIN_RESET_SHIFT 31
  94. #define VPE_CLK_FORMAT_SELECT 0x010c
  95. #define VPE_CSC_SRC_SELECT_MASK 0x03
  96. #define VPE_CSC_SRC_SELECT_SHIFT 0
  97. #define VPE_RGB_OUT_SELECT (1 << 8)
  98. #define VPE_DS_SRC_SELECT_MASK 0x07
  99. #define VPE_DS_SRC_SELECT_SHIFT 9
  100. #define VPE_DS_BYPASS (1 << 16)
  101. #define VPE_COLOR_SEPARATE_422 (1 << 18)
  102. #define VPE_DS_SRC_DEI_SCALER (5 << VPE_DS_SRC_SELECT_SHIFT)
  103. #define VPE_CSC_SRC_DEI_SCALER (3 << VPE_CSC_SRC_SELECT_SHIFT)
  104. #define VPE_CLK_RANGE_MAP 0x011c
  105. #define VPE_RANGE_RANGE_MAP_Y_MASK 0x07
  106. #define VPE_RANGE_RANGE_MAP_Y_SHIFT 0
  107. #define VPE_RANGE_RANGE_MAP_UV_MASK 0x07
  108. #define VPE_RANGE_RANGE_MAP_UV_SHIFT 3
  109. #define VPE_RANGE_MAP_ON (1 << 6)
  110. #define VPE_RANGE_REDUCTION_ON (1 << 28)
  111. /* VPE chrominance upsampler regs */
  112. #define VPE_US1_R0 0x0304
  113. #define VPE_US2_R0 0x0404
  114. #define VPE_US3_R0 0x0504
  115. #define VPE_US_C1_MASK 0x3fff
  116. #define VPE_US_C1_SHIFT 2
  117. #define VPE_US_C0_MASK 0x3fff
  118. #define VPE_US_C0_SHIFT 18
  119. #define VPE_US_MODE_MASK 0x03
  120. #define VPE_US_MODE_SHIFT 16
  121. #define VPE_ANCHOR_FID0_C1_MASK 0x3fff
  122. #define VPE_ANCHOR_FID0_C1_SHIFT 2
  123. #define VPE_ANCHOR_FID0_C0_MASK 0x3fff
  124. #define VPE_ANCHOR_FID0_C0_SHIFT 18
  125. #define VPE_US1_R1 0x0308
  126. #define VPE_US2_R1 0x0408
  127. #define VPE_US3_R1 0x0508
  128. #define VPE_ANCHOR_FID0_C3_MASK 0x3fff
  129. #define VPE_ANCHOR_FID0_C3_SHIFT 2
  130. #define VPE_ANCHOR_FID0_C2_MASK 0x3fff
  131. #define VPE_ANCHOR_FID0_C2_SHIFT 18
  132. #define VPE_US1_R2 0x030c
  133. #define VPE_US2_R2 0x040c
  134. #define VPE_US3_R2 0x050c
  135. #define VPE_INTERP_FID0_C1_MASK 0x3fff
  136. #define VPE_INTERP_FID0_C1_SHIFT 2
  137. #define VPE_INTERP_FID0_C0_MASK 0x3fff
  138. #define VPE_INTERP_FID0_C0_SHIFT 18
  139. #define VPE_US1_R3 0x0310
  140. #define VPE_US2_R3 0x0410
  141. #define VPE_US3_R3 0x0510
  142. #define VPE_INTERP_FID0_C3_MASK 0x3fff
  143. #define VPE_INTERP_FID0_C3_SHIFT 2
  144. #define VPE_INTERP_FID0_C2_MASK 0x3fff
  145. #define VPE_INTERP_FID0_C2_SHIFT 18
  146. #define VPE_US1_R4 0x0314
  147. #define VPE_US2_R4 0x0414
  148. #define VPE_US3_R4 0x0514
  149. #define VPE_ANCHOR_FID1_C1_MASK 0x3fff
  150. #define VPE_ANCHOR_FID1_C1_SHIFT 2
  151. #define VPE_ANCHOR_FID1_C0_MASK 0x3fff
  152. #define VPE_ANCHOR_FID1_C0_SHIFT 18
  153. #define VPE_US1_R5 0x0318
  154. #define VPE_US2_R5 0x0418
  155. #define VPE_US3_R5 0x0518
  156. #define VPE_ANCHOR_FID1_C3_MASK 0x3fff
  157. #define VPE_ANCHOR_FID1_C3_SHIFT 2
  158. #define VPE_ANCHOR_FID1_C2_MASK 0x3fff
  159. #define VPE_ANCHOR_FID1_C2_SHIFT 18
  160. #define VPE_US1_R6 0x031c
  161. #define VPE_US2_R6 0x041c
  162. #define VPE_US3_R6 0x051c
  163. #define VPE_INTERP_FID1_C1_MASK 0x3fff
  164. #define VPE_INTERP_FID1_C1_SHIFT 2
  165. #define VPE_INTERP_FID1_C0_MASK 0x3fff
  166. #define VPE_INTERP_FID1_C0_SHIFT 18
  167. #define VPE_US1_R7 0x0320
  168. #define VPE_US2_R7 0x0420
  169. #define VPE_US3_R7 0x0520
  170. #define VPE_INTERP_FID0_C3_MASK 0x3fff
  171. #define VPE_INTERP_FID0_C3_SHIFT 2
  172. #define VPE_INTERP_FID0_C2_MASK 0x3fff
  173. #define VPE_INTERP_FID0_C2_SHIFT 18
  174. /* VPE de-interlacer regs */
  175. #define VPE_DEI_FRAME_SIZE 0x0600
  176. #define VPE_DEI_WIDTH_MASK 0x07ff
  177. #define VPE_DEI_WIDTH_SHIFT 0
  178. #define VPE_DEI_HEIGHT_MASK 0x07ff
  179. #define VPE_DEI_HEIGHT_SHIFT 16
  180. #define VPE_DEI_INTERLACE_BYPASS (1 << 29)
  181. #define VPE_DEI_FIELD_FLUSH (1 << 30)
  182. #define VPE_DEI_PROGRESSIVE (1 << 31)
  183. #define VPE_MDT_BYPASS 0x0604
  184. #define VPE_MDT_TEMPMAX_BYPASS (1 << 0)
  185. #define VPE_MDT_SPATMAX_BYPASS (1 << 1)
  186. #define VPE_MDT_SF_THRESHOLD 0x0608
  187. #define VPE_MDT_SF_SC_THR1_MASK 0xff
  188. #define VPE_MDT_SF_SC_THR1_SHIFT 0
  189. #define VPE_MDT_SF_SC_THR2_MASK 0xff
  190. #define VPE_MDT_SF_SC_THR2_SHIFT 0
  191. #define VPE_MDT_SF_SC_THR3_MASK 0xff
  192. #define VPE_MDT_SF_SC_THR3_SHIFT 0
  193. #define VPE_EDI_CONFIG 0x060c
  194. #define VPE_EDI_INP_MODE_MASK 0x03
  195. #define VPE_EDI_INP_MODE_SHIFT 0
  196. #define VPE_EDI_ENABLE_3D (1 << 2)
  197. #define VPE_EDI_ENABLE_CHROMA_3D (1 << 3)
  198. #define VPE_EDI_CHROMA3D_COR_THR_MASK 0xff
  199. #define VPE_EDI_CHROMA3D_COR_THR_SHIFT 8
  200. #define VPE_EDI_DIR_COR_LOWER_THR_MASK 0xff
  201. #define VPE_EDI_DIR_COR_LOWER_THR_SHIFT 16
  202. #define VPE_EDI_COR_SCALE_FACTOR_MASK 0xff
  203. #define VPE_EDI_COR_SCALE_FACTOR_SHIFT 23
  204. #define VPE_DEI_EDI_LUT_R0 0x0610
  205. #define VPE_EDI_LUT0_MASK 0x1f
  206. #define VPE_EDI_LUT0_SHIFT 0
  207. #define VPE_EDI_LUT1_MASK 0x1f
  208. #define VPE_EDI_LUT1_SHIFT 8
  209. #define VPE_EDI_LUT2_MASK 0x1f
  210. #define VPE_EDI_LUT2_SHIFT 16
  211. #define VPE_EDI_LUT3_MASK 0x1f
  212. #define VPE_EDI_LUT3_SHIFT 24
  213. #define VPE_DEI_EDI_LUT_R1 0x0614
  214. #define VPE_EDI_LUT0_MASK 0x1f
  215. #define VPE_EDI_LUT0_SHIFT 0
  216. #define VPE_EDI_LUT1_MASK 0x1f
  217. #define VPE_EDI_LUT1_SHIFT 8
  218. #define VPE_EDI_LUT2_MASK 0x1f
  219. #define VPE_EDI_LUT2_SHIFT 16
  220. #define VPE_EDI_LUT3_MASK 0x1f
  221. #define VPE_EDI_LUT3_SHIFT 24
  222. #define VPE_DEI_EDI_LUT_R2 0x0618
  223. #define VPE_EDI_LUT4_MASK 0x1f
  224. #define VPE_EDI_LUT4_SHIFT 0
  225. #define VPE_EDI_LUT5_MASK 0x1f
  226. #define VPE_EDI_LUT5_SHIFT 8
  227. #define VPE_EDI_LUT6_MASK 0x1f
  228. #define VPE_EDI_LUT6_SHIFT 16
  229. #define VPE_EDI_LUT7_MASK 0x1f
  230. #define VPE_EDI_LUT7_SHIFT 24
  231. #define VPE_DEI_EDI_LUT_R3 0x061c
  232. #define VPE_EDI_LUT8_MASK 0x1f
  233. #define VPE_EDI_LUT8_SHIFT 0
  234. #define VPE_EDI_LUT9_MASK 0x1f
  235. #define VPE_EDI_LUT9_SHIFT 8
  236. #define VPE_EDI_LUT10_MASK 0x1f
  237. #define VPE_EDI_LUT10_SHIFT 16
  238. #define VPE_EDI_LUT11_MASK 0x1f
  239. #define VPE_EDI_LUT11_SHIFT 24
  240. #define VPE_DEI_FMD_WINDOW_R0 0x0620
  241. #define VPE_FMD_WINDOW_MINX_MASK 0x07ff
  242. #define VPE_FMD_WINDOW_MINX_SHIFT 0
  243. #define VPE_FMD_WINDOW_MAXX_MASK 0x07ff
  244. #define VPE_FMD_WINDOW_MAXX_SHIFT 16
  245. #define VPE_FMD_WINDOW_ENABLE (1 << 31)
  246. #define VPE_DEI_FMD_WINDOW_R1 0x0624
  247. #define VPE_FMD_WINDOW_MINY_MASK 0x07ff
  248. #define VPE_FMD_WINDOW_MINY_SHIFT 0
  249. #define VPE_FMD_WINDOW_MAXY_MASK 0x07ff
  250. #define VPE_FMD_WINDOW_MAXY_SHIFT 16
  251. #define VPE_DEI_FMD_CONTROL_R0 0x0628
  252. #define VPE_FMD_ENABLE (1 << 0)
  253. #define VPE_FMD_LOCK (1 << 1)
  254. #define VPE_FMD_JAM_DIR (1 << 2)
  255. #define VPE_FMD_BED_ENABLE (1 << 3)
  256. #define VPE_FMD_CAF_FIELD_THR_MASK 0xff
  257. #define VPE_FMD_CAF_FIELD_THR_SHIFT 16
  258. #define VPE_FMD_CAF_LINE_THR_MASK 0xff
  259. #define VPE_FMD_CAF_LINE_THR_SHIFT 24
  260. #define VPE_DEI_FMD_CONTROL_R1 0x062c
  261. #define VPE_FMD_CAF_THR_MASK 0x000fffff
  262. #define VPE_FMD_CAF_THR_SHIFT 0
  263. #define VPE_DEI_FMD_STATUS_R0 0x0630
  264. #define VPE_FMD_CAF_MASK 0x000fffff
  265. #define VPE_FMD_CAF_SHIFT 0
  266. #define VPE_FMD_RESET (1 << 24)
  267. #define VPE_DEI_FMD_STATUS_R1 0x0634
  268. #define VPE_FMD_FIELD_DIFF_MASK 0x0fffffff
  269. #define VPE_FMD_FIELD_DIFF_SHIFT 0
  270. #define VPE_DEI_FMD_STATUS_R2 0x0638
  271. #define VPE_FMD_FRAME_DIFF_MASK 0x000fffff
  272. #define VPE_FMD_FRAME_DIFF_SHIFT 0
  273. #endif