isif_regs.h 7.7 KB

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