vdin_regs.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. /*
  2. * VDIN register bit-field definition
  3. * Sorted by the appearing order of registers in am_regs.h.
  4. *
  5. * Author: Lin Xu <lin.xu@amlogic.com>
  6. *
  7. * Copyright (C) 2010 Amlogic Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef __VDIN_REGS_H
  14. #define __VDIN_REGS_H
  15. //#define VDIN_SCALE_COEF_IDX 0x1200
  16. //#define VDIN_SCALE_COEF 0x1201
  17. //#define VDIN_COM_CTRL0 0x1202
  18. /* used by other modules,indicates that MPEG input.
  19. 0: mpeg source to NR directly,
  20. 1: mpeg source pass through here */
  21. #define MPEG_TO_VDIN_SEL_BIT 31
  22. #define MPEG_TO_VDIN_SEL_WID 1
  23. /* indicates MPEG field ID,written by software.
  24. 0: EVEN FIELD 1: ODD FIELD */
  25. #define MPEG_FLD_BIT 30
  26. #define MPEG_FLD_WID 1
  27. #if defined(CONFIG_ARCH_MESON)
  28. #define FORCE_GO_FLD_BIT 29 // for test
  29. #define FORCE_GO_FLD_WID 1 // pulse signal
  30. #define FORCE_GO_LN_BIT 28 // for test
  31. #define FORCE_GO_LN_WID 1 // pulse signal
  32. #endif
  33. #if defined(CONFIG_ARCH_MESON2)
  34. #define MPEG_GO_FLD_EN_BIT 27 // enable external MPEG Go_field (VS)
  35. #define MPEG_GO_FLD_EN_WID 1
  36. #endif
  37. /* vdin read enable after hold lines counting from delayed Go-field (VS). */
  38. #define HOLD_LN_BIT 20
  39. #define HOLD_LN_WID 7
  40. #define DLY_GO_FLD_EN_BIT 19
  41. #define DLY_GO_FLD_EN_WID 1
  42. #define DLY_GO_FLD_LN_NUM_BIT 12
  43. #define DLY_GO_FLD_LN_NUM_WID 7 // delay go field lines
  44. /* 00: component0_in 01: component1_in 10: component2_in */
  45. #define COMP2_OUT_SWT_BIT 10
  46. #define COMP2_OUT_SWT_WID 2
  47. /* 00: component0_in 01: component1_in 10: component2_in */
  48. #define COMP1_OUT_SWT_BIT 8
  49. #define COMP1_OUT_SWT_WID 2
  50. /* 00: component0_in 01: component1_in 10: component2_in */
  51. #define COMP0_OUT_SWT_BIT 6
  52. #define COMP0_OUT_SWT_WID 2
  53. #if defined(CONFIG_ARCH_MESON2)
  54. #define INPUT_WIN_SEL_EN_BIT 5
  55. #define INPUT_WIN_SEL_EN_WID 1
  56. #endif
  57. /* 0: no data input 1: common data input */
  58. #define COMMON_DATA_IN_EN_BIT 4
  59. #define COMMON_DATA_IN_EN_WID 1
  60. /* 1: MPEG, 2: 656, 3: TVFE, 4: CVD2, 5: HDMI_Rx,6: DVIN otherwise: NULL */
  61. #define VDIN_SEL_BIT 0
  62. #define VDIN_SEL_WID 4
  63. //#define VDIN_ACTIVE_MAX_PIX_CNT_STATUS 0x1203
  64. /* ~field_hold & prehsc input active max pixel every line output of window */
  65. #define ACTIVE_MAX_PIX_CNT_BIT 16
  66. #define ACTIVE_MAX_PIX_CNT_WID 13
  67. #define ACTIVE_MAX_PIX_CNT_SDW_BIT 0 // latch by go_field
  68. #define ACTIVE_MAX_PIX_CNT_SDW_WID 13
  69. //#define VDIN_LCNT_STATUS 0x1204
  70. /* line count by force_go_line |sel_go_line :output of decimate */
  71. #define GO_LN_CNT_BIT 16
  72. #define GO_LN_CNT_WID 13
  73. /* line count prehsc input active max pixel every active line output of window */
  74. #define ACTIVE_LN_CNT_BIT 0
  75. #define ACTIVE_LN_CNT_WID 13
  76. //#define VDIN_COM_STATUS0 0x1205 S
  77. #define LFIFO_BUF_CNT_BIT 3
  78. #define LFIFO_BUF_CNT_WID 10 //wren + read -
  79. #define DIRECT_DONE_STATUS_BIT 2
  80. #define DIRECT_DONE_STATUS_WID 1 // direct_done_clr_bit & reg_wpluse
  81. #define NR_DONE_STATUS_BIT 1
  82. #define NR_DONE_STATUS_WID 1 // nr_done_clr_bit & reg_wpluse
  83. #define VDIN_FLD_EVEN_BIT 0
  84. #define VDIN_FLD_EVEN_WID 1
  85. //#define VDIN_COM_STATUS1 0x1206
  86. #define FIFO4_OVFL_BIT 31
  87. #define FIFO4_OVFL_WID 1
  88. #define ASFIFO4_CNT_BIT 24
  89. #define ASFIFO4_CNT_WID 6
  90. #define FIFO3_OVFL_BIT 23
  91. #define FIFO3_OVFL_WID 1
  92. #define ASFIFO3_CNT_BIT 16
  93. #define ASFIFO3_CNT_WID 6
  94. #define FIFO2_OVFL_BIT 15
  95. #define FIFO2_OVFL_WID 1
  96. #define ASFIFO2_CNT_BIT 8
  97. #define ASFIFO2_CNT_WID 6
  98. #define FIFO1_OVFL_BIT 7
  99. #define FIFO1_OVFL_WID 1
  100. #define ASFIFO1_CNT_BIT 0
  101. #define ASFIFO1_CNT_WID 6
  102. //#define VDIN_LCNT_SHADOW_STATUS 0x1207
  103. #define GO_LN_CNT_SDW_BIT 16
  104. #define GO_LN_CNT_SDW_WID 13 // latch by go_field
  105. #define ACTIVE_LN_CNT_SDW_BIT 0
  106. #define ACTIVE_LN_CNT_SDW_WID 13 // latch by go_field
  107. //#define VDIN_ASFIFO_CTRL0 0x1208
  108. #define ASFIFO2_DE_EN_BIT 23
  109. #define ASFIFO2_DE_EN_WID 1
  110. #define ASFIFO2_GO_FLD_EN_BIT 22
  111. #define ASFIFO2_GO_FLD_EN_WID 1
  112. #define ASFIFO2_GO_LN_EN_BIT 21
  113. #define ASFIFO2_GO_LN_EN_WID 1
  114. #define ASFIFO2_NEG_ACTIVE_IN_VS_BIT 20
  115. #define ASFIFO2_NEG_ACTIVE_IN_VS_WID 1
  116. #define ASFIFO2_NEG_ACTIVE_IN_HS_BIT 19
  117. #define ASFIFO2_NEG_ACTIVE_IN_HS_WID 1
  118. #define ASFIFO2_VS_SOFT_RST_FIFO_EN_BIT 18
  119. #define ASFIFO2_VS_SOFT_RST_FIFO_EN_WID 1
  120. #define ASFIFO2_OVFL_STATUS_CLR_BIT 17
  121. #define ASFIFO2_OVFL_STATUS_CLR_WID 1
  122. #define ASFIFO2_SOFT_RST_BIT 16
  123. #define ASFIFO2_SOFT_RST_WID 1 // write 1 & then 0 to reset
  124. #define ASFIFO1_DE_EN_BIT 7
  125. #define ASFIFO1_DE_EN_WID 1
  126. #define ASFIFO1_GO_FLD_EN_BIT 6
  127. #define ASFIFO1_GO_FLD_EN_WID 1
  128. #define ASFIFO1_GO_LN_EN_BIT 5
  129. #define ASFIFO1_GO_LN_EN_WID 1
  130. #define ASFIFO1_NEG_ACTIVE_IN_VS_BIT 4
  131. #define ASFIFO1_NEG_ACTIVE_IN_VS_WID 1
  132. #define ASFIFO1_NEG_ACTIVE_IN_HS_BIT 3
  133. #define ASFIFO1_NEG_ACTIVE_IN_HS_WID 1
  134. #define ASFIFO1_VS_SOFT_RST_FIFO_EN_BIT 2
  135. #define ASFIFO1_VS_SOFT_RST_FIFO_EN_WID 1
  136. #define ASFIFO1_OVFL_STATUS_CLR_BIT 1
  137. #define ASFIFO1_OVFL_STATUS_CLR_WID 1
  138. #define ASFIFO1_SOFT_RST_BIT 0
  139. #define ASFIFO1_SOFT_RST_WID 1 // write 1 & then 0 to reset
  140. //#define VDIN_ASFIFO_CTRL1 0x1209
  141. #define ASFIFO4_DE_EN_BIT 23
  142. #define ASFIFO4_DE_EN_WID 1
  143. #define ASFIFO4_GO_FLD_EN_BIT 22
  144. #define ASFIFO4_GO_FLD_EN_WID 1
  145. #define ASFIFO4_GO_LN_EN_BIT 21
  146. #define ASFIFO4_GO_LN_EN_WID 1
  147. #define ASFIFO4_NEG_ACTIVE_IN_VS_BIT 20
  148. #define ASFIFO4_NEG_ACTIVE_IN_VS_WID 1
  149. #define ASFIFO4_NEG_ACTIVE_IN_HS_BIT 19
  150. #define ASFIFO4_NEG_ACTIVE_IN_HS_WID 1
  151. #define ASFIFO4_VS_SOFT_RST_FIFO_EN_BIT 18
  152. #define ASFIFO4_VS_SOFT_RST_FIFO_EN_WID 1
  153. #define ASFIFO4_OVFL_STATUS_CLR_BIT 17
  154. #define ASFIFO4_OVFL_STATUS_CLR_WID 1
  155. #define ASFIFO4_SOFT_RST_BIT 16
  156. #define ASFIFO4_SOFT_RST_WID 1 // write 1 & then 0 to reset
  157. #define ASFIFO3_DE_EN_BIT 7
  158. #define ASFIFO3_DE_EN_WID 1
  159. #define ASFIFO3_GO_FLD_EN_BIT 6
  160. #define ASFIFO3_GO_FLD_EN_WID 1
  161. #define ASFIFO3_GO_LN_EN_BIT 5
  162. #define ASFIFO3_GO_LN_EN_WID 1
  163. #define ASFIFO3_NEG_ACTIVE_IN_VS_BIT 4
  164. #define ASFIFO3_NEG_ACTIVE_IN_VS_WID 1
  165. #define ASFIFO3_NEG_ACTIVE_IN_HS_BIT 3
  166. #define ASFIFO3_NEG_ACTIVE_IN_HS_WID 1
  167. #define ASFIFO3_VS_SOFT_RST_FIFO_EN_BIT 2
  168. #define ASFIFO3_VS_SOFT_RST_FIFO_EN_WID 1
  169. #define ASFIFO3_OVFL_STATUS_CLR_BIT 1
  170. #define ASFIFO3_OVFL_STATUS_CLR_WID 1
  171. #define ASFIFO3_SOFT_RST_BIT 0
  172. #define ASFIFO3_SOFT_RST_WID 1 // write 1 & then 0 to reset
  173. //#define VDIN_WIDTHM1I_WIDTHM1O 0x120a
  174. #define WIDTHM1I_BIT 16
  175. #define WIDTHM1I_WID 13
  176. #define WIDTHM1O_BIT 0
  177. #define WIDTHM1O_WID 13
  178. //#define VDIN_SC_MISC_CTRL 0x120b
  179. #define INIT_PIX_IN_PTR_BIT 8
  180. #define INIT_PIX_IN_PTR_WID 7 // signed value for short line output
  181. #define INIT_PIX_IN_PTR_MSK 0x0000007f
  182. #define PRE_HSCL_EN_BIT 7
  183. #define PRE_HSCL_EN_WID 1 // pre-hscaler: 1/2 coarse scale down
  184. #define HSCL_EN_BIT 6
  185. #define HSCL_EN_WID 1 // hscaler: fine scale down
  186. #define SHORT_LN_OUT_EN_BIT 5
  187. #define SHORT_LN_OUT_EN_WID 1
  188. /*when decimation timing located in between 2 input pixels, decimate the nearest one*/
  189. #define HSCL_NEAREST_EN_BIT 4
  190. #define HSCL_NEAREST_EN_WID 1
  191. #define PHASE0_ALWAYS_EN_BIT 3 // Start decimation from phase 0 for each line
  192. #define PHASE0_ALWAYS_EN_WID 1
  193. /* filter pixel buf len (depth), max is 3 in IP design */
  194. #define HSCL_BANK_LEN_BIT 0
  195. #define HSCL_BANK_LEN_WID 3
  196. //#define VDIN_HSC_PHASE_STEP 0x120c
  197. #define HSCL_PHASE_STEP_INT_BIT 24
  198. #define HSCL_PHASE_STEP_INT_WID 5
  199. #define HSCL_PHASE_STEP_FRA_BIT 0
  200. #define HSCL_PHASE_STEP_FRA_WID 24
  201. //#define VDIN_HSC_INI_CTRL 0x120d
  202. /* repeatedly decimation of pixel #0 of each line? */
  203. #define HSCL_RPT_P0_NUM_BIT 29
  204. #define HSCL_RPT_P0_NUM_WID 2
  205. /* if rev>rpt_p0+1, then start decimation upon ini_phase? */
  206. #define HSCL_INI_RCV_NUM_BIT 24
  207. #define HSCL_INI_RCV_NUM_WID 5
  208. /* which one every some pixels is decimated */
  209. #define HSCL_INI_PHASE_BIT 0
  210. #define HSCL_INI_PHASE_WID 24
  211. #if defined(CONFIG_ARCH_MESON2)
  212. //#define VDIN_COM_STATUS2 0x120e
  213. //Read only
  214. #define VDI5_FIFO_OVFL_BIT 7 //vdi5 fifo overflow
  215. #define VDI5_FIFO_OVFL_WID 1
  216. #define VDI5_ASFIFO_CNT_BIT 0 //vdi5_asfifo_cnt
  217. #define VDI5_ASFIFO_CNT_WID 6
  218. #endif
  219. #if defined(CONFIG_ARCH_MESON2)
  220. //#define VDIN_ASFIFO_CTRL2 0x120f
  221. #define ASFIFO_DECIMATION_SYNC_WITH_DE_BIT 25
  222. #define ASFIFO_DECIMATION_SYNC_WITH_DE_WID 1
  223. #define ASFIFO_DECIMATION_DE_EN_BIT 24
  224. #define ASFIFO_DECIMATION_DE_EN_WID 1
  225. #define ASFIFO_DECIMATION_PHASE_BIT 20
  226. #define ASFIFO_DECIMATION_PHASE_WID 4 // which counter value used to decimate
  227. #define ASFIFO_DECIMATION_NUM_BIT 16
  228. #define ASFIFO_DECIMATION_NUM_WID 4 // 0: not decimation, 1: decimation 2, 2: decimation 3 ...
  229. #define ASFIFO5_DE_EN_BIT 7
  230. #define ASFIFO5_DE_EN_WID 1
  231. #define ASFIFO5_GO_FLD_EN_BIT 6
  232. #define ASFIFO5_GO_FLD_EN_WID 1
  233. #define ASFIFO5_GO_LN_EN_BIT 5
  234. #define ASFIFO5_GO_LN_EN_WID 1
  235. #define ASFIFO5_NEG_ACTIVE_IN_VS_BIT 4
  236. #define ASFIFO5_NEG_ACTIVE_IN_VS_WID 1
  237. #define ASFIFO5_NEG_ACTIVE_IN_HS_BIT 3
  238. #define ASFIFO5_NEG_ACTIVE_IN_HS_WID 1
  239. #define ASFIFO5_VS_SOFT_RST_FIFO_EN_BIT 2
  240. #define ASFIFO5_VS_SOFT_RST_FIFO_EN_WID 1
  241. #define ASFIFO5_OVFL_STATUS_CLR_BIT 1
  242. #define ASFIFO5_OVFL_STATUS_CLR_WID 1
  243. #define ASFIFO5_SOFT_RST_BIT 0
  244. #define ASFIFO5_SOFT_RST_WID 1 // write 1 & then 0 to reset
  245. #endif
  246. //#define VDIN_MATRIX_CTRL 0x1210
  247. #define VDIN_MATRIX_EN_BIT 0
  248. #define VDIN_MATRIX_EN_WID 1 // post conversion matrix
  249. //#define VDIN_MATRIX_COEF00_01 0x1211
  250. #define MATRIX_C00_BIT 16
  251. #define MATRIX_C00_WID 13 // s2.10
  252. #define MATRIX_C01_BIT 0
  253. #define MATRIX_C01_WID 13 // s2.10
  254. //#define VDIN_MATRIX_COEF02_10 0x1212
  255. #define MATRIX_C02_BIT 16
  256. #define MATRIX_C02_WID 13 // s2.10
  257. #define MATRIX_C10_BIT 0
  258. #define MATRIX_C10_WID 13 // s2.10
  259. //#define VDIN_MATRIX_COEF11_12 0x1213
  260. #define MATRIX_C11_BIT 16
  261. #define MATRIX_C11_WID 13 // s2.10
  262. #define MATRIX_C12_BIT 0
  263. #define MATRIX_C12_WID 13 // s2.10
  264. //#define VDIN_MATRIX_COEF20_21 0x1214
  265. #define MATRIX_C20_BIT 16
  266. #define MATRIX_C20_WID 13 // s2.10
  267. #define MATRIX_C21_BIT 0
  268. #define MATRIX_C21_WID 13 // s2.10
  269. //#define VDIN_MATRIX_COEF22 0x1215
  270. #define MATRIX_C22_BIT 0
  271. #define MATRIX_C22_WID 13 // s2.10
  272. //#define VDIN_MATRIX_OFFSET0_1 0x1216
  273. #define MATRIX_OFFSET0_BIT 16
  274. #define MATRIX_OFFSET0_WID 11 // s8.2
  275. #define MATRIX_OFFSET1_BIT 0
  276. #define MATRIX_OFFSET1_WID 11 // s8.2
  277. //#define VDIN_MATRIX_OFFSET2 0x1217
  278. #define MATRIX_OFFSET2_BIT 0
  279. #define MATRIX_OFFSET2_WID 11 // s8.2
  280. //#define VDIN_MATRIX_PRE_OFFSET0_1 0x1218
  281. #define MATRIX_PRE_OFFSET0_BIT 16
  282. #define MATRIX_PRE_OFFSET0_WID 11 // s8.2
  283. #define MATRIX_PRE_OFFSET1_BIT 0
  284. #define MATRIX_PRE_OFFSET1_WID 11 // s8.2
  285. //#define VDIN_MATRIX_PRE_OFFSET2 0x1219
  286. #define MATRIX_PRE_OFFSET2_BIT 0
  287. #define MATRIX_PRE_OFFSET2_WID 11 // s8.2
  288. //#define VDIN_LFIFO_CTRL 0x121a
  289. #define LFIFO_BUF_SIZE_BIT 0
  290. #define LFIFO_BUF_SIZE_WID 12
  291. //#define VDIN_COM_GCLK_CTRL 0x121b
  292. #define COM_GCLK_BLKBAR_BIT 14
  293. #define COM_GCLK_BLKBAR_WID 2 // 00: auto, 01: off, 1x: on
  294. #define COM_GCLK_HIST_BIT 12
  295. #define COM_GCLK_HIST_WID 2 // 00: auto, 01: off, 1x: on
  296. #define COM_GCLK_LFIFO_BIT 10
  297. #define COM_GCLK_LFIFO_WID 2 // 00: auto, 01: off, 1x: on
  298. #define COM_GCLK_MATRIX_BIT 8
  299. #define COM_GCLK_MATRIX_WID 2 // 00: auto, 01: off, 1x: on
  300. #define COM_GCLK_HSCL_BIT 6
  301. #define COM_GCLK_HSCL_WID 2 // 00: auto, 01: off, 1x: on
  302. #define COM_GCLK_PRE_HSCL_BIT 4
  303. #define COM_GCLK_PRE_HSCL_WID 2 // 00: auto, 01: off, 1x: on
  304. #define COM_GCLK_TOP_BIT 2
  305. #define COM_GCLK_TOP_WID 2 // 00: auto, 01: off, 1x: on
  306. /* Caution !!! never turn it off, otherwise no way to wake up VDIN unless power reset */
  307. #define COM_GCLK_REG_BIT 0
  308. #define COM_GCLK_REG_WID 1 // 0: auto, 1: off. Caution !!!
  309. #if defined(CONFIG_ARCH_MESON2)
  310. //#define VDIN_INTF_WIDTHM1 0x121c
  311. #define VDIN_INTF_WIDTHM1_BIT 0
  312. #define VDIN_INTF_WIDTHM1_WID 13 // before the cut window function, after the de decimation function
  313. #endif
  314. //#define VDIN_WR_CTRL 0x1220
  315. /* vdin do not need these registers*/
  316. //#define WR_RESPONSE_CNT_CLR_BIT 28
  317. //#define WR_RESPONSE_CNT_CLR_WID 1
  318. //#define EOL_SEL_BIT 27
  319. //#define EOL_SEL_WID 1
  320. //#define VCP_NR_EN_BIT 26
  321. //#define VCP_NR_EN_WID 1
  322. //#define VCP_WR_EN_BIT 25
  323. //#define VCP_WR_EN_WID 1
  324. //#define VCP_IN_EN_BIT 24
  325. //#define VCP_IN_EN_WID 1
  326. #define WR_OUT_CTRL_BIT 24
  327. #define WR_OUT_CTRL_WID 8 //directly send out
  328. #define FRAME_SOFT_RST_EN_BIT 23
  329. #define FRAME_SOFT_RST_EN_WID 1
  330. #define LFIFO_SOFT_RST_EN_BIT 22 // reset LFIFO on VS (Go_field)
  331. #define LFIFO_SOFT_RST_EN_WID 1
  332. #define DIRECT_DONE_CLR_BIT 21 // used by other modules
  333. #define DIRECT_DONE_CLR_WID 1
  334. #define NR_DONE_CLR_BIT 20 // used by other modules
  335. #define NR_DONE_CLR_WID 1
  336. #define WR_FMT_BIT 12
  337. #define WR_FMT_WID 1 // 0: 422, 1: 444 directly send out
  338. /* vdin_wr_canvas = vdin_wr_canvas_dbuf_en ? wr_canvas_shadow :wr_canvas; */
  339. #define WR_CANVAS_BUF_EN_BIT 11 //shadow is latch by go_field
  340. #define WR_CANVAS_BUF_EN_WID 1
  341. #define WR_REQ_URGENT_BIT 9
  342. #define WR_REQ_URGENT_WID 1 // directly send out
  343. #define WR_REQ_EN_BIT 8
  344. #define WR_REQ_EN_WID 1 // directly send out
  345. #define WR_CANVAS_BIT 0
  346. #define WR_CANVAS_WID 8
  347. //#define VDIN_WR_H_START_END 0x1221
  348. #define WR_HSTART_BIT 16
  349. #define WR_HSTART_WID 12 // directly send out
  350. #define WR_HEND_BIT 0
  351. #define WR_HEND_WID 12 // directly send out
  352. //#define VDIN_WR_V_START_END 0x1222
  353. #define WR_VSTART_BIT 16
  354. #define WR_VSTART_WID 12 // directly send out
  355. #define WR_VEND_BIT 0
  356. #define WR_VEND_WID 12 // directly send out
  357. //#define VDIN_HIST_CTRL 0x1230
  358. /* the total pixels = VDIN_HISTXX*(2^(VDIN_HIST_POW+3)) */
  359. #define HIST_POW_BIT 5
  360. #define HIST_POW_WID 2
  361. /* Histgram source: 00: MAT_OUT, 01: HSC_OUT, 1X: PREHSC_IN */
  362. #define HIST_MUX_BIT 2
  363. #define HIST_MUX_WID 2
  364. /* Histgram range: 0: full picture, 1: histgram window defined by VDIN_HIST_H_START_END & VDIN_HIST_V_START_END */
  365. #define HIST_WIN_EN_BIT 1
  366. #define HIST_WIN_EN_WID 1
  367. /* Histgram readback: 0: disable, 1: enable */
  368. #define HIST_RD_EN_BIT 0
  369. #define HIST_RD_EN_WID 1
  370. //#define VDIN_HIST_H_START_END 0x1231
  371. #define HIST_HSTART_BIT 16
  372. #define HIST_HSTART_WID 13
  373. #define HIST_HEND_BIT 0
  374. #define HIST_HEND_WID 13
  375. //#define VDIN_HIST_V_START_END 0x1232
  376. #define HIST_VSTART_BIT 16
  377. #define HIST_VSTART_WID 13
  378. #define HIST_VEND_BIT 0
  379. #define HIST_VEND_WID 13
  380. //#define VDIN_HIST_MAX_MIN 0x1233
  381. #define HIST_MAX_BIT 8
  382. #define HIST_MAX_WID 8
  383. #define HIST_MIN_BIT 0
  384. #define HIST_MIN_WID 8
  385. //#define VDIN_HIST_SPL_VAL 0x1234
  386. #define HIST_LUMA_SUM_BIT 0
  387. #define HIST_LUMA_SUM_WID 32
  388. //#define VDIN_HIST_SPL_PIX_CNT 0x1235
  389. #define HIST_PIX_CNT_BIT 0
  390. #define HIST_PIX_CNT_WID 22 // the total calculated pixels
  391. //#define VDIN_HIST_CHROMA_SUM 0x1236
  392. #define HIST_CHROMA_SUM_BIT 0
  393. #define HIST_CHROMA_SUM_WID 32 // the total chroma value
  394. //#define VDIN_DNLP_HIST00 0x1237
  395. #define HIST_ON_BIN_01_BIT 16
  396. #define HIST_ON_BIN_01_WID 16
  397. #define HIST_ON_BIN_00_BIT 0
  398. #define HIST_ON_BIN_00_WID 16
  399. //#define VDIN_DNLP_HIST01 0x1238
  400. #define HIST_ON_BIN_03_BIT 16
  401. #define HIST_ON_BIN_03_WID 16
  402. #define HIST_ON_BIN_02_BIT 0
  403. #define HIST_ON_BIN_02_WID 16
  404. //#define VDIN_DNLP_HIST02 0x1239
  405. #define HIST_ON_BIN_05_BIT 16
  406. #define HIST_ON_BIN_05_WID 16
  407. #define HIST_ON_BIN_04_BIT 0
  408. #define HIST_ON_BIN_04_WID 16
  409. //#define VDIN_DNLP_HIST03 0x123a
  410. #define HIST_ON_BIN_07_BIT 16
  411. #define HIST_ON_BIN_07_WID 16
  412. #define HIST_ON_BIN_06_BIT 0
  413. #define HIST_ON_BIN_06_WID 16
  414. //#define VDIN_DNLP_HIST04 0x123b
  415. #define HIST_ON_BIN_09_BIT 16
  416. #define HIST_ON_BIN_09_WID 16
  417. #define HIST_ON_BIN_08_BIT 0
  418. #define HIST_ON_BIN_08_WID 16
  419. //#define VDIN_DNLP_HIST05 0x123c
  420. #define HIST_ON_BIN_11_BIT 16
  421. #define HIST_ON_BIN_11_WID 16
  422. #define HIST_ON_BIN_10_BIT 0
  423. #define HIST_ON_BIN_10_WID 16
  424. //#define VDIN_DNLP_HIST06 0x123d
  425. #define HIST_ON_BIN_13_BIT 16
  426. #define HIST_ON_BIN_13_WID 16
  427. #define HIST_ON_BIN_12_BIT 0
  428. #define HIST_ON_BIN_12_WID 16
  429. //#define VDIN_DNLP_HIST07 0x123e
  430. #define HIST_ON_BIN_15_BIT 16
  431. #define HIST_ON_BIN_15_WID 16
  432. #define HIST_ON_BIN_14_BIT 0
  433. #define HIST_ON_BIN_14_WID 16
  434. //#define VDIN_DNLP_HIST08 0x123f
  435. #define HIST_ON_BIN_17_BIT 16
  436. #define HIST_ON_BIN_17_WID 16
  437. #define HIST_ON_BIN_16_BIT 0
  438. #define HIST_ON_BIN_16_WID 16
  439. //#define VDIN_DNLP_HIST09 0x1240
  440. #define HIST_ON_BIN_19_BIT 16
  441. #define HIST_ON_BIN_19_WID 16
  442. #define HIST_ON_BIN_18_BIT 0
  443. #define HIST_ON_BIN_18_WID 16
  444. //#define VDIN_DNLP_HIST10 0x1241
  445. #define HIST_ON_BIN_21_BIT 16
  446. #define HIST_ON_BIN_21_WID 16
  447. #define HIST_ON_BIN_20_BIT 0
  448. #define HIST_ON_BIN_20_WID 16
  449. //#define VDIN_DNLP_HIST11 0x1242
  450. #define HIST_ON_BIN_23_BIT 16
  451. #define HIST_ON_BIN_23_WID 16
  452. #define HIST_ON_BIN_22_BIT 0
  453. #define HIST_ON_BIN_22_WID 16
  454. //#define VDIN_DNLP_HIST12 0x1243
  455. #define HIST_ON_BIN_25_BIT 16
  456. #define HIST_ON_BIN_25_WID 16
  457. #define HIST_ON_BIN_24_BIT 0
  458. #define HIST_ON_BIN_24_WID 16
  459. //#define VDIN_DNLP_HIST13 0x1244
  460. #define HIST_ON_BIN_27_BIT 16
  461. #define HIST_ON_BIN_27_WID 16
  462. #define HIST_ON_BIN_26_BIT 0
  463. #define HIST_ON_BIN_26_WID 16
  464. //#define VDIN_DNLP_HIST14 0x1245
  465. #define HIST_ON_BIN_29_BIT 16
  466. #define HIST_ON_BIN_29_WID 16
  467. #define HIST_ON_BIN_28_BIT 0
  468. #define HIST_ON_BIN_28_WID 16
  469. //#define VDIN_DNLP_HIST15 0x1246
  470. #define HIST_ON_BIN_31_BIT 16
  471. #define HIST_ON_BIN_31_WID 16
  472. #define HIST_ON_BIN_30_BIT 0
  473. #define HIST_ON_BIN_30_WID 16
  474. //#define VDIN_DNLP_HIST16 0x1247
  475. #define HIST_ON_BIN_33_BIT 16
  476. #define HIST_ON_BIN_33_WID 16
  477. #define HIST_ON_BIN_32_BIT 0
  478. #define HIST_ON_BIN_32_WID 16
  479. //#define VDIN_DNLP_HIST17 0x1248
  480. #define HIST_ON_BIN_35_BIT 16
  481. #define HIST_ON_BIN_35_WID 16
  482. #define HIST_ON_BIN_34_BIT 0
  483. #define HIST_ON_BIN_34_WID 16
  484. //#define VDIN_DNLP_HIST18 0x1249
  485. #define HIST_ON_BIN_37_BIT 16
  486. #define HIST_ON_BIN_37_WID 16
  487. #define HIST_ON_BIN_36_BIT 0
  488. #define HIST_ON_BIN_36_WID 16
  489. //#define VDIN_DNLP_HIST19 0x124a
  490. #define HIST_ON_BIN_39_BIT 16
  491. #define HIST_ON_BIN_39_WID 16
  492. #define HIST_ON_BIN_38_BIT 0
  493. #define HIST_ON_BIN_38_WID 16
  494. //#define VDIN_DNLP_HIST20 0x124b
  495. #define HIST_ON_BIN_41_BIT 16
  496. #define HIST_ON_BIN_41_WID 16
  497. #define HIST_ON_BIN_40_BIT 0
  498. #define HIST_ON_BIN_40_WID 16
  499. //#define VDIN_DNLP_HIST21 0x124c
  500. #define HIST_ON_BIN_43_BIT 16
  501. #define HIST_ON_BIN_43_WID 16
  502. #define HIST_ON_BIN_42_BIT 0
  503. #define HIST_ON_BIN_42_WID 16
  504. //#define VDIN_DNLP_HIST22 0x124d
  505. #define HIST_ON_BIN_45_BIT 16
  506. #define HIST_ON_BIN_45_WID 16
  507. #define HIST_ON_BIN_44_BIT 0
  508. #define HIST_ON_BIN_44_WID 16
  509. //#define VDIN_DNLP_HIST23 0x124e
  510. #define HIST_ON_BIN_47_BIT 16
  511. #define HIST_ON_BIN_47_WID 16
  512. #define HIST_ON_BIN_46_BIT 0
  513. #define HIST_ON_BIN_46_WID 16
  514. //#define VDIN_DNLP_HIST24 0x124f
  515. #define HIST_ON_BIN_49_BIT 16
  516. #define HIST_ON_BIN_49_WID 16
  517. #define HIST_ON_BIN_48_BIT 0
  518. #define HIST_ON_BIN_48_WID 16
  519. //#define VDIN_DNLP_HIST25 0x1250
  520. #define HIST_ON_BIN_51_BIT 16
  521. #define HIST_ON_BIN_51_WID 16
  522. #define HIST_ON_BIN_50_BIT 0
  523. #define HIST_ON_BIN_50_WID 16
  524. //#define VDIN_DNLP_HIST26 0x1251
  525. #define HIST_ON_BIN_53_BIT 16
  526. #define HIST_ON_BIN_53_WID 16
  527. #define HIST_ON_BIN_52_BIT 0
  528. #define HIST_ON_BIN_52_WID 16
  529. //#define VDIN_DNLP_HIST27 0x1252
  530. #define HIST_ON_BIN_55_BIT 16
  531. #define HIST_ON_BIN_55_WID 16
  532. #define HIST_ON_BIN_54_BIT 0
  533. #define HIST_ON_BIN_54_WID 16
  534. //#define VDIN_DNLP_HIST28 0x1253
  535. #define HIST_ON_BIN_57_BIT 16
  536. #define HIST_ON_BIN_57_WID 16
  537. #define HIST_ON_BIN_56_BIT 0
  538. #define HIST_ON_BIN_56_WID 16
  539. //#define VDIN_DNLP_HIST29 0x1254
  540. #define HIST_ON_BIN_59_BIT 16
  541. #define HIST_ON_BIN_59_WID 16
  542. #define HIST_ON_BIN_58_BIT 0
  543. #define HIST_ON_BIN_58_WID 16
  544. //#define VDIN_DNLP_HIST30 0x1255
  545. #define HIST_ON_BIN_61_BIT 16
  546. #define HIST_ON_BIN_61_WID 16
  547. #define HIST_ON_BIN_60_BIT 0
  548. #define HIST_ON_BIN_60_WID 16
  549. //#define VDIN_DNLP_HIST31 0x1256
  550. #define HIST_ON_BIN_63_BIT 16
  551. #define HIST_ON_BIN_63_WID 16
  552. #define HIST_ON_BIN_62_BIT 0
  553. #define HIST_ON_BIN_62_WID 16
  554. #if defined(CONFIG_ARCH_MESON2)
  555. //#define VDIN_MEAS_CTRL0 0x125a
  556. #define MEAS_RST_BIT 18 // write 1 & then 0 to reset
  557. #define MEAS_RST_WID 1
  558. #define MEAS_WIDEN_HS_VS_EN_BIT 17 //make hs ,vs at lest 12 pulse wide
  559. #define MEAS_WIDEN_HS_VS_EN_WID 1
  560. #define MEAS_VS_TOTAL_CNT_EN_BIT 16 // vsync total counter always accumulating enable
  561. #define MEAS_VS_TOTAL_CNT_EN_WID 1
  562. #define MEAS_HS_VS_SEL_BIT 12 // 0: null, 1: vdi1, 2: vdi2, 3: vdi3, 4:vdi4, 5:vdi5
  563. #define MEAS_HS_VS_SEL_WID 3
  564. #define MEAS_VS_SPAN_BIT 4 // define how many VS span need to measure
  565. #define MEAS_VS_SPAN_WID 8
  566. #define MEAS_HS_INDEX_BIT 0 // select which HS counter/range
  567. #define MEAS_HS_INDEX_WID 3
  568. #endif
  569. #if defined(CONFIG_ARCH_MESON2)
  570. //#define VDIN_MEAS_VS_COUNT_HI 0x125b // read only
  571. #define MEAS_IND_VS_TOTAL_CNT_N_BIT 16 // after every VDIN_MEAS_VS_SPAN number of VS pulses, VDIN_MEAS_IND_TOTAL_COUNT_N++
  572. #define MEAS_IND_VS_TOTAL_CNT_N_WID 4
  573. #define MEAS_VS_TOTAL_CNT_HI_BIT 0 // vsync_total_counter[47:32]
  574. #define MEAS_VS_TOTAL_CNT_HI_WID 16
  575. #endif
  576. #if defined(CONFIG_ARCH_MESON2)
  577. //#define VDIN_MEAS_VS_COUNT_LO 0x125c // read only
  578. #define MEAS_VS_TOTAL_CNT_LO_BIT 0 // vsync_total_counter[31:0]
  579. #define MEAS_VS_TOTAL_CNT_LO_WID 32
  580. #endif
  581. #if defined(CONFIG_ARCH_MESON2)
  582. //#define VDIN_MEAS_HS_RANGE 0x125d // 1st/2nd/3rd/4th hs range according to VDIN_MEAS_HS_INDEX
  583. #define MEAS_HS_RANGE_CNT_START_BIT 16
  584. #define MEAS_HS_RANGE_CNT_START_WID 13
  585. #define MEAS_HS_RANGE_CNT_END_BIT 0
  586. #define MEAS_HS_RANGE_CNT_END_WID 13
  587. #endif
  588. #if defined(CONFIG_ARCH_MESON2)
  589. //#define VDIN_MEAS_HS_COUNT 0x125e // read only
  590. #define MEAS_HS_CNT_BIT 0 // hs count as per 1st/2nd/3rd/4th hs range according to VDIN_MEAS_HS_INDEX
  591. #define MEAS_HS_CNT_WID 24
  592. #endif
  593. #if defined(CONFIG_ARCH_MESON2)
  594. //#define VDIN_BLKBAR_CTRL1 0x125f
  595. #define BLKBAR_WHITE_EN_BIT 8
  596. #define BLKBAR_WHITE_EN_WID 1
  597. #define BLKBAR_WHITE_LVL_BIT 0
  598. #define BLKBAR_WHITE_LVL_WID 8
  599. #endif
  600. //#define VDIN_BLKBAR_CTRL0 0x1260
  601. #if defined(CONFIG_ARCH_MESON)
  602. #define BLKBAR_BLK_LVL_BIT 22
  603. #define BLKBAR_BLK_LVL_WID 10 // threshold to judge a black point
  604. #elif defined(CONFIG_ARCH_MESON2)
  605. #define BLKBAR_BLK_LVL_BIT 24
  606. #define BLKBAR_BLK_LVL_WID 8 // threshold to judge a black point
  607. #endif
  608. #define BLKBAR_H_WIDTH_BIT 8
  609. #define BLKBAR_H_WIDTH_WID 13 // left and right region width
  610. /* select yin or uin or vin to be the valid input */
  611. #define BLKBAR_COMP_SEL_BIT 5
  612. #define BLKBAR_COMP_SEL_WID 3
  613. /* sw statistic of black pixels of each block,
  614. 1: search once, 0: search continuously till the exact edge */
  615. #define BLKBAR_SW_STAT_EN_BIT 4
  616. #define BLKBAR_SW_STAT_EN_WID 1
  617. #define BLKBAR_DET_SOFT_RST_N_BIT 3
  618. #define BLKBAR_DET_SOFT_RST_N_WID 1 // write 0 & then 1 to reset
  619. /* 0: matrix_dout, 1: hscaler_dout, 2/3: pre-hscaler_din */
  620. #define BLKBAR_DIN_SEL_BIT 1
  621. #define BLKBAR_DIN_SEL_WID 2
  622. /* blkbar_din_srdy blkbar_din_rrdy enable */
  623. #define BLKBAR_DET_TOP_EN_BIT 0
  624. #define BLKBAR_DET_TOP_EN_WID 1
  625. //#define VDIN_BLKBAR_H_START_END 0x1261
  626. #define BLKBAR_HSTART_BIT 16
  627. #define BLKBAR_HSTART_WID 13 // Left region start
  628. #define BLKBAR_HEND_BIT 0
  629. #define BLKBAR_HEND_WID 13 // Right region end
  630. //#define VDIN_BLKBAR_V_START_END 0x1262
  631. #define BLKBAR_VSTART_BIT 16
  632. #define BLKBAR_VSTART_WID 13
  633. #define BLKBAR_VEND_BIT 0
  634. #define BLKBAR_VEND_WID 13
  635. //#define VDIN_BLKBAR_CNT_THRESHOLD 0x1263
  636. /* black pixel number threshold to judge whether a block is totally black */
  637. #define BLKBAR_CNT_TH_BIT 0
  638. #define BLKBAR_CNT_TH_WID 20
  639. //#define VDIN_BLKBAR_ROW_TH1_TH2 0x1264
  640. /* white pixel number threshold of black line on top */
  641. #define BLKBAR_ROW_TH1_BIT 16
  642. #define BLKBAR_ROW_TH1_WID 13
  643. /* white pixel number threshold of black line on bottom */
  644. #define BLKBAR_ROW_TH2_BIT 0
  645. #define BLKBAR_ROW_TH2_WID 13
  646. //#define VDIN_BLKBAR_IND_LEFT_START_END 0x1265
  647. #define BLKBAR_LEFT_HSTART_BIT 16
  648. #define BLKBAR_LEFT_HSTART_WID 13
  649. #define BLKBAR_LEFT_HEND_BIT 0
  650. #define BLKBAR_LEFT_HEND_WID 13
  651. //#define VDIN_BLKBAR_IND_RIGHT_START_END 0x1266
  652. #define BLKBAR_RIGHT_HSTART_BIT 16
  653. #define BLKBAR_RIGHT_HSTART_WID 13
  654. #define BLKBAR_RIGHT_HEND_BIT 0
  655. #define BLKBAR_RIGHT_HEND_WID 13
  656. //#define VDIN_BLKBAR_IND_LEFT1_CNT 0x1267
  657. /* Black pixels at left part of the left region */
  658. #define BLKBAR_LEFT1_CNT_BIT 0
  659. #define BLKBAR_LEFT1_CNT_WID 20
  660. //#define VDIN_BLKBAR_IND_LEFT2_CNT 0x1268
  661. /* Black pixels at right part of the left region */
  662. #define BLKBAR_LEFT2_CNT_BIT 0
  663. #define BLKBAR_LEFT2_CNT_WID 20
  664. //#define VDIN_BLKBAR_IND_RIGHT1_CNT 0x1269
  665. /* Black pixels at right part of the left region */
  666. #define BLKBAR_RIGHT1_CNT_BIT 0
  667. #define BLKBAR_RIGHT1_CNT_WID 20
  668. //#define VDIN_BLKBAR_IND_RIGHT2_CNT 0x126a
  669. /* Black pixels at right part of the right region */
  670. #define BLKBAR_RIGHT2_CNT_BIT 0
  671. #define BLKBAR_RIGHT2_CNT_WID 20
  672. //#define VDIN_BLKBAR_STATUS0 0x126b
  673. /* LEFT/RIGHT Black Bar detection done */
  674. #define BLKBAR_DET_DONE_BIT 29
  675. #define BLKBAR_DET_DONE_WID 1
  676. #define BLKBAR_TOP_POS_BIT 16
  677. #define BLKBAR_TOP_POS_WID 13
  678. #define BLKBAR_BTM_POS_BIT 0
  679. #define BLKBAR_BTM_POS_WID 13
  680. //#define VDIN_BLKBAR_STATUS1 0x126c
  681. #define BLKBAR_LEFT_POS_BIT 16
  682. #define BLKBAR_LEFT_POS_WID 13
  683. #define BLKBAR_RIGHT_POS_BIT 0
  684. #define BLKBAR_RIGHT_POS_WID 13
  685. #if defined(CONFIG_ARCH_MESON2)
  686. //#define VDIN_WIN_H_START_END 0x126d
  687. #define INPUT_WIN_H_START_BIT 16
  688. #define INPUT_WIN_H_START_WID 13
  689. #define INPUT_WIN_H_END_BIT 0
  690. #define INPUT_WIN_H_END_WID 13
  691. #endif
  692. #if defined(CONFIG_ARCH_MESON2)
  693. //#define VDIN_WIN_V_START_END 0x126e
  694. #define INPUT_WIN_V_START_BIT 16
  695. #define INPUT_WIN_V_START_WID 13
  696. #define INPUT_WIN_V_END_BIT 0
  697. #define INPUT_WIN_V_END_WID 13
  698. #endif
  699. #endif // __VDIN_REGS_H