isif_regs.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. /*
  2. * Copyright (C) 2008-2009 Texas Instruments Inc
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef _ISIF_REGS_H
  15. #define _ISIF_REGS_H
  16. /* ISIF registers relative offsets */
  17. #define SYNCEN 0x00
  18. #define MODESET 0x04
  19. #define HDW 0x08
  20. #define VDW 0x0c
  21. #define PPLN 0x10
  22. #define LPFR 0x14
  23. #define SPH 0x18
  24. #define LNH 0x1c
  25. #define SLV0 0x20
  26. #define SLV1 0x24
  27. #define LNV 0x28
  28. #define CULH 0x2c
  29. #define CULV 0x30
  30. #define HSIZE 0x34
  31. #define SDOFST 0x38
  32. #define CADU 0x3c
  33. #define CADL 0x40
  34. #define LINCFG0 0x44
  35. #define LINCFG1 0x48
  36. #define CCOLP 0x4c
  37. #define CRGAIN 0x50
  38. #define CGRGAIN 0x54
  39. #define CGBGAIN 0x58
  40. #define CBGAIN 0x5c
  41. #define COFSTA 0x60
  42. #define FLSHCFG0 0x64
  43. #define FLSHCFG1 0x68
  44. #define FLSHCFG2 0x6c
  45. #define VDINT0 0x70
  46. #define VDINT1 0x74
  47. #define VDINT2 0x78
  48. #define MISC 0x7c
  49. #define CGAMMAWD 0x80
  50. #define REC656IF 0x84
  51. #define CCDCFG 0x88
  52. /*****************************************************
  53. * Defect Correction registers
  54. *****************************************************/
  55. #define DFCCTL 0x8c
  56. #define VDFSATLV 0x90
  57. #define DFCMEMCTL 0x94
  58. #define DFCMEM0 0x98
  59. #define DFCMEM1 0x9c
  60. #define DFCMEM2 0xa0
  61. #define DFCMEM3 0xa4
  62. #define DFCMEM4 0xa8
  63. /****************************************************
  64. * Black Clamp registers
  65. ****************************************************/
  66. #define CLAMPCFG 0xac
  67. #define CLDCOFST 0xb0
  68. #define CLSV 0xb4
  69. #define CLHWIN0 0xb8
  70. #define CLHWIN1 0xbc
  71. #define CLHWIN2 0xc0
  72. #define CLVRV 0xc4
  73. #define CLVWIN0 0xc8
  74. #define CLVWIN1 0xcc
  75. #define CLVWIN2 0xd0
  76. #define CLVWIN3 0xd4
  77. /****************************************************
  78. * Lense Shading Correction
  79. ****************************************************/
  80. #define DATAHOFST 0xd8
  81. #define DATAVOFST 0xdc
  82. #define LSCHVAL 0xe0
  83. #define LSCVVAL 0xe4
  84. #define TWODLSCCFG 0xe8
  85. #define TWODLSCOFST 0xec
  86. #define TWODLSCINI 0xf0
  87. #define TWODLSCGRBU 0xf4
  88. #define TWODLSCGRBL 0xf8
  89. #define TWODLSCGROF 0xfc
  90. #define TWODLSCORBU 0x100
  91. #define TWODLSCORBL 0x104
  92. #define TWODLSCOROF 0x108
  93. #define TWODLSCIRQEN 0x10c
  94. #define TWODLSCIRQST 0x110
  95. /****************************************************
  96. * Data formatter
  97. ****************************************************/
  98. #define FMTCFG 0x114
  99. #define FMTPLEN 0x118
  100. #define FMTSPH 0x11c
  101. #define FMTLNH 0x120
  102. #define FMTSLV 0x124
  103. #define FMTLNV 0x128
  104. #define FMTRLEN 0x12c
  105. #define FMTHCNT 0x130
  106. #define FMTAPTR_BASE 0x134
  107. /* Below macro for addresses FMTAPTR0 - FMTAPTR15 */
  108. #define FMTAPTR(i) (FMTAPTR_BASE + (i * 4))
  109. #define FMTPGMVF0 0x174
  110. #define FMTPGMVF1 0x178
  111. #define FMTPGMAPU0 0x17c
  112. #define FMTPGMAPU1 0x180
  113. #define FMTPGMAPS0 0x184
  114. #define FMTPGMAPS1 0x188
  115. #define FMTPGMAPS2 0x18c
  116. #define FMTPGMAPS3 0x190
  117. #define FMTPGMAPS4 0x194
  118. #define FMTPGMAPS5 0x198
  119. #define FMTPGMAPS6 0x19c
  120. #define FMTPGMAPS7 0x1a0
  121. /************************************************
  122. * Color Space Converter
  123. ************************************************/
  124. #define CSCCTL 0x1a4
  125. #define CSCM0 0x1a8
  126. #define CSCM1 0x1ac
  127. #define CSCM2 0x1b0
  128. #define CSCM3 0x1b4
  129. #define CSCM4 0x1b8
  130. #define CSCM5 0x1bc
  131. #define CSCM6 0x1c0
  132. #define CSCM7 0x1c4
  133. #define OBWIN0 0x1c8
  134. #define OBWIN1 0x1cc
  135. #define OBWIN2 0x1d0
  136. #define OBWIN3 0x1d4
  137. #define OBVAL0 0x1d8
  138. #define OBVAL1 0x1dc
  139. #define OBVAL2 0x1e0
  140. #define OBVAL3 0x1e4
  141. #define OBVAL4 0x1e8
  142. #define OBVAL5 0x1ec
  143. #define OBVAL6 0x1f0
  144. #define OBVAL7 0x1f4
  145. #define CLKCTL 0x1f8
  146. /* Masks & Shifts below */
  147. #define START_PX_HOR_MASK 0x7FFF
  148. #define NUM_PX_HOR_MASK 0x7FFF
  149. #define START_VER_ONE_MASK 0x7FFF
  150. #define START_VER_TWO_MASK 0x7FFF
  151. #define NUM_LINES_VER 0x7FFF
  152. /* gain - offset masks */
  153. #define GAIN_INTEGER_SHIFT 9
  154. #define OFFSET_MASK 0xFFF
  155. #define GAIN_SDRAM_EN_SHIFT 12
  156. #define GAIN_IPIPE_EN_SHIFT 13
  157. #define GAIN_H3A_EN_SHIFT 14
  158. #define OFST_SDRAM_EN_SHIFT 8
  159. #define OFST_IPIPE_EN_SHIFT 9
  160. #define OFST_H3A_EN_SHIFT 10
  161. #define GAIN_OFFSET_EN_MASK 0x7700
  162. /* Culling */
  163. #define CULL_PAT_EVEN_LINE_SHIFT 8
  164. /* CCDCFG register */
  165. #define ISIF_YCINSWP_RAW (0x00 << 4)
  166. #define ISIF_YCINSWP_YCBCR (0x01 << 4)
  167. #define ISIF_CCDCFG_FIDMD_LATCH_VSYNC (0x00 << 6)
  168. #define ISIF_CCDCFG_WENLOG_AND (0x00 << 8)
  169. #define ISIF_CCDCFG_TRGSEL_WEN (0x00 << 9)
  170. #define ISIF_CCDCFG_EXTRG_DISABLE (0x00 << 10)
  171. #define ISIF_LATCH_ON_VSYNC_DISABLE (0x01 << 15)
  172. #define ISIF_LATCH_ON_VSYNC_ENABLE (0x00 << 15)
  173. #define ISIF_DATA_PACK_MASK 3
  174. #define ISIF_DATA_PACK16 0
  175. #define ISIF_DATA_PACK12 1
  176. #define ISIF_DATA_PACK8 2
  177. #define ISIF_PIX_ORDER_SHIFT 11
  178. #define ISIF_BW656_ENABLE (0x01 << 5)
  179. /* MODESET registers */
  180. #define ISIF_VDHDOUT_INPUT (0x00 << 0)
  181. #define ISIF_INPUT_SHIFT 12
  182. #define ISIF_RAW_INPUT_MODE 0
  183. #define ISIF_FID_POL_SHIFT 4
  184. #define ISIF_HD_POL_SHIFT 3
  185. #define ISIF_VD_POL_SHIFT 2
  186. #define ISIF_DATAPOL_NORMAL 0
  187. #define ISIF_DATAPOL_SHIFT 6
  188. #define ISIF_EXWEN_DISABLE 0
  189. #define ISIF_EXWEN_SHIFT 5
  190. #define ISIF_FRM_FMT_SHIFT 7
  191. #define ISIF_DATASFT_SHIFT 8
  192. #define ISIF_LPF_SHIFT 14
  193. #define ISIF_LPF_MASK 1
  194. /* GAMMAWD registers */
  195. #define ISIF_ALAW_GAMMA_WD_MASK 0xF
  196. #define ISIF_ALAW_GAMMA_WD_SHIFT 1
  197. #define ISIF_ALAW_ENABLE 1
  198. #define ISIF_GAMMAWD_CFA_SHIFT 5
  199. /* HSIZE registers */
  200. #define ISIF_HSIZE_FLIP_MASK 1
  201. #define ISIF_HSIZE_FLIP_SHIFT 12
  202. /* MISC registers */
  203. #define ISIF_DPCM_EN_SHIFT 12
  204. #define ISIF_DPCM_PREDICTOR_SHIFT 13
  205. /* Black clamp related */
  206. #define ISIF_BC_MODE_COLOR_SHIFT 4
  207. #define ISIF_HORZ_BC_MODE_SHIFT 1
  208. #define ISIF_HORZ_BC_WIN_SEL_SHIFT 5
  209. #define ISIF_HORZ_BC_PIX_LIMIT_SHIFT 6
  210. #define ISIF_HORZ_BC_WIN_H_SIZE_SHIFT 8
  211. #define ISIF_HORZ_BC_WIN_V_SIZE_SHIFT 12
  212. #define ISIF_VERT_BC_RST_VAL_SEL_SHIFT 4
  213. #define ISIF_VERT_BC_LINE_AVE_COEF_SHIFT 8
  214. /* VDFC registers */
  215. #define ISIF_VDFC_EN_SHIFT 4
  216. #define ISIF_VDFC_CORR_MOD_SHIFT 5
  217. #define ISIF_VDFC_CORR_WHOLE_LN_SHIFT 7
  218. #define ISIF_VDFC_LEVEL_SHFT_SHIFT 8
  219. #define ISIF_VDFC_POS_MASK 0x1FFF
  220. #define ISIF_DFCMEMCTL_DFCMARST_SHIFT 2
  221. /* CSC registers */
  222. #define ISIF_CSC_COEF_INTEG_MASK 7
  223. #define ISIF_CSC_COEF_DECIMAL_MASK 0x1f
  224. #define ISIF_CSC_COEF_INTEG_SHIFT 5
  225. #define ISIF_CSCM_MSB_SHIFT 8
  226. #define ISIF_DF_CSC_SPH_MASK 0x1FFF
  227. #define ISIF_DF_CSC_LNH_MASK 0x1FFF
  228. #define ISIF_DF_CSC_SLV_MASK 0x1FFF
  229. #define ISIF_DF_CSC_LNV_MASK 0x1FFF
  230. #define ISIF_DF_NUMLINES 0x7FFF
  231. #define ISIF_DF_NUMPIX 0x1FFF
  232. /* Offsets for LSC/DFC/Gain */
  233. #define ISIF_DATA_H_OFFSET_MASK 0x1FFF
  234. #define ISIF_DATA_V_OFFSET_MASK 0x1FFF
  235. /* Linearization */
  236. #define ISIF_LIN_CORRSFT_SHIFT 4
  237. #define ISIF_LIN_SCALE_FACT_INTEG_SHIFT 10
  238. /* Pattern registers */
  239. #define ISIF_PG_EN (1 << 3)
  240. #define ISIF_SEL_PG_SRC (3 << 4)
  241. #define ISIF_PG_VD_POL_SHIFT 0
  242. #define ISIF_PG_HD_POL_SHIFT 1
  243. /*random other junk*/
  244. #define ISIF_SYNCEN_VDHDEN_MASK (1 << 0)
  245. #define ISIF_SYNCEN_WEN_MASK (1 << 1)
  246. #define ISIF_SYNCEN_WEN_SHIFT 1
  247. #endif