ispreg.h 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517
  1. /*
  2. * ispreg.h
  3. *
  4. * TI OMAP3 ISP - Registers definitions
  5. *
  6. * Copyright (C) 2010 Nokia Corporation
  7. * Copyright (C) 2009 Texas Instruments, Inc
  8. *
  9. * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  10. * Sakari Ailus <sakari.ailus@iki.fi>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #ifndef OMAP3_ISP_REG_H
  17. #define OMAP3_ISP_REG_H
  18. #define CM_CAM_MCLK_HZ 172800000 /* Hz */
  19. /* ISP module register offset */
  20. #define ISP_REVISION (0x000)
  21. #define ISP_SYSCONFIG (0x004)
  22. #define ISP_SYSSTATUS (0x008)
  23. #define ISP_IRQ0ENABLE (0x00C)
  24. #define ISP_IRQ0STATUS (0x010)
  25. #define ISP_IRQ1ENABLE (0x014)
  26. #define ISP_IRQ1STATUS (0x018)
  27. #define ISP_TCTRL_GRESET_LENGTH (0x030)
  28. #define ISP_TCTRL_PSTRB_REPLAY (0x034)
  29. #define ISP_CTRL (0x040)
  30. #define ISP_SECURE (0x044)
  31. #define ISP_TCTRL_CTRL (0x050)
  32. #define ISP_TCTRL_FRAME (0x054)
  33. #define ISP_TCTRL_PSTRB_DELAY (0x058)
  34. #define ISP_TCTRL_STRB_DELAY (0x05C)
  35. #define ISP_TCTRL_SHUT_DELAY (0x060)
  36. #define ISP_TCTRL_PSTRB_LENGTH (0x064)
  37. #define ISP_TCTRL_STRB_LENGTH (0x068)
  38. #define ISP_TCTRL_SHUT_LENGTH (0x06C)
  39. #define ISP_PING_PONG_ADDR (0x070)
  40. #define ISP_PING_PONG_MEM_RANGE (0x074)
  41. #define ISP_PING_PONG_BUF_SIZE (0x078)
  42. /* CCP2 receiver registers */
  43. #define ISPCCP2_REVISION (0x000)
  44. #define ISPCCP2_SYSCONFIG (0x004)
  45. #define ISPCCP2_SYSCONFIG_SOFT_RESET (1 << 1)
  46. #define ISPCCP2_SYSCONFIG_AUTO_IDLE 0x1
  47. #define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT 12
  48. #define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_FORCE \
  49. (0x0 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  50. #define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_NO \
  51. (0x1 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  52. #define ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SMART \
  53. (0x2 << ISPCCP2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  54. #define ISPCCP2_SYSSTATUS (0x008)
  55. #define ISPCCP2_SYSSTATUS_RESET_DONE (1 << 0)
  56. #define ISPCCP2_LC01_IRQENABLE (0x00C)
  57. #define ISPCCP2_LC01_IRQSTATUS (0x010)
  58. #define ISPCCP2_LC01_IRQSTATUS_LC0_FS_IRQ (1 << 11)
  59. #define ISPCCP2_LC01_IRQSTATUS_LC0_LE_IRQ (1 << 10)
  60. #define ISPCCP2_LC01_IRQSTATUS_LC0_LS_IRQ (1 << 9)
  61. #define ISPCCP2_LC01_IRQSTATUS_LC0_FE_IRQ (1 << 8)
  62. #define ISPCCP2_LC01_IRQSTATUS_LC0_COUNT_IRQ (1 << 7)
  63. #define ISPCCP2_LC01_IRQSTATUS_LC0_FIFO_OVF_IRQ (1 << 5)
  64. #define ISPCCP2_LC01_IRQSTATUS_LC0_CRC_IRQ (1 << 4)
  65. #define ISPCCP2_LC01_IRQSTATUS_LC0_FSP_IRQ (1 << 3)
  66. #define ISPCCP2_LC01_IRQSTATUS_LC0_FW_IRQ (1 << 2)
  67. #define ISPCCP2_LC01_IRQSTATUS_LC0_FSC_IRQ (1 << 1)
  68. #define ISPCCP2_LC01_IRQSTATUS_LC0_SSC_IRQ (1 << 0)
  69. #define ISPCCP2_LC23_IRQENABLE (0x014)
  70. #define ISPCCP2_LC23_IRQSTATUS (0x018)
  71. #define ISPCCP2_LCM_IRQENABLE (0x02C)
  72. #define ISPCCP2_LCM_IRQSTATUS_EOF_IRQ (1 << 0)
  73. #define ISPCCP2_LCM_IRQSTATUS_OCPERROR_IRQ (1 << 1)
  74. #define ISPCCP2_LCM_IRQSTATUS (0x030)
  75. #define ISPCCP2_CTRL (0x040)
  76. #define ISPCCP2_CTRL_IF_EN (1 << 0)
  77. #define ISPCCP2_CTRL_PHY_SEL (1 << 1)
  78. #define ISPCCP2_CTRL_PHY_SEL_CLOCK (0 << 1)
  79. #define ISPCCP2_CTRL_PHY_SEL_STROBE (1 << 1)
  80. #define ISPCCP2_CTRL_PHY_SEL_MASK 0x1
  81. #define ISPCCP2_CTRL_PHY_SEL_SHIFT 1
  82. #define ISPCCP2_CTRL_IO_OUT_SEL (1 << 2)
  83. #define ISPCCP2_CTRL_MODE (1 << 4)
  84. #define ISPCCP2_CTRL_VP_CLK_FORCE_ON (1 << 9)
  85. #define ISPCCP2_CTRL_INV (1 << 10)
  86. #define ISPCCP2_CTRL_INV_MASK 0x1
  87. #define ISPCCP2_CTRL_INV_SHIFT 10
  88. #define ISPCCP2_CTRL_VP_ONLY_EN (1 << 11)
  89. #define ISPCCP2_CTRL_VP_CLK_POL (1 << 12)
  90. #define ISPCCP2_CTRL_VPCLK_DIV_SHIFT 15
  91. #define ISPCCP2_CTRL_VPCLK_DIV_MASK 0x1ffff /* [31:15] */
  92. #define ISPCCP2_CTRL_VP_OUT_CTRL_SHIFT 8 /* 3430 bits */
  93. #define ISPCCP2_CTRL_VP_OUT_CTRL_MASK 0x3 /* 3430 bits */
  94. #define ISPCCP2_DBG (0x044)
  95. #define ISPCCP2_GNQ (0x048)
  96. #define ISPCCP2_LCx_CTRL(x) ((0x050)+0x30*(x))
  97. #define ISPCCP2_LCx_CTRL_CHAN_EN (1 << 0)
  98. #define ISPCCP2_LCx_CTRL_CRC_EN (1 << 19)
  99. #define ISPCCP2_LCx_CTRL_CRC_MASK 0x1
  100. #define ISPCCP2_LCx_CTRL_CRC_SHIFT 2
  101. #define ISPCCP2_LCx_CTRL_CRC_SHIFT_15_0 19
  102. #define ISPCCP2_LCx_CTRL_REGION_EN (1 << 1)
  103. #define ISPCCP2_LCx_CTRL_REGION_MASK 0x1
  104. #define ISPCCP2_LCx_CTRL_REGION_SHIFT 1
  105. #define ISPCCP2_LCx_CTRL_FORMAT_MASK_15_0 0x3f
  106. #define ISPCCP2_LCx_CTRL_FORMAT_SHIFT_15_0 0x2
  107. #define ISPCCP2_LCx_CTRL_FORMAT_MASK 0x1f
  108. #define ISPCCP2_LCx_CTRL_FORMAT_SHIFT 0x3
  109. #define ISPCCP2_LCx_CODE(x) ((0x054)+0x30*(x))
  110. #define ISPCCP2_LCx_STAT_START(x) ((0x058)+0x30*(x))
  111. #define ISPCCP2_LCx_STAT_SIZE(x) ((0x05C)+0x30*(x))
  112. #define ISPCCP2_LCx_SOF_ADDR(x) ((0x060)+0x30*(x))
  113. #define ISPCCP2_LCx_EOF_ADDR(x) ((0x064)+0x30*(x))
  114. #define ISPCCP2_LCx_DAT_START(x) ((0x068)+0x30*(x))
  115. #define ISPCCP2_LCx_DAT_SIZE(x) ((0x06C)+0x30*(x))
  116. #define ISPCCP2_LCx_DAT_MASK 0xFFF
  117. #define ISPCCP2_LCx_DAT_SHIFT 16
  118. #define ISPCCP2_LCx_DAT_PING_ADDR(x) ((0x070)+0x30*(x))
  119. #define ISPCCP2_LCx_DAT_PONG_ADDR(x) ((0x074)+0x30*(x))
  120. #define ISPCCP2_LCx_DAT_OFST(x) ((0x078)+0x30*(x))
  121. #define ISPCCP2_LCM_CTRL (0x1D0)
  122. #define ISPCCP2_LCM_CTRL_CHAN_EN (1 << 0)
  123. #define ISPCCP2_LCM_CTRL_DST_PORT (1 << 2)
  124. #define ISPCCP2_LCM_CTRL_DST_PORT_SHIFT 2
  125. #define ISPCCP2_LCM_CTRL_READ_THROTTLE_SHIFT 3
  126. #define ISPCCP2_LCM_CTRL_READ_THROTTLE_MASK 0x11
  127. #define ISPCCP2_LCM_CTRL_BURST_SIZE_SHIFT 5
  128. #define ISPCCP2_LCM_CTRL_BURST_SIZE_MASK 0x7
  129. #define ISPCCP2_LCM_CTRL_SRC_FORMAT_SHIFT 16
  130. #define ISPCCP2_LCM_CTRL_SRC_FORMAT_MASK 0x7
  131. #define ISPCCP2_LCM_CTRL_SRC_DECOMPR_SHIFT 20
  132. #define ISPCCP2_LCM_CTRL_SRC_DECOMPR_MASK 0x3
  133. #define ISPCCP2_LCM_CTRL_SRC_DPCM_PRED (1 << 22)
  134. #define ISPCCP2_LCM_CTRL_SRC_PACK (1 << 23)
  135. #define ISPCCP2_LCM_CTRL_DST_FORMAT_SHIFT 24
  136. #define ISPCCP2_LCM_CTRL_DST_FORMAT_MASK 0x7
  137. #define ISPCCP2_LCM_VSIZE (0x1D4)
  138. #define ISPCCP2_LCM_VSIZE_SHIFT 16
  139. #define ISPCCP2_LCM_HSIZE (0x1D8)
  140. #define ISPCCP2_LCM_HSIZE_SHIFT 16
  141. #define ISPCCP2_LCM_PREFETCH (0x1DC)
  142. #define ISPCCP2_LCM_PREFETCH_SHIFT 3
  143. #define ISPCCP2_LCM_SRC_ADDR (0x1E0)
  144. #define ISPCCP2_LCM_SRC_OFST (0x1E4)
  145. #define ISPCCP2_LCM_DST_ADDR (0x1E8)
  146. #define ISPCCP2_LCM_DST_OFST (0x1EC)
  147. /* CCDC module register offset */
  148. #define ISPCCDC_PID (0x000)
  149. #define ISPCCDC_PCR (0x004)
  150. #define ISPCCDC_SYN_MODE (0x008)
  151. #define ISPCCDC_HD_VD_WID (0x00C)
  152. #define ISPCCDC_PIX_LINES (0x010)
  153. #define ISPCCDC_HORZ_INFO (0x014)
  154. #define ISPCCDC_VERT_START (0x018)
  155. #define ISPCCDC_VERT_LINES (0x01C)
  156. #define ISPCCDC_CULLING (0x020)
  157. #define ISPCCDC_HSIZE_OFF (0x024)
  158. #define ISPCCDC_SDOFST (0x028)
  159. #define ISPCCDC_SDR_ADDR (0x02C)
  160. #define ISPCCDC_CLAMP (0x030)
  161. #define ISPCCDC_DCSUB (0x034)
  162. #define ISPCCDC_COLPTN (0x038)
  163. #define ISPCCDC_BLKCMP (0x03C)
  164. #define ISPCCDC_FPC (0x040)
  165. #define ISPCCDC_FPC_ADDR (0x044)
  166. #define ISPCCDC_VDINT (0x048)
  167. #define ISPCCDC_ALAW (0x04C)
  168. #define ISPCCDC_REC656IF (0x050)
  169. #define ISPCCDC_CFG (0x054)
  170. #define ISPCCDC_FMTCFG (0x058)
  171. #define ISPCCDC_FMT_HORZ (0x05C)
  172. #define ISPCCDC_FMT_VERT (0x060)
  173. #define ISPCCDC_FMT_ADDR0 (0x064)
  174. #define ISPCCDC_FMT_ADDR1 (0x068)
  175. #define ISPCCDC_FMT_ADDR2 (0x06C)
  176. #define ISPCCDC_FMT_ADDR3 (0x070)
  177. #define ISPCCDC_FMT_ADDR4 (0x074)
  178. #define ISPCCDC_FMT_ADDR5 (0x078)
  179. #define ISPCCDC_FMT_ADDR6 (0x07C)
  180. #define ISPCCDC_FMT_ADDR7 (0x080)
  181. #define ISPCCDC_PRGEVEN0 (0x084)
  182. #define ISPCCDC_PRGEVEN1 (0x088)
  183. #define ISPCCDC_PRGODD0 (0x08C)
  184. #define ISPCCDC_PRGODD1 (0x090)
  185. #define ISPCCDC_VP_OUT (0x094)
  186. #define ISPCCDC_LSC_CONFIG (0x098)
  187. #define ISPCCDC_LSC_INITIAL (0x09C)
  188. #define ISPCCDC_LSC_TABLE_BASE (0x0A0)
  189. #define ISPCCDC_LSC_TABLE_OFFSET (0x0A4)
  190. /* SBL */
  191. #define ISPSBL_PCR 0x4
  192. #define ISPSBL_PCR_H3A_AEAWB_WBL_OVF (1 << 16)
  193. #define ISPSBL_PCR_H3A_AF_WBL_OVF (1 << 17)
  194. #define ISPSBL_PCR_RSZ4_WBL_OVF (1 << 18)
  195. #define ISPSBL_PCR_RSZ3_WBL_OVF (1 << 19)
  196. #define ISPSBL_PCR_RSZ2_WBL_OVF (1 << 20)
  197. #define ISPSBL_PCR_RSZ1_WBL_OVF (1 << 21)
  198. #define ISPSBL_PCR_PRV_WBL_OVF (1 << 22)
  199. #define ISPSBL_PCR_CCDC_WBL_OVF (1 << 23)
  200. #define ISPSBL_PCR_CCDCPRV_2_RSZ_OVF (1 << 24)
  201. #define ISPSBL_PCR_CSIA_WBL_OVF (1 << 25)
  202. #define ISPSBL_PCR_CSIB_WBL_OVF (1 << 26)
  203. #define ISPSBL_CCDC_WR_0 (0x028)
  204. #define ISPSBL_CCDC_WR_0_DATA_READY (1 << 21)
  205. #define ISPSBL_CCDC_WR_1 (0x02C)
  206. #define ISPSBL_CCDC_WR_2 (0x030)
  207. #define ISPSBL_CCDC_WR_3 (0x034)
  208. #define ISPSBL_SDR_REQ_EXP 0xF8
  209. #define ISPSBL_SDR_REQ_HIST_EXP_SHIFT 0
  210. #define ISPSBL_SDR_REQ_HIST_EXP_MASK (0x3FF)
  211. #define ISPSBL_SDR_REQ_RSZ_EXP_SHIFT 10
  212. #define ISPSBL_SDR_REQ_RSZ_EXP_MASK (0x3FF << ISPSBL_SDR_REQ_RSZ_EXP_SHIFT)
  213. #define ISPSBL_SDR_REQ_PRV_EXP_SHIFT 20
  214. #define ISPSBL_SDR_REQ_PRV_EXP_MASK (0x3FF << ISPSBL_SDR_REQ_PRV_EXP_SHIFT)
  215. /* Histogram registers */
  216. #define ISPHIST_PID (0x000)
  217. #define ISPHIST_PCR (0x004)
  218. #define ISPHIST_CNT (0x008)
  219. #define ISPHIST_WB_GAIN (0x00C)
  220. #define ISPHIST_R0_HORZ (0x010)
  221. #define ISPHIST_R0_VERT (0x014)
  222. #define ISPHIST_R1_HORZ (0x018)
  223. #define ISPHIST_R1_VERT (0x01C)
  224. #define ISPHIST_R2_HORZ (0x020)
  225. #define ISPHIST_R2_VERT (0x024)
  226. #define ISPHIST_R3_HORZ (0x028)
  227. #define ISPHIST_R3_VERT (0x02C)
  228. #define ISPHIST_ADDR (0x030)
  229. #define ISPHIST_DATA (0x034)
  230. #define ISPHIST_RADD (0x038)
  231. #define ISPHIST_RADD_OFF (0x03C)
  232. #define ISPHIST_H_V_INFO (0x040)
  233. /* H3A module registers */
  234. #define ISPH3A_PID (0x000)
  235. #define ISPH3A_PCR (0x004)
  236. #define ISPH3A_AEWWIN1 (0x04C)
  237. #define ISPH3A_AEWINSTART (0x050)
  238. #define ISPH3A_AEWINBLK (0x054)
  239. #define ISPH3A_AEWSUBWIN (0x058)
  240. #define ISPH3A_AEWBUFST (0x05C)
  241. #define ISPH3A_AFPAX1 (0x008)
  242. #define ISPH3A_AFPAX2 (0x00C)
  243. #define ISPH3A_AFPAXSTART (0x010)
  244. #define ISPH3A_AFIIRSH (0x014)
  245. #define ISPH3A_AFBUFST (0x018)
  246. #define ISPH3A_AFCOEF010 (0x01C)
  247. #define ISPH3A_AFCOEF032 (0x020)
  248. #define ISPH3A_AFCOEF054 (0x024)
  249. #define ISPH3A_AFCOEF076 (0x028)
  250. #define ISPH3A_AFCOEF098 (0x02C)
  251. #define ISPH3A_AFCOEF0010 (0x030)
  252. #define ISPH3A_AFCOEF110 (0x034)
  253. #define ISPH3A_AFCOEF132 (0x038)
  254. #define ISPH3A_AFCOEF154 (0x03C)
  255. #define ISPH3A_AFCOEF176 (0x040)
  256. #define ISPH3A_AFCOEF198 (0x044)
  257. #define ISPH3A_AFCOEF1010 (0x048)
  258. #define ISPPRV_PCR (0x004)
  259. #define ISPPRV_HORZ_INFO (0x008)
  260. #define ISPPRV_VERT_INFO (0x00C)
  261. #define ISPPRV_RSDR_ADDR (0x010)
  262. #define ISPPRV_RADR_OFFSET (0x014)
  263. #define ISPPRV_DSDR_ADDR (0x018)
  264. #define ISPPRV_DRKF_OFFSET (0x01C)
  265. #define ISPPRV_WSDR_ADDR (0x020)
  266. #define ISPPRV_WADD_OFFSET (0x024)
  267. #define ISPPRV_AVE (0x028)
  268. #define ISPPRV_HMED (0x02C)
  269. #define ISPPRV_NF (0x030)
  270. #define ISPPRV_WB_DGAIN (0x034)
  271. #define ISPPRV_WBGAIN (0x038)
  272. #define ISPPRV_WBSEL (0x03C)
  273. #define ISPPRV_CFA (0x040)
  274. #define ISPPRV_BLKADJOFF (0x044)
  275. #define ISPPRV_RGB_MAT1 (0x048)
  276. #define ISPPRV_RGB_MAT2 (0x04C)
  277. #define ISPPRV_RGB_MAT3 (0x050)
  278. #define ISPPRV_RGB_MAT4 (0x054)
  279. #define ISPPRV_RGB_MAT5 (0x058)
  280. #define ISPPRV_RGB_OFF1 (0x05C)
  281. #define ISPPRV_RGB_OFF2 (0x060)
  282. #define ISPPRV_CSC0 (0x064)
  283. #define ISPPRV_CSC1 (0x068)
  284. #define ISPPRV_CSC2 (0x06C)
  285. #define ISPPRV_CSC_OFFSET (0x070)
  286. #define ISPPRV_CNT_BRT (0x074)
  287. #define ISPPRV_CSUP (0x078)
  288. #define ISPPRV_SETUP_YC (0x07C)
  289. #define ISPPRV_SET_TBL_ADDR (0x080)
  290. #define ISPPRV_SET_TBL_DATA (0x084)
  291. #define ISPPRV_CDC_THR0 (0x090)
  292. #define ISPPRV_CDC_THR1 (ISPPRV_CDC_THR0 + (0x4))
  293. #define ISPPRV_CDC_THR2 (ISPPRV_CDC_THR0 + (0x4) * 2)
  294. #define ISPPRV_CDC_THR3 (ISPPRV_CDC_THR0 + (0x4) * 3)
  295. #define ISPPRV_REDGAMMA_TABLE_ADDR 0x0000
  296. #define ISPPRV_GREENGAMMA_TABLE_ADDR 0x0400
  297. #define ISPPRV_BLUEGAMMA_TABLE_ADDR 0x0800
  298. #define ISPPRV_NF_TABLE_ADDR 0x0C00
  299. #define ISPPRV_YENH_TABLE_ADDR 0x1000
  300. #define ISPPRV_CFA_TABLE_ADDR 0x1400
  301. #define ISPRSZ_MIN_OUTPUT 64
  302. #define ISPRSZ_MAX_OUTPUT 3312
  303. /* Resizer module register offset */
  304. #define ISPRSZ_PID (0x000)
  305. #define ISPRSZ_PCR (0x004)
  306. #define ISPRSZ_CNT (0x008)
  307. #define ISPRSZ_OUT_SIZE (0x00C)
  308. #define ISPRSZ_IN_START (0x010)
  309. #define ISPRSZ_IN_SIZE (0x014)
  310. #define ISPRSZ_SDR_INADD (0x018)
  311. #define ISPRSZ_SDR_INOFF (0x01C)
  312. #define ISPRSZ_SDR_OUTADD (0x020)
  313. #define ISPRSZ_SDR_OUTOFF (0x024)
  314. #define ISPRSZ_HFILT10 (0x028)
  315. #define ISPRSZ_HFILT32 (0x02C)
  316. #define ISPRSZ_HFILT54 (0x030)
  317. #define ISPRSZ_HFILT76 (0x034)
  318. #define ISPRSZ_HFILT98 (0x038)
  319. #define ISPRSZ_HFILT1110 (0x03C)
  320. #define ISPRSZ_HFILT1312 (0x040)
  321. #define ISPRSZ_HFILT1514 (0x044)
  322. #define ISPRSZ_HFILT1716 (0x048)
  323. #define ISPRSZ_HFILT1918 (0x04C)
  324. #define ISPRSZ_HFILT2120 (0x050)
  325. #define ISPRSZ_HFILT2322 (0x054)
  326. #define ISPRSZ_HFILT2524 (0x058)
  327. #define ISPRSZ_HFILT2726 (0x05C)
  328. #define ISPRSZ_HFILT2928 (0x060)
  329. #define ISPRSZ_HFILT3130 (0x064)
  330. #define ISPRSZ_VFILT10 (0x068)
  331. #define ISPRSZ_VFILT32 (0x06C)
  332. #define ISPRSZ_VFILT54 (0x070)
  333. #define ISPRSZ_VFILT76 (0x074)
  334. #define ISPRSZ_VFILT98 (0x078)
  335. #define ISPRSZ_VFILT1110 (0x07C)
  336. #define ISPRSZ_VFILT1312 (0x080)
  337. #define ISPRSZ_VFILT1514 (0x084)
  338. #define ISPRSZ_VFILT1716 (0x088)
  339. #define ISPRSZ_VFILT1918 (0x08C)
  340. #define ISPRSZ_VFILT2120 (0x090)
  341. #define ISPRSZ_VFILT2322 (0x094)
  342. #define ISPRSZ_VFILT2524 (0x098)
  343. #define ISPRSZ_VFILT2726 (0x09C)
  344. #define ISPRSZ_VFILT2928 (0x0A0)
  345. #define ISPRSZ_VFILT3130 (0x0A4)
  346. #define ISPRSZ_YENH (0x0A8)
  347. #define ISP_INT_CLR 0xFF113F11
  348. #define ISPPRV_PCR_EN 1
  349. #define ISPPRV_PCR_BUSY (1 << 1)
  350. #define ISPPRV_PCR_SOURCE (1 << 2)
  351. #define ISPPRV_PCR_ONESHOT (1 << 3)
  352. #define ISPPRV_PCR_WIDTH (1 << 4)
  353. #define ISPPRV_PCR_INVALAW (1 << 5)
  354. #define ISPPRV_PCR_DRKFEN (1 << 6)
  355. #define ISPPRV_PCR_DRKFCAP (1 << 7)
  356. #define ISPPRV_PCR_HMEDEN (1 << 8)
  357. #define ISPPRV_PCR_NFEN (1 << 9)
  358. #define ISPPRV_PCR_CFAEN (1 << 10)
  359. #define ISPPRV_PCR_CFAFMT_SHIFT 11
  360. #define ISPPRV_PCR_CFAFMT_MASK 0x7800
  361. #define ISPPRV_PCR_CFAFMT_BAYER (0 << 11)
  362. #define ISPPRV_PCR_CFAFMT_SONYVGA (1 << 11)
  363. #define ISPPRV_PCR_CFAFMT_RGBFOVEON (2 << 11)
  364. #define ISPPRV_PCR_CFAFMT_DNSPL (3 << 11)
  365. #define ISPPRV_PCR_CFAFMT_HONEYCOMB (4 << 11)
  366. #define ISPPRV_PCR_CFAFMT_RRGGBBFOVEON (5 << 11)
  367. #define ISPPRV_PCR_YNENHEN (1 << 15)
  368. #define ISPPRV_PCR_SUPEN (1 << 16)
  369. #define ISPPRV_PCR_YCPOS_SHIFT 17
  370. #define ISPPRV_PCR_YCPOS_YCrYCb (0 << 17)
  371. #define ISPPRV_PCR_YCPOS_YCbYCr (1 << 17)
  372. #define ISPPRV_PCR_YCPOS_CbYCrY (2 << 17)
  373. #define ISPPRV_PCR_YCPOS_CrYCbY (3 << 17)
  374. #define ISPPRV_PCR_RSZPORT (1 << 19)
  375. #define ISPPRV_PCR_SDRPORT (1 << 20)
  376. #define ISPPRV_PCR_SCOMP_EN (1 << 21)
  377. #define ISPPRV_PCR_SCOMP_SFT_SHIFT (22)
  378. #define ISPPRV_PCR_SCOMP_SFT_MASK (7 << 22)
  379. #define ISPPRV_PCR_GAMMA_BYPASS (1 << 26)
  380. #define ISPPRV_PCR_DCOREN (1 << 27)
  381. #define ISPPRV_PCR_DCCOUP (1 << 28)
  382. #define ISPPRV_PCR_DRK_FAIL (1 << 31)
  383. #define ISPPRV_HORZ_INFO_EPH_SHIFT 0
  384. #define ISPPRV_HORZ_INFO_EPH_MASK 0x3fff
  385. #define ISPPRV_HORZ_INFO_SPH_SHIFT 16
  386. #define ISPPRV_HORZ_INFO_SPH_MASK 0x3fff0
  387. #define ISPPRV_VERT_INFO_ELV_SHIFT 0
  388. #define ISPPRV_VERT_INFO_ELV_MASK 0x3fff
  389. #define ISPPRV_VERT_INFO_SLV_SHIFT 16
  390. #define ISPPRV_VERT_INFO_SLV_MASK 0x3fff0
  391. #define ISPPRV_AVE_EVENDIST_SHIFT 2
  392. #define ISPPRV_AVE_EVENDIST_1 0x0
  393. #define ISPPRV_AVE_EVENDIST_2 0x1
  394. #define ISPPRV_AVE_EVENDIST_3 0x2
  395. #define ISPPRV_AVE_EVENDIST_4 0x3
  396. #define ISPPRV_AVE_ODDDIST_SHIFT 4
  397. #define ISPPRV_AVE_ODDDIST_1 0x0
  398. #define ISPPRV_AVE_ODDDIST_2 0x1
  399. #define ISPPRV_AVE_ODDDIST_3 0x2
  400. #define ISPPRV_AVE_ODDDIST_4 0x3
  401. #define ISPPRV_HMED_THRESHOLD_SHIFT 0
  402. #define ISPPRV_HMED_EVENDIST (1 << 8)
  403. #define ISPPRV_HMED_ODDDIST (1 << 9)
  404. #define ISPPRV_WBGAIN_COEF0_SHIFT 0
  405. #define ISPPRV_WBGAIN_COEF1_SHIFT 8
  406. #define ISPPRV_WBGAIN_COEF2_SHIFT 16
  407. #define ISPPRV_WBGAIN_COEF3_SHIFT 24
  408. #define ISPPRV_WBSEL_COEF0 0x0
  409. #define ISPPRV_WBSEL_COEF1 0x1
  410. #define ISPPRV_WBSEL_COEF2 0x2
  411. #define ISPPRV_WBSEL_COEF3 0x3
  412. #define ISPPRV_WBSEL_N0_0_SHIFT 0
  413. #define ISPPRV_WBSEL_N0_1_SHIFT 2
  414. #define ISPPRV_WBSEL_N0_2_SHIFT 4
  415. #define ISPPRV_WBSEL_N0_3_SHIFT 6
  416. #define ISPPRV_WBSEL_N1_0_SHIFT 8
  417. #define ISPPRV_WBSEL_N1_1_SHIFT 10
  418. #define ISPPRV_WBSEL_N1_2_SHIFT 12
  419. #define ISPPRV_WBSEL_N1_3_SHIFT 14
  420. #define ISPPRV_WBSEL_N2_0_SHIFT 16
  421. #define ISPPRV_WBSEL_N2_1_SHIFT 18
  422. #define ISPPRV_WBSEL_N2_2_SHIFT 20
  423. #define ISPPRV_WBSEL_N2_3_SHIFT 22
  424. #define ISPPRV_WBSEL_N3_0_SHIFT 24
  425. #define ISPPRV_WBSEL_N3_1_SHIFT 26
  426. #define ISPPRV_WBSEL_N3_2_SHIFT 28
  427. #define ISPPRV_WBSEL_N3_3_SHIFT 30
  428. #define ISPPRV_CFA_GRADTH_HOR_SHIFT 0
  429. #define ISPPRV_CFA_GRADTH_VER_SHIFT 8
  430. #define ISPPRV_BLKADJOFF_B_SHIFT 0
  431. #define ISPPRV_BLKADJOFF_G_SHIFT 8
  432. #define ISPPRV_BLKADJOFF_R_SHIFT 16
  433. #define ISPPRV_RGB_MAT1_MTX_RR_SHIFT 0
  434. #define ISPPRV_RGB_MAT1_MTX_GR_SHIFT 16
  435. #define ISPPRV_RGB_MAT2_MTX_BR_SHIFT 0
  436. #define ISPPRV_RGB_MAT2_MTX_RG_SHIFT 16
  437. #define ISPPRV_RGB_MAT3_MTX_GG_SHIFT 0
  438. #define ISPPRV_RGB_MAT3_MTX_BG_SHIFT 16
  439. #define ISPPRV_RGB_MAT4_MTX_RB_SHIFT 0
  440. #define ISPPRV_RGB_MAT4_MTX_GB_SHIFT 16
  441. #define ISPPRV_RGB_MAT5_MTX_BB_SHIFT 0
  442. #define ISPPRV_RGB_OFF1_MTX_OFFG_SHIFT 0
  443. #define ISPPRV_RGB_OFF1_MTX_OFFR_SHIFT 16
  444. #define ISPPRV_RGB_OFF2_MTX_OFFB_SHIFT 0
  445. #define ISPPRV_CSC0_RY_SHIFT 0
  446. #define ISPPRV_CSC0_GY_SHIFT 10
  447. #define ISPPRV_CSC0_BY_SHIFT 20
  448. #define ISPPRV_CSC1_RCB_SHIFT 0
  449. #define ISPPRV_CSC1_GCB_SHIFT 10
  450. #define ISPPRV_CSC1_BCB_SHIFT 20
  451. #define ISPPRV_CSC2_RCR_SHIFT 0
  452. #define ISPPRV_CSC2_GCR_SHIFT 10
  453. #define ISPPRV_CSC2_BCR_SHIFT 20
  454. #define ISPPRV_CSC_OFFSET_CR_SHIFT 0
  455. #define ISPPRV_CSC_OFFSET_CB_SHIFT 8
  456. #define ISPPRV_CSC_OFFSET_Y_SHIFT 16
  457. #define ISPPRV_CNT_BRT_BRT_SHIFT 0
  458. #define ISPPRV_CNT_BRT_CNT_SHIFT 8
  459. #define ISPPRV_CONTRAST_MAX 0x10
  460. #define ISPPRV_CONTRAST_MIN 0xFF
  461. #define ISPPRV_BRIGHT_MIN 0x00
  462. #define ISPPRV_BRIGHT_MAX 0xFF
  463. #define ISPPRV_CSUP_CSUPG_SHIFT 0
  464. #define ISPPRV_CSUP_THRES_SHIFT 8
  465. #define ISPPRV_CSUP_HPYF_SHIFT 16
  466. #define ISPPRV_SETUP_YC_MINC_SHIFT 0
  467. #define ISPPRV_SETUP_YC_MAXC_SHIFT 8
  468. #define ISPPRV_SETUP_YC_MINY_SHIFT 16
  469. #define ISPPRV_SETUP_YC_MAXY_SHIFT 24
  470. #define ISPPRV_YC_MAX 0xFF
  471. #define ISPPRV_YC_MIN 0x0
  472. /* Define bit fields within selected registers */
  473. #define ISP_REVISION_SHIFT 0
  474. #define ISP_SYSCONFIG_AUTOIDLE (1 << 0)
  475. #define ISP_SYSCONFIG_SOFTRESET (1 << 1)
  476. #define ISP_SYSCONFIG_MIDLEMODE_SHIFT 12
  477. #define ISP_SYSCONFIG_MIDLEMODE_FORCESTANDBY 0x0
  478. #define ISP_SYSCONFIG_MIDLEMODE_NOSTANBY 0x1
  479. #define ISP_SYSCONFIG_MIDLEMODE_SMARTSTANDBY 0x2
  480. #define ISP_SYSSTATUS_RESETDONE 0
  481. #define IRQ0ENABLE_CSIA_IRQ (1 << 0)
  482. #define IRQ0ENABLE_CSIC_IRQ (1 << 1)
  483. #define IRQ0ENABLE_CCP2_LCM_IRQ (1 << 3)
  484. #define IRQ0ENABLE_CCP2_LC0_IRQ (1 << 4)
  485. #define IRQ0ENABLE_CCP2_LC1_IRQ (1 << 5)
  486. #define IRQ0ENABLE_CCP2_LC2_IRQ (1 << 6)
  487. #define IRQ0ENABLE_CCP2_LC3_IRQ (1 << 7)
  488. #define IRQ0ENABLE_CSIB_IRQ (IRQ0ENABLE_CCP2_LCM_IRQ | \
  489. IRQ0ENABLE_CCP2_LC0_IRQ | \
  490. IRQ0ENABLE_CCP2_LC1_IRQ | \
  491. IRQ0ENABLE_CCP2_LC2_IRQ | \
  492. IRQ0ENABLE_CCP2_LC3_IRQ)
  493. #define IRQ0ENABLE_CCDC_VD0_IRQ (1 << 8)
  494. #define IRQ0ENABLE_CCDC_VD1_IRQ (1 << 9)
  495. #define IRQ0ENABLE_CCDC_VD2_IRQ (1 << 10)
  496. #define IRQ0ENABLE_CCDC_ERR_IRQ (1 << 11)
  497. #define IRQ0ENABLE_H3A_AF_DONE_IRQ (1 << 12)
  498. #define IRQ0ENABLE_H3A_AWB_DONE_IRQ (1 << 13)
  499. #define IRQ0ENABLE_HIST_DONE_IRQ (1 << 16)
  500. #define IRQ0ENABLE_CCDC_LSC_DONE_IRQ (1 << 17)
  501. #define IRQ0ENABLE_CCDC_LSC_PREF_COMP_IRQ (1 << 18)
  502. #define IRQ0ENABLE_CCDC_LSC_PREF_ERR_IRQ (1 << 19)
  503. #define IRQ0ENABLE_PRV_DONE_IRQ (1 << 20)
  504. #define IRQ0ENABLE_RSZ_DONE_IRQ (1 << 24)
  505. #define IRQ0ENABLE_OVF_IRQ (1 << 25)
  506. #define IRQ0ENABLE_PING_IRQ (1 << 26)
  507. #define IRQ0ENABLE_PONG_IRQ (1 << 27)
  508. #define IRQ0ENABLE_MMU_ERR_IRQ (1 << 28)
  509. #define IRQ0ENABLE_OCP_ERR_IRQ (1 << 29)
  510. #define IRQ0ENABLE_SEC_ERR_IRQ (1 << 30)
  511. #define IRQ0ENABLE_HS_VS_IRQ (1 << 31)
  512. #define IRQ0STATUS_CSIA_IRQ (1 << 0)
  513. #define IRQ0STATUS_CSI2C_IRQ (1 << 1)
  514. #define IRQ0STATUS_CCP2_LCM_IRQ (1 << 3)
  515. #define IRQ0STATUS_CCP2_LC0_IRQ (1 << 4)
  516. #define IRQ0STATUS_CSIB_IRQ (IRQ0STATUS_CCP2_LCM_IRQ | \
  517. IRQ0STATUS_CCP2_LC0_IRQ)
  518. #define IRQ0STATUS_CSIB_LC1_IRQ (1 << 5)
  519. #define IRQ0STATUS_CSIB_LC2_IRQ (1 << 6)
  520. #define IRQ0STATUS_CSIB_LC3_IRQ (1 << 7)
  521. #define IRQ0STATUS_CCDC_VD0_IRQ (1 << 8)
  522. #define IRQ0STATUS_CCDC_VD1_IRQ (1 << 9)
  523. #define IRQ0STATUS_CCDC_VD2_IRQ (1 << 10)
  524. #define IRQ0STATUS_CCDC_ERR_IRQ (1 << 11)
  525. #define IRQ0STATUS_H3A_AF_DONE_IRQ (1 << 12)
  526. #define IRQ0STATUS_H3A_AWB_DONE_IRQ (1 << 13)
  527. #define IRQ0STATUS_HIST_DONE_IRQ (1 << 16)
  528. #define IRQ0STATUS_CCDC_LSC_DONE_IRQ (1 << 17)
  529. #define IRQ0STATUS_CCDC_LSC_PREF_COMP_IRQ (1 << 18)
  530. #define IRQ0STATUS_CCDC_LSC_PREF_ERR_IRQ (1 << 19)
  531. #define IRQ0STATUS_PRV_DONE_IRQ (1 << 20)
  532. #define IRQ0STATUS_RSZ_DONE_IRQ (1 << 24)
  533. #define IRQ0STATUS_OVF_IRQ (1 << 25)
  534. #define IRQ0STATUS_PING_IRQ (1 << 26)
  535. #define IRQ0STATUS_PONG_IRQ (1 << 27)
  536. #define IRQ0STATUS_MMU_ERR_IRQ (1 << 28)
  537. #define IRQ0STATUS_OCP_ERR_IRQ (1 << 29)
  538. #define IRQ0STATUS_SEC_ERR_IRQ (1 << 30)
  539. #define IRQ0STATUS_HS_VS_IRQ (1 << 31)
  540. #define TCTRL_GRESET_LEN 0
  541. #define TCTRL_PSTRB_REPLAY_DELAY 0
  542. #define TCTRL_PSTRB_REPLAY_COUNTER_SHIFT 25
  543. #define ISPCTRL_PAR_SER_CLK_SEL_PARALLEL 0x0
  544. #define ISPCTRL_PAR_SER_CLK_SEL_CSIA 0x1
  545. #define ISPCTRL_PAR_SER_CLK_SEL_CSIB 0x2
  546. #define ISPCTRL_PAR_SER_CLK_SEL_CSIC 0x3
  547. #define ISPCTRL_PAR_SER_CLK_SEL_MASK 0x3
  548. #define ISPCTRL_PAR_BRIDGE_SHIFT 2
  549. #define ISPCTRL_PAR_BRIDGE_DISABLE (0x0 << 2)
  550. #define ISPCTRL_PAR_BRIDGE_LENDIAN (0x2 << 2)
  551. #define ISPCTRL_PAR_BRIDGE_BENDIAN (0x3 << 2)
  552. #define ISPCTRL_PAR_BRIDGE_MASK (0x3 << 2)
  553. #define ISPCTRL_PAR_CLK_POL_SHIFT 4
  554. #define ISPCTRL_PAR_CLK_POL_INV (1 << 4)
  555. #define ISPCTRL_PING_PONG_EN (1 << 5)
  556. #define ISPCTRL_SHIFT_SHIFT 6
  557. #define ISPCTRL_SHIFT_0 (0x0 << 6)
  558. #define ISPCTRL_SHIFT_2 (0x1 << 6)
  559. #define ISPCTRL_SHIFT_4 (0x2 << 6)
  560. #define ISPCTRL_SHIFT_MASK (0x3 << 6)
  561. #define ISPCTRL_CCDC_CLK_EN (1 << 8)
  562. #define ISPCTRL_SCMP_CLK_EN (1 << 9)
  563. #define ISPCTRL_H3A_CLK_EN (1 << 10)
  564. #define ISPCTRL_HIST_CLK_EN (1 << 11)
  565. #define ISPCTRL_PREV_CLK_EN (1 << 12)
  566. #define ISPCTRL_RSZ_CLK_EN (1 << 13)
  567. #define ISPCTRL_SYNC_DETECT_SHIFT 14
  568. #define ISPCTRL_SYNC_DETECT_HSFALL (0x0 << ISPCTRL_SYNC_DETECT_SHIFT)
  569. #define ISPCTRL_SYNC_DETECT_HSRISE (0x1 << ISPCTRL_SYNC_DETECT_SHIFT)
  570. #define ISPCTRL_SYNC_DETECT_VSFALL (0x2 << ISPCTRL_SYNC_DETECT_SHIFT)
  571. #define ISPCTRL_SYNC_DETECT_VSRISE (0x3 << ISPCTRL_SYNC_DETECT_SHIFT)
  572. #define ISPCTRL_SYNC_DETECT_MASK (0x3 << ISPCTRL_SYNC_DETECT_SHIFT)
  573. #define ISPCTRL_CCDC_RAM_EN (1 << 16)
  574. #define ISPCTRL_PREV_RAM_EN (1 << 17)
  575. #define ISPCTRL_SBL_RD_RAM_EN (1 << 18)
  576. #define ISPCTRL_SBL_WR1_RAM_EN (1 << 19)
  577. #define ISPCTRL_SBL_WR0_RAM_EN (1 << 20)
  578. #define ISPCTRL_SBL_AUTOIDLE (1 << 21)
  579. #define ISPCTRL_SBL_SHARED_WPORTC (1 << 26)
  580. #define ISPCTRL_SBL_SHARED_RPORTA (1 << 27)
  581. #define ISPCTRL_SBL_SHARED_RPORTB (1 << 28)
  582. #define ISPCTRL_JPEG_FLUSH (1 << 30)
  583. #define ISPCTRL_CCDC_FLUSH (1 << 31)
  584. #define ISPSECURE_SECUREMODE 0
  585. #define ISPTCTRL_CTRL_DIV_LOW 0x0
  586. #define ISPTCTRL_CTRL_DIV_HIGH 0x1
  587. #define ISPTCTRL_CTRL_DIV_BYPASS 0x1F
  588. #define ISPTCTRL_CTRL_DIVA_SHIFT 0
  589. #define ISPTCTRL_CTRL_DIVA_MASK (0x1F << ISPTCTRL_CTRL_DIVA_SHIFT)
  590. #define ISPTCTRL_CTRL_DIVB_SHIFT 5
  591. #define ISPTCTRL_CTRL_DIVB_MASK (0x1F << ISPTCTRL_CTRL_DIVB_SHIFT)
  592. #define ISPTCTRL_CTRL_DIVC_SHIFT 10
  593. #define ISPTCTRL_CTRL_DIVC_NOCLOCK (0x0 << 10)
  594. #define ISPTCTRL_CTRL_SHUTEN (1 << 21)
  595. #define ISPTCTRL_CTRL_PSTRBEN (1 << 22)
  596. #define ISPTCTRL_CTRL_STRBEN (1 << 23)
  597. #define ISPTCTRL_CTRL_SHUTPOL (1 << 24)
  598. #define ISPTCTRL_CTRL_STRBPSTRBPOL (1 << 26)
  599. #define ISPTCTRL_CTRL_INSEL_SHIFT 27
  600. #define ISPTCTRL_CTRL_INSEL_PARALLEL (0x0 << 27)
  601. #define ISPTCTRL_CTRL_INSEL_CSIA (0x1 << 27)
  602. #define ISPTCTRL_CTRL_INSEL_CSIB (0x2 << 27)
  603. #define ISPTCTRL_CTRL_GRESETEn (1 << 29)
  604. #define ISPTCTRL_CTRL_GRESETPOL (1 << 30)
  605. #define ISPTCTRL_CTRL_GRESETDIR (1 << 31)
  606. #define ISPTCTRL_FRAME_SHUT_SHIFT 0
  607. #define ISPTCTRL_FRAME_PSTRB_SHIFT 6
  608. #define ISPTCTRL_FRAME_STRB_SHIFT 12
  609. #define ISPCCDC_PID_PREV_SHIFT 0
  610. #define ISPCCDC_PID_CID_SHIFT 8
  611. #define ISPCCDC_PID_TID_SHIFT 16
  612. #define ISPCCDC_PCR_EN 1
  613. #define ISPCCDC_PCR_BUSY (1 << 1)
  614. #define ISPCCDC_SYN_MODE_VDHDOUT 0x1
  615. #define ISPCCDC_SYN_MODE_FLDOUT (1 << 1)
  616. #define ISPCCDC_SYN_MODE_VDPOL (1 << 2)
  617. #define ISPCCDC_SYN_MODE_HDPOL (1 << 3)
  618. #define ISPCCDC_SYN_MODE_FLDPOL (1 << 4)
  619. #define ISPCCDC_SYN_MODE_EXWEN (1 << 5)
  620. #define ISPCCDC_SYN_MODE_DATAPOL (1 << 6)
  621. #define ISPCCDC_SYN_MODE_FLDMODE (1 << 7)
  622. #define ISPCCDC_SYN_MODE_DATSIZ_MASK (0x7 << 8)
  623. #define ISPCCDC_SYN_MODE_DATSIZ_8_16 (0x0 << 8)
  624. #define ISPCCDC_SYN_MODE_DATSIZ_12 (0x4 << 8)
  625. #define ISPCCDC_SYN_MODE_DATSIZ_11 (0x5 << 8)
  626. #define ISPCCDC_SYN_MODE_DATSIZ_10 (0x6 << 8)
  627. #define ISPCCDC_SYN_MODE_DATSIZ_8 (0x7 << 8)
  628. #define ISPCCDC_SYN_MODE_PACK8 (1 << 11)
  629. #define ISPCCDC_SYN_MODE_INPMOD_MASK (3 << 12)
  630. #define ISPCCDC_SYN_MODE_INPMOD_RAW (0 << 12)
  631. #define ISPCCDC_SYN_MODE_INPMOD_YCBCR16 (1 << 12)
  632. #define ISPCCDC_SYN_MODE_INPMOD_YCBCR8 (2 << 12)
  633. #define ISPCCDC_SYN_MODE_LPF (1 << 14)
  634. #define ISPCCDC_SYN_MODE_FLDSTAT (1 << 15)
  635. #define ISPCCDC_SYN_MODE_VDHDEN (1 << 16)
  636. #define ISPCCDC_SYN_MODE_WEN (1 << 17)
  637. #define ISPCCDC_SYN_MODE_VP2SDR (1 << 18)
  638. #define ISPCCDC_SYN_MODE_SDR2RSZ (1 << 19)
  639. #define ISPCCDC_HD_VD_WID_VDW_SHIFT 0
  640. #define ISPCCDC_HD_VD_WID_HDW_SHIFT 16
  641. #define ISPCCDC_PIX_LINES_HLPRF_SHIFT 0
  642. #define ISPCCDC_PIX_LINES_PPLN_SHIFT 16
  643. #define ISPCCDC_HORZ_INFO_NPH_SHIFT 0
  644. #define ISPCCDC_HORZ_INFO_NPH_MASK 0x00007fff
  645. #define ISPCCDC_HORZ_INFO_SPH_SHIFT 16
  646. #define ISPCCDC_HORZ_INFO_SPH_MASK 0x7fff0000
  647. #define ISPCCDC_VERT_START_SLV1_SHIFT 0
  648. #define ISPCCDC_VERT_START_SLV0_SHIFT 16
  649. #define ISPCCDC_VERT_START_SLV0_MASK 0x7fff0000
  650. #define ISPCCDC_VERT_LINES_NLV_SHIFT 0
  651. #define ISPCCDC_VERT_LINES_NLV_MASK 0x00007fff
  652. #define ISPCCDC_CULLING_CULV_SHIFT 0
  653. #define ISPCCDC_CULLING_CULHODD_SHIFT 16
  654. #define ISPCCDC_CULLING_CULHEVN_SHIFT 24
  655. #define ISPCCDC_HSIZE_OFF_SHIFT 0
  656. #define ISPCCDC_SDOFST_FIINV (1 << 14)
  657. #define ISPCCDC_SDOFST_FOFST_SHIFT 12
  658. #define ISPCCDC_SDOFST_FOFST_MASK (3 << 12)
  659. #define ISPCCDC_SDOFST_LOFST3_SHIFT 0
  660. #define ISPCCDC_SDOFST_LOFST2_SHIFT 3
  661. #define ISPCCDC_SDOFST_LOFST1_SHIFT 6
  662. #define ISPCCDC_SDOFST_LOFST0_SHIFT 9
  663. #define ISPCCDC_CLAMP_OBGAIN_SHIFT 0
  664. #define ISPCCDC_CLAMP_OBST_SHIFT 10
  665. #define ISPCCDC_CLAMP_OBSLN_SHIFT 25
  666. #define ISPCCDC_CLAMP_OBSLEN_SHIFT 28
  667. #define ISPCCDC_CLAMP_CLAMPEN (1 << 31)
  668. #define ISPCCDC_COLPTN_R_Ye 0x0
  669. #define ISPCCDC_COLPTN_Gr_Cy 0x1
  670. #define ISPCCDC_COLPTN_Gb_G 0x2
  671. #define ISPCCDC_COLPTN_B_Mg 0x3
  672. #define ISPCCDC_COLPTN_CP0PLC0_SHIFT 0
  673. #define ISPCCDC_COLPTN_CP0PLC1_SHIFT 2
  674. #define ISPCCDC_COLPTN_CP0PLC2_SHIFT 4
  675. #define ISPCCDC_COLPTN_CP0PLC3_SHIFT 6
  676. #define ISPCCDC_COLPTN_CP1PLC0_SHIFT 8
  677. #define ISPCCDC_COLPTN_CP1PLC1_SHIFT 10
  678. #define ISPCCDC_COLPTN_CP1PLC2_SHIFT 12
  679. #define ISPCCDC_COLPTN_CP1PLC3_SHIFT 14
  680. #define ISPCCDC_COLPTN_CP2PLC0_SHIFT 16
  681. #define ISPCCDC_COLPTN_CP2PLC1_SHIFT 18
  682. #define ISPCCDC_COLPTN_CP2PLC2_SHIFT 20
  683. #define ISPCCDC_COLPTN_CP2PLC3_SHIFT 22
  684. #define ISPCCDC_COLPTN_CP3PLC0_SHIFT 24
  685. #define ISPCCDC_COLPTN_CP3PLC1_SHIFT 26
  686. #define ISPCCDC_COLPTN_CP3PLC2_SHIFT 28
  687. #define ISPCCDC_COLPTN_CP3PLC3_SHIFT 30
  688. #define ISPCCDC_BLKCMP_B_MG_SHIFT 0
  689. #define ISPCCDC_BLKCMP_GB_G_SHIFT 8
  690. #define ISPCCDC_BLKCMP_GR_CY_SHIFT 16
  691. #define ISPCCDC_BLKCMP_R_YE_SHIFT 24
  692. #define ISPCCDC_FPC_FPNUM_SHIFT 0
  693. #define ISPCCDC_FPC_FPCEN (1 << 15)
  694. #define ISPCCDC_FPC_FPERR (1 << 16)
  695. #define ISPCCDC_VDINT_1_SHIFT 0
  696. #define ISPCCDC_VDINT_1_MASK 0x00007fff
  697. #define ISPCCDC_VDINT_0_SHIFT 16
  698. #define ISPCCDC_VDINT_0_MASK 0x7fff0000
  699. #define ISPCCDC_ALAW_GWDI_12_3 (0x3 << 0)
  700. #define ISPCCDC_ALAW_GWDI_11_2 (0x4 << 0)
  701. #define ISPCCDC_ALAW_GWDI_10_1 (0x5 << 0)
  702. #define ISPCCDC_ALAW_GWDI_9_0 (0x6 << 0)
  703. #define ISPCCDC_ALAW_CCDTBL (1 << 3)
  704. #define ISPCCDC_REC656IF_R656ON 1
  705. #define ISPCCDC_REC656IF_ECCFVH (1 << 1)
  706. #define ISPCCDC_CFG_BW656 (1 << 5)
  707. #define ISPCCDC_CFG_FIDMD_SHIFT 6
  708. #define ISPCCDC_CFG_WENLOG (1 << 8)
  709. #define ISPCCDC_CFG_WENLOG_AND (0 << 8)
  710. #define ISPCCDC_CFG_WENLOG_OR (1 << 8)
  711. #define ISPCCDC_CFG_Y8POS (1 << 11)
  712. #define ISPCCDC_CFG_BSWD (1 << 12)
  713. #define ISPCCDC_CFG_MSBINVI (1 << 13)
  714. #define ISPCCDC_CFG_VDLC (1 << 15)
  715. #define ISPCCDC_FMTCFG_FMTEN 0x1
  716. #define ISPCCDC_FMTCFG_LNALT (1 << 1)
  717. #define ISPCCDC_FMTCFG_LNUM_SHIFT 2
  718. #define ISPCCDC_FMTCFG_PLEN_ODD_SHIFT 4
  719. #define ISPCCDC_FMTCFG_PLEN_EVEN_SHIFT 8
  720. #define ISPCCDC_FMTCFG_VPIN_MASK 0x00007000
  721. #define ISPCCDC_FMTCFG_VPIN_12_3 (0x3 << 12)
  722. #define ISPCCDC_FMTCFG_VPIN_11_2 (0x4 << 12)
  723. #define ISPCCDC_FMTCFG_VPIN_10_1 (0x5 << 12)
  724. #define ISPCCDC_FMTCFG_VPIN_9_0 (0x6 << 12)
  725. #define ISPCCDC_FMTCFG_VPEN (1 << 15)
  726. #define ISPCCDC_FMTCFG_VPIF_FRQ_MASK 0x003f0000
  727. #define ISPCCDC_FMTCFG_VPIF_FRQ_SHIFT 16
  728. #define ISPCCDC_FMTCFG_VPIF_FRQ_BY2 (0x0 << 16)
  729. #define ISPCCDC_FMTCFG_VPIF_FRQ_BY3 (0x1 << 16)
  730. #define ISPCCDC_FMTCFG_VPIF_FRQ_BY4 (0x2 << 16)
  731. #define ISPCCDC_FMTCFG_VPIF_FRQ_BY5 (0x3 << 16)
  732. #define ISPCCDC_FMTCFG_VPIF_FRQ_BY6 (0x4 << 16)
  733. #define ISPCCDC_FMT_HORZ_FMTLNH_SHIFT 0
  734. #define ISPCCDC_FMT_HORZ_FMTSPH_SHIFT 16
  735. #define ISPCCDC_FMT_VERT_FMTLNV_SHIFT 0
  736. #define ISPCCDC_FMT_VERT_FMTSLV_SHIFT 16
  737. #define ISPCCDC_FMT_HORZ_FMTSPH_MASK 0x1fff0000
  738. #define ISPCCDC_FMT_HORZ_FMTLNH_MASK 0x00001fff
  739. #define ISPCCDC_FMT_VERT_FMTSLV_MASK 0x1fff0000
  740. #define ISPCCDC_FMT_VERT_FMTLNV_MASK 0x00001fff
  741. #define ISPCCDC_VP_OUT_HORZ_ST_SHIFT 0
  742. #define ISPCCDC_VP_OUT_HORZ_NUM_SHIFT 4
  743. #define ISPCCDC_VP_OUT_VERT_NUM_SHIFT 17
  744. #define ISPRSZ_PID_PREV_SHIFT 0
  745. #define ISPRSZ_PID_CID_SHIFT 8
  746. #define ISPRSZ_PID_TID_SHIFT 16
  747. #define ISPRSZ_PCR_ENABLE (1 << 0)
  748. #define ISPRSZ_PCR_BUSY (1 << 1)
  749. #define ISPRSZ_PCR_ONESHOT (1 << 2)
  750. #define ISPRSZ_CNT_HRSZ_SHIFT 0
  751. #define ISPRSZ_CNT_HRSZ_MASK \
  752. (0x3FF << ISPRSZ_CNT_HRSZ_SHIFT)
  753. #define ISPRSZ_CNT_VRSZ_SHIFT 10
  754. #define ISPRSZ_CNT_VRSZ_MASK \
  755. (0x3FF << ISPRSZ_CNT_VRSZ_SHIFT)
  756. #define ISPRSZ_CNT_HSTPH_SHIFT 20
  757. #define ISPRSZ_CNT_HSTPH_MASK (0x7 << ISPRSZ_CNT_HSTPH_SHIFT)
  758. #define ISPRSZ_CNT_VSTPH_SHIFT 23
  759. #define ISPRSZ_CNT_VSTPH_MASK (0x7 << ISPRSZ_CNT_VSTPH_SHIFT)
  760. #define ISPRSZ_CNT_YCPOS (1 << 26)
  761. #define ISPRSZ_CNT_INPTYP (1 << 27)
  762. #define ISPRSZ_CNT_INPSRC (1 << 28)
  763. #define ISPRSZ_CNT_CBILIN (1 << 29)
  764. #define ISPRSZ_OUT_SIZE_HORZ_SHIFT 0
  765. #define ISPRSZ_OUT_SIZE_HORZ_MASK \
  766. (0xFFF << ISPRSZ_OUT_SIZE_HORZ_SHIFT)
  767. #define ISPRSZ_OUT_SIZE_VERT_SHIFT 16
  768. #define ISPRSZ_OUT_SIZE_VERT_MASK \
  769. (0xFFF << ISPRSZ_OUT_SIZE_VERT_SHIFT)
  770. #define ISPRSZ_IN_START_HORZ_ST_SHIFT 0
  771. #define ISPRSZ_IN_START_HORZ_ST_MASK \
  772. (0x1FFF << ISPRSZ_IN_START_HORZ_ST_SHIFT)
  773. #define ISPRSZ_IN_START_VERT_ST_SHIFT 16
  774. #define ISPRSZ_IN_START_VERT_ST_MASK \
  775. (0x1FFF << ISPRSZ_IN_START_VERT_ST_SHIFT)
  776. #define ISPRSZ_IN_SIZE_HORZ_SHIFT 0
  777. #define ISPRSZ_IN_SIZE_HORZ_MASK \
  778. (0x1FFF << ISPRSZ_IN_SIZE_HORZ_SHIFT)
  779. #define ISPRSZ_IN_SIZE_VERT_SHIFT 16
  780. #define ISPRSZ_IN_SIZE_VERT_MASK \
  781. (0x1FFF << ISPRSZ_IN_SIZE_VERT_SHIFT)
  782. #define ISPRSZ_SDR_INADD_ADDR_SHIFT 0
  783. #define ISPRSZ_SDR_INADD_ADDR_MASK 0xFFFFFFFF
  784. #define ISPRSZ_SDR_INOFF_OFFSET_SHIFT 0
  785. #define ISPRSZ_SDR_INOFF_OFFSET_MASK \
  786. (0xFFFF << ISPRSZ_SDR_INOFF_OFFSET_SHIFT)
  787. #define ISPRSZ_SDR_OUTADD_ADDR_SHIFT 0
  788. #define ISPRSZ_SDR_OUTADD_ADDR_MASK 0xFFFFFFFF
  789. #define ISPRSZ_SDR_OUTOFF_OFFSET_SHIFT 0
  790. #define ISPRSZ_SDR_OUTOFF_OFFSET_MASK \
  791. (0xFFFF << ISPRSZ_SDR_OUTOFF_OFFSET_SHIFT)
  792. #define ISPRSZ_HFILT_COEF0_SHIFT 0
  793. #define ISPRSZ_HFILT_COEF0_MASK \
  794. (0x3FF << ISPRSZ_HFILT_COEF0_SHIFT)
  795. #define ISPRSZ_HFILT_COEF1_SHIFT 16
  796. #define ISPRSZ_HFILT_COEF1_MASK \
  797. (0x3FF << ISPRSZ_HFILT_COEF1_SHIFT)
  798. #define ISPRSZ_HFILT32_COEF2_SHIFT 0
  799. #define ISPRSZ_HFILT32_COEF2_MASK 0x3FF
  800. #define ISPRSZ_HFILT32_COEF3_SHIFT 16
  801. #define ISPRSZ_HFILT32_COEF3_MASK 0x3FF0000
  802. #define ISPRSZ_HFILT54_COEF4_SHIFT 0
  803. #define ISPRSZ_HFILT54_COEF4_MASK 0x3FF
  804. #define ISPRSZ_HFILT54_COEF5_SHIFT 16
  805. #define ISPRSZ_HFILT54_COEF5_MASK 0x3FF0000
  806. #define ISPRSZ_HFILT76_COEFF6_SHIFT 0
  807. #define ISPRSZ_HFILT76_COEFF6_MASK 0x3FF
  808. #define ISPRSZ_HFILT76_COEFF7_SHIFT 16
  809. #define ISPRSZ_HFILT76_COEFF7_MASK 0x3FF0000
  810. #define ISPRSZ_HFILT98_COEFF8_SHIFT 0
  811. #define ISPRSZ_HFILT98_COEFF8_MASK 0x3FF
  812. #define ISPRSZ_HFILT98_COEFF9_SHIFT 16
  813. #define ISPRSZ_HFILT98_COEFF9_MASK 0x3FF0000
  814. #define ISPRSZ_HFILT1110_COEF10_SHIFT 0
  815. #define ISPRSZ_HFILT1110_COEF10_MASK 0x3FF
  816. #define ISPRSZ_HFILT1110_COEF11_SHIFT 16
  817. #define ISPRSZ_HFILT1110_COEF11_MASK 0x3FF0000
  818. #define ISPRSZ_HFILT1312_COEFF12_SHIFT 0
  819. #define ISPRSZ_HFILT1312_COEFF12_MASK 0x3FF
  820. #define ISPRSZ_HFILT1312_COEFF13_SHIFT 16
  821. #define ISPRSZ_HFILT1312_COEFF13_MASK 0x3FF0000
  822. #define ISPRSZ_HFILT1514_COEFF14_SHIFT 0
  823. #define ISPRSZ_HFILT1514_COEFF14_MASK 0x3FF
  824. #define ISPRSZ_HFILT1514_COEFF15_SHIFT 16
  825. #define ISPRSZ_HFILT1514_COEFF15_MASK 0x3FF0000
  826. #define ISPRSZ_HFILT1716_COEF16_SHIFT 0
  827. #define ISPRSZ_HFILT1716_COEF16_MASK 0x3FF
  828. #define ISPRSZ_HFILT1716_COEF17_SHIFT 16
  829. #define ISPRSZ_HFILT1716_COEF17_MASK 0x3FF0000
  830. #define ISPRSZ_HFILT1918_COEF18_SHIFT 0
  831. #define ISPRSZ_HFILT1918_COEF18_MASK 0x3FF
  832. #define ISPRSZ_HFILT1918_COEF19_SHIFT 16
  833. #define ISPRSZ_HFILT1918_COEF19_MASK 0x3FF0000
  834. #define ISPRSZ_HFILT2120_COEF20_SHIFT 0
  835. #define ISPRSZ_HFILT2120_COEF20_MASK 0x3FF
  836. #define ISPRSZ_HFILT2120_COEF21_SHIFT 16
  837. #define ISPRSZ_HFILT2120_COEF21_MASK 0x3FF0000
  838. #define ISPRSZ_HFILT2322_COEF22_SHIFT 0
  839. #define ISPRSZ_HFILT2322_COEF22_MASK 0x3FF
  840. #define ISPRSZ_HFILT2322_COEF23_SHIFT 16
  841. #define ISPRSZ_HFILT2322_COEF23_MASK 0x3FF0000
  842. #define ISPRSZ_HFILT2524_COEF24_SHIFT 0
  843. #define ISPRSZ_HFILT2524_COEF24_MASK 0x3FF
  844. #define ISPRSZ_HFILT2524_COEF25_SHIFT 16
  845. #define ISPRSZ_HFILT2524_COEF25_MASK 0x3FF0000
  846. #define ISPRSZ_HFILT2726_COEF26_SHIFT 0
  847. #define ISPRSZ_HFILT2726_COEF26_MASK 0x3FF
  848. #define ISPRSZ_HFILT2726_COEF27_SHIFT 16
  849. #define ISPRSZ_HFILT2726_COEF27_MASK 0x3FF0000
  850. #define ISPRSZ_HFILT2928_COEF28_SHIFT 0
  851. #define ISPRSZ_HFILT2928_COEF28_MASK 0x3FF
  852. #define ISPRSZ_HFILT2928_COEF29_SHIFT 16
  853. #define ISPRSZ_HFILT2928_COEF29_MASK 0x3FF0000
  854. #define ISPRSZ_HFILT3130_COEF30_SHIFT 0
  855. #define ISPRSZ_HFILT3130_COEF30_MASK 0x3FF
  856. #define ISPRSZ_HFILT3130_COEF31_SHIFT 16
  857. #define ISPRSZ_HFILT3130_COEF31_MASK 0x3FF0000
  858. #define ISPRSZ_VFILT_COEF0_SHIFT 0
  859. #define ISPRSZ_VFILT_COEF0_MASK \
  860. (0x3FF << ISPRSZ_VFILT_COEF0_SHIFT)
  861. #define ISPRSZ_VFILT_COEF1_SHIFT 16
  862. #define ISPRSZ_VFILT_COEF1_MASK \
  863. (0x3FF << ISPRSZ_VFILT_COEF1_SHIFT)
  864. #define ISPRSZ_VFILT10_COEF0_SHIFT 0
  865. #define ISPRSZ_VFILT10_COEF0_MASK 0x3FF
  866. #define ISPRSZ_VFILT10_COEF1_SHIFT 16
  867. #define ISPRSZ_VFILT10_COEF1_MASK 0x3FF0000
  868. #define ISPRSZ_VFILT32_COEF2_SHIFT 0
  869. #define ISPRSZ_VFILT32_COEF2_MASK 0x3FF
  870. #define ISPRSZ_VFILT32_COEF3_SHIFT 16
  871. #define ISPRSZ_VFILT32_COEF3_MASK 0x3FF0000
  872. #define ISPRSZ_VFILT54_COEF4_SHIFT 0
  873. #define ISPRSZ_VFILT54_COEF4_MASK 0x3FF
  874. #define ISPRSZ_VFILT54_COEF5_SHIFT 16
  875. #define ISPRSZ_VFILT54_COEF5_MASK 0x3FF0000
  876. #define ISPRSZ_VFILT76_COEFF6_SHIFT 0
  877. #define ISPRSZ_VFILT76_COEFF6_MASK 0x3FF
  878. #define ISPRSZ_VFILT76_COEFF7_SHIFT 16
  879. #define ISPRSZ_VFILT76_COEFF7_MASK 0x3FF0000
  880. #define ISPRSZ_VFILT98_COEFF8_SHIFT 0
  881. #define ISPRSZ_VFILT98_COEFF8_MASK 0x3FF
  882. #define ISPRSZ_VFILT98_COEFF9_SHIFT 16
  883. #define ISPRSZ_VFILT98_COEFF9_MASK 0x3FF0000
  884. #define ISPRSZ_VFILT1110_COEF10_SHIFT 0
  885. #define ISPRSZ_VFILT1110_COEF10_MASK 0x3FF
  886. #define ISPRSZ_VFILT1110_COEF11_SHIFT 16
  887. #define ISPRSZ_VFILT1110_COEF11_MASK 0x3FF0000
  888. #define ISPRSZ_VFILT1312_COEFF12_SHIFT 0
  889. #define ISPRSZ_VFILT1312_COEFF12_MASK 0x3FF
  890. #define ISPRSZ_VFILT1312_COEFF13_SHIFT 16
  891. #define ISPRSZ_VFILT1312_COEFF13_MASK 0x3FF0000
  892. #define ISPRSZ_VFILT1514_COEFF14_SHIFT 0
  893. #define ISPRSZ_VFILT1514_COEFF14_MASK 0x3FF
  894. #define ISPRSZ_VFILT1514_COEFF15_SHIFT 16
  895. #define ISPRSZ_VFILT1514_COEFF15_MASK 0x3FF0000
  896. #define ISPRSZ_VFILT1716_COEF16_SHIFT 0
  897. #define ISPRSZ_VFILT1716_COEF16_MASK 0x3FF
  898. #define ISPRSZ_VFILT1716_COEF17_SHIFT 16
  899. #define ISPRSZ_VFILT1716_COEF17_MASK 0x3FF0000
  900. #define ISPRSZ_VFILT1918_COEF18_SHIFT 0
  901. #define ISPRSZ_VFILT1918_COEF18_MASK 0x3FF
  902. #define ISPRSZ_VFILT1918_COEF19_SHIFT 16
  903. #define ISPRSZ_VFILT1918_COEF19_MASK 0x3FF0000
  904. #define ISPRSZ_VFILT2120_COEF20_SHIFT 0
  905. #define ISPRSZ_VFILT2120_COEF20_MASK 0x3FF
  906. #define ISPRSZ_VFILT2120_COEF21_SHIFT 16
  907. #define ISPRSZ_VFILT2120_COEF21_MASK 0x3FF0000
  908. #define ISPRSZ_VFILT2322_COEF22_SHIFT 0
  909. #define ISPRSZ_VFILT2322_COEF22_MASK 0x3FF
  910. #define ISPRSZ_VFILT2322_COEF23_SHIFT 16
  911. #define ISPRSZ_VFILT2322_COEF23_MASK 0x3FF0000
  912. #define ISPRSZ_VFILT2524_COEF24_SHIFT 0
  913. #define ISPRSZ_VFILT2524_COEF24_MASK 0x3FF
  914. #define ISPRSZ_VFILT2524_COEF25_SHIFT 16
  915. #define ISPRSZ_VFILT2524_COEF25_MASK 0x3FF0000
  916. #define ISPRSZ_VFILT2726_COEF26_SHIFT 0
  917. #define ISPRSZ_VFILT2726_COEF26_MASK 0x3FF
  918. #define ISPRSZ_VFILT2726_COEF27_SHIFT 16
  919. #define ISPRSZ_VFILT2726_COEF27_MASK 0x3FF0000
  920. #define ISPRSZ_VFILT2928_COEF28_SHIFT 0
  921. #define ISPRSZ_VFILT2928_COEF28_MASK 0x3FF
  922. #define ISPRSZ_VFILT2928_COEF29_SHIFT 16
  923. #define ISPRSZ_VFILT2928_COEF29_MASK 0x3FF0000
  924. #define ISPRSZ_VFILT3130_COEF30_SHIFT 0
  925. #define ISPRSZ_VFILT3130_COEF30_MASK 0x3FF
  926. #define ISPRSZ_VFILT3130_COEF31_SHIFT 16
  927. #define ISPRSZ_VFILT3130_COEF31_MASK 0x3FF0000
  928. #define ISPRSZ_YENH_CORE_SHIFT 0
  929. #define ISPRSZ_YENH_CORE_MASK \
  930. (0xFF << ISPRSZ_YENH_CORE_SHIFT)
  931. #define ISPRSZ_YENH_SLOP_SHIFT 8
  932. #define ISPRSZ_YENH_SLOP_MASK \
  933. (0xF << ISPRSZ_YENH_SLOP_SHIFT)
  934. #define ISPRSZ_YENH_GAIN_SHIFT 12
  935. #define ISPRSZ_YENH_GAIN_MASK \
  936. (0xF << ISPRSZ_YENH_GAIN_SHIFT)
  937. #define ISPRSZ_YENH_ALGO_SHIFT 16
  938. #define ISPRSZ_YENH_ALGO_MASK \
  939. (0x3 << ISPRSZ_YENH_ALGO_SHIFT)
  940. #define ISPH3A_PCR_AEW_ALAW_EN_SHIFT 1
  941. #define ISPH3A_PCR_AF_MED_TH_SHIFT 3
  942. #define ISPH3A_PCR_AF_RGBPOS_SHIFT 11
  943. #define ISPH3A_PCR_AEW_AVE2LMT_SHIFT 22
  944. #define ISPH3A_PCR_AEW_AVE2LMT_MASK 0xFFC00000
  945. #define ISPH3A_PCR_BUSYAF (1 << 15)
  946. #define ISPH3A_PCR_BUSYAEAWB (1 << 18)
  947. #define ISPH3A_AEWWIN1_WINHC_SHIFT 0
  948. #define ISPH3A_AEWWIN1_WINHC_MASK 0x3F
  949. #define ISPH3A_AEWWIN1_WINVC_SHIFT 6
  950. #define ISPH3A_AEWWIN1_WINVC_MASK 0x1FC0
  951. #define ISPH3A_AEWWIN1_WINW_SHIFT 13
  952. #define ISPH3A_AEWWIN1_WINW_MASK 0xFE000
  953. #define ISPH3A_AEWWIN1_WINH_SHIFT 24
  954. #define ISPH3A_AEWWIN1_WINH_MASK 0x7F000000
  955. #define ISPH3A_AEWINSTART_WINSH_SHIFT 0
  956. #define ISPH3A_AEWINSTART_WINSH_MASK 0x0FFF
  957. #define ISPH3A_AEWINSTART_WINSV_SHIFT 16
  958. #define ISPH3A_AEWINSTART_WINSV_MASK 0x0FFF0000
  959. #define ISPH3A_AEWINBLK_WINH_SHIFT 0
  960. #define ISPH3A_AEWINBLK_WINH_MASK 0x7F
  961. #define ISPH3A_AEWINBLK_WINSV_SHIFT 16
  962. #define ISPH3A_AEWINBLK_WINSV_MASK 0x0FFF0000
  963. #define ISPH3A_AEWSUBWIN_AEWINCH_SHIFT 0
  964. #define ISPH3A_AEWSUBWIN_AEWINCH_MASK 0x0F
  965. #define ISPH3A_AEWSUBWIN_AEWINCV_SHIFT 8
  966. #define ISPH3A_AEWSUBWIN_AEWINCV_MASK 0x0F00
  967. #define ISPHIST_PCR_ENABLE_SHIFT 0
  968. #define ISPHIST_PCR_ENABLE_MASK 0x01
  969. #define ISPHIST_PCR_ENABLE (1 << ISPHIST_PCR_ENABLE_SHIFT)
  970. #define ISPHIST_PCR_BUSY 0x02
  971. #define ISPHIST_CNT_DATASIZE_SHIFT 8
  972. #define ISPHIST_CNT_DATASIZE_MASK 0x0100
  973. #define ISPHIST_CNT_CLEAR_SHIFT 7
  974. #define ISPHIST_CNT_CLEAR_MASK 0x080
  975. #define ISPHIST_CNT_CLEAR (1 << ISPHIST_CNT_CLEAR_SHIFT)
  976. #define ISPHIST_CNT_CFA_SHIFT 6
  977. #define ISPHIST_CNT_CFA_MASK 0x040
  978. #define ISPHIST_CNT_BINS_SHIFT 4
  979. #define ISPHIST_CNT_BINS_MASK 0x030
  980. #define ISPHIST_CNT_SOURCE_SHIFT 3
  981. #define ISPHIST_CNT_SOURCE_MASK 0x08
  982. #define ISPHIST_CNT_SHIFT_SHIFT 0
  983. #define ISPHIST_CNT_SHIFT_MASK 0x07
  984. #define ISPHIST_WB_GAIN_WG00_SHIFT 24
  985. #define ISPHIST_WB_GAIN_WG00_MASK 0xFF000000
  986. #define ISPHIST_WB_GAIN_WG01_SHIFT 16
  987. #define ISPHIST_WB_GAIN_WG01_MASK 0xFF0000
  988. #define ISPHIST_WB_GAIN_WG02_SHIFT 8
  989. #define ISPHIST_WB_GAIN_WG02_MASK 0xFF00
  990. #define ISPHIST_WB_GAIN_WG03_SHIFT 0
  991. #define ISPHIST_WB_GAIN_WG03_MASK 0xFF
  992. #define ISPHIST_REG_START_END_MASK 0x3FFF
  993. #define ISPHIST_REG_START_SHIFT 16
  994. #define ISPHIST_REG_END_SHIFT 0
  995. #define ISPHIST_REG_START_MASK (ISPHIST_REG_START_END_MASK << \
  996. ISPHIST_REG_START_SHIFT)
  997. #define ISPHIST_REG_END_MASK (ISPHIST_REG_START_END_MASK << \
  998. ISPHIST_REG_END_SHIFT)
  999. #define ISPHIST_REG_MASK (ISPHIST_REG_START_MASK | \
  1000. ISPHIST_REG_END_MASK)
  1001. #define ISPHIST_ADDR_SHIFT 0
  1002. #define ISPHIST_ADDR_MASK 0x3FF
  1003. #define ISPHIST_DATA_SHIFT 0
  1004. #define ISPHIST_DATA_MASK 0xFFFFF
  1005. #define ISPHIST_RADD_SHIFT 0
  1006. #define ISPHIST_RADD_MASK 0xFFFFFFFF
  1007. #define ISPHIST_RADD_OFF_SHIFT 0
  1008. #define ISPHIST_RADD_OFF_MASK 0xFFFF
  1009. #define ISPHIST_HV_INFO_HSIZE_SHIFT 16
  1010. #define ISPHIST_HV_INFO_HSIZE_MASK 0x3FFF0000
  1011. #define ISPHIST_HV_INFO_VSIZE_SHIFT 0
  1012. #define ISPHIST_HV_INFO_VSIZE_MASK 0x3FFF
  1013. #define ISPHIST_HV_INFO_MASK 0x3FFF3FFF
  1014. #define ISPCCDC_LSC_ENABLE 1
  1015. #define ISPCCDC_LSC_BUSY (1 << 7)
  1016. #define ISPCCDC_LSC_GAIN_MODE_N_MASK 0x700
  1017. #define ISPCCDC_LSC_GAIN_MODE_N_SHIFT 8
  1018. #define ISPCCDC_LSC_GAIN_MODE_M_MASK 0x3800
  1019. #define ISPCCDC_LSC_GAIN_MODE_M_SHIFT 12
  1020. #define ISPCCDC_LSC_GAIN_FORMAT_MASK 0xE
  1021. #define ISPCCDC_LSC_GAIN_FORMAT_SHIFT 1
  1022. #define ISPCCDC_LSC_AFTER_REFORMATTER_MASK (1<<6)
  1023. #define ISPCCDC_LSC_INITIAL_X_MASK 0x3F
  1024. #define ISPCCDC_LSC_INITIAL_X_SHIFT 0
  1025. #define ISPCCDC_LSC_INITIAL_Y_MASK 0x3F0000
  1026. #define ISPCCDC_LSC_INITIAL_Y_SHIFT 16
  1027. /* -----------------------------------------------------------------------------
  1028. * CSI2 receiver registers (ES2.0)
  1029. */
  1030. #define ISPCSI2_REVISION (0x000)
  1031. #define ISPCSI2_SYSCONFIG (0x010)
  1032. #define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT 12
  1033. #define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_MASK \
  1034. (0x3 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  1035. #define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_FORCE \
  1036. (0x0 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  1037. #define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_NO \
  1038. (0x1 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  1039. #define ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SMART \
  1040. (0x2 << ISPCSI2_SYSCONFIG_MSTANDBY_MODE_SHIFT)
  1041. #define ISPCSI2_SYSCONFIG_SOFT_RESET (1 << 1)
  1042. #define ISPCSI2_SYSCONFIG_AUTO_IDLE (1 << 0)
  1043. #define ISPCSI2_SYSSTATUS (0x014)
  1044. #define ISPCSI2_SYSSTATUS_RESET_DONE (1 << 0)
  1045. #define ISPCSI2_IRQSTATUS (0x018)
  1046. #define ISPCSI2_IRQSTATUS_OCP_ERR_IRQ (1 << 14)
  1047. #define ISPCSI2_IRQSTATUS_SHORT_PACKET_IRQ (1 << 13)
  1048. #define ISPCSI2_IRQSTATUS_ECC_CORRECTION_IRQ (1 << 12)
  1049. #define ISPCSI2_IRQSTATUS_ECC_NO_CORRECTION_IRQ (1 << 11)
  1050. #define ISPCSI2_IRQSTATUS_COMPLEXIO2_ERR_IRQ (1 << 10)
  1051. #define ISPCSI2_IRQSTATUS_COMPLEXIO1_ERR_IRQ (1 << 9)
  1052. #define ISPCSI2_IRQSTATUS_FIFO_OVF_IRQ (1 << 8)
  1053. #define ISPCSI2_IRQSTATUS_CONTEXT(n) (1 << (n))
  1054. #define ISPCSI2_IRQENABLE (0x01c)
  1055. #define ISPCSI2_CTRL (0x040)
  1056. #define ISPCSI2_CTRL_VP_CLK_EN (1 << 15)
  1057. #define ISPCSI2_CTRL_VP_ONLY_EN (1 << 11)
  1058. #define ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT 8
  1059. #define ISPCSI2_CTRL_VP_OUT_CTRL_MASK \
  1060. (3 << ISPCSI2_CTRL_VP_OUT_CTRL_SHIFT)
  1061. #define ISPCSI2_CTRL_DBG_EN (1 << 7)
  1062. #define ISPCSI2_CTRL_BURST_SIZE_SHIFT 5
  1063. #define ISPCSI2_CTRL_BURST_SIZE_MASK \
  1064. (3 << ISPCSI2_CTRL_BURST_SIZE_SHIFT)
  1065. #define ISPCSI2_CTRL_FRAME (1 << 3)
  1066. #define ISPCSI2_CTRL_ECC_EN (1 << 2)
  1067. #define ISPCSI2_CTRL_SECURE (1 << 1)
  1068. #define ISPCSI2_CTRL_IF_EN (1 << 0)
  1069. #define ISPCSI2_DBG_H (0x044)
  1070. #define ISPCSI2_GNQ (0x048)
  1071. #define ISPCSI2_PHY_CFG (0x050)
  1072. #define ISPCSI2_PHY_CFG_RESET_CTRL (1 << 30)
  1073. #define ISPCSI2_PHY_CFG_RESET_DONE (1 << 29)
  1074. #define ISPCSI2_PHY_CFG_PWR_CMD_SHIFT 27
  1075. #define ISPCSI2_PHY_CFG_PWR_CMD_MASK \
  1076. (0x3 << ISPCSI2_PHY_CFG_PWR_CMD_SHIFT)
  1077. #define ISPCSI2_PHY_CFG_PWR_CMD_OFF \
  1078. (0x0 << ISPCSI2_PHY_CFG_PWR_CMD_SHIFT)
  1079. #define ISPCSI2_PHY_CFG_PWR_CMD_ON \
  1080. (0x1 << ISPCSI2_PHY_CFG_PWR_CMD_SHIFT)
  1081. #define ISPCSI2_PHY_CFG_PWR_CMD_ULPW \
  1082. (0x2 << ISPCSI2_PHY_CFG_PWR_CMD_SHIFT)
  1083. #define ISPCSI2_PHY_CFG_PWR_STATUS_SHIFT 25
  1084. #define ISPCSI2_PHY_CFG_PWR_STATUS_MASK \
  1085. (0x3 << ISPCSI2_PHY_CFG_PWR_STATUS_SHIFT)
  1086. #define ISPCSI2_PHY_CFG_PWR_STATUS_OFF \
  1087. (0x0 << ISPCSI2_PHY_CFG_PWR_STATUS_SHIFT)
  1088. #define ISPCSI2_PHY_CFG_PWR_STATUS_ON \
  1089. (0x1 << ISPCSI2_PHY_CFG_PWR_STATUS_SHIFT)
  1090. #define ISPCSI2_PHY_CFG_PWR_STATUS_ULPW \
  1091. (0x2 << ISPCSI2_PHY_CFG_PWR_STATUS_SHIFT)
  1092. #define ISPCSI2_PHY_CFG_PWR_AUTO (1 << 24)
  1093. #define ISPCSI2_PHY_CFG_DATA_POL_SHIFT(n) (3 + ((n) * 4))
  1094. #define ISPCSI2_PHY_CFG_DATA_POL_MASK(n) \
  1095. (0x1 << ISPCSI2_PHY_CFG_DATA_POL_SHIFT(n))
  1096. #define ISPCSI2_PHY_CFG_DATA_POL_PN(n) \
  1097. (0x0 << ISPCSI2_PHY_CFG_DATA_POL_SHIFT(n))
  1098. #define ISPCSI2_PHY_CFG_DATA_POL_NP(n) \
  1099. (0x1 << ISPCSI2_PHY_CFG_DATA_POL_SHIFT(n))
  1100. #define ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n) ((n) * 4)
  1101. #define ISPCSI2_PHY_CFG_DATA_POSITION_MASK(n) \
  1102. (0x7 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1103. #define ISPCSI2_PHY_CFG_DATA_POSITION_NC(n) \
  1104. (0x0 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1105. #define ISPCSI2_PHY_CFG_DATA_POSITION_1(n) \
  1106. (0x1 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1107. #define ISPCSI2_PHY_CFG_DATA_POSITION_2(n) \
  1108. (0x2 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1109. #define ISPCSI2_PHY_CFG_DATA_POSITION_3(n) \
  1110. (0x3 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1111. #define ISPCSI2_PHY_CFG_DATA_POSITION_4(n) \
  1112. (0x4 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1113. #define ISPCSI2_PHY_CFG_DATA_POSITION_5(n) \
  1114. (0x5 << ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(n))
  1115. #define ISPCSI2_PHY_CFG_CLOCK_POL_SHIFT 3
  1116. #define ISPCSI2_PHY_CFG_CLOCK_POL_MASK \
  1117. (0x1 << ISPCSI2_PHY_CFG_CLOCK_POL_SHIFT)
  1118. #define ISPCSI2_PHY_CFG_CLOCK_POL_PN \
  1119. (0x0 << ISPCSI2_PHY_CFG_CLOCK_POL_SHIFT)
  1120. #define ISPCSI2_PHY_CFG_CLOCK_POL_NP \
  1121. (0x1 << ISPCSI2_PHY_CFG_CLOCK_POL_SHIFT)
  1122. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT 0
  1123. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_MASK \
  1124. (0x7 << ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT)
  1125. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_1 \
  1126. (0x1 << ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT)
  1127. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_2 \
  1128. (0x2 << ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT)
  1129. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_3 \
  1130. (0x3 << ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT)
  1131. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_4 \
  1132. (0x4 << ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT)
  1133. #define ISPCSI2_PHY_CFG_CLOCK_POSITION_5 \
  1134. (0x5 << ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT)
  1135. #define ISPCSI2_PHY_IRQSTATUS (0x054)
  1136. #define ISPCSI2_PHY_IRQSTATUS_STATEALLULPMEXIT (1 << 26)
  1137. #define ISPCSI2_PHY_IRQSTATUS_STATEALLULPMENTER (1 << 25)
  1138. #define ISPCSI2_PHY_IRQSTATUS_STATEULPM5 (1 << 24)
  1139. #define ISPCSI2_PHY_IRQSTATUS_STATEULPM4 (1 << 23)
  1140. #define ISPCSI2_PHY_IRQSTATUS_STATEULPM3 (1 << 22)
  1141. #define ISPCSI2_PHY_IRQSTATUS_STATEULPM2 (1 << 21)
  1142. #define ISPCSI2_PHY_IRQSTATUS_STATEULPM1 (1 << 20)
  1143. #define ISPCSI2_PHY_IRQSTATUS_ERRCONTROL5 (1 << 19)
  1144. #define ISPCSI2_PHY_IRQSTATUS_ERRCONTROL4 (1 << 18)
  1145. #define ISPCSI2_PHY_IRQSTATUS_ERRCONTROL3 (1 << 17)
  1146. #define ISPCSI2_PHY_IRQSTATUS_ERRCONTROL2 (1 << 16)
  1147. #define ISPCSI2_PHY_IRQSTATUS_ERRCONTROL1 (1 << 15)
  1148. #define ISPCSI2_PHY_IRQSTATUS_ERRESC5 (1 << 14)
  1149. #define ISPCSI2_PHY_IRQSTATUS_ERRESC4 (1 << 13)
  1150. #define ISPCSI2_PHY_IRQSTATUS_ERRESC3 (1 << 12)
  1151. #define ISPCSI2_PHY_IRQSTATUS_ERRESC2 (1 << 11)
  1152. #define ISPCSI2_PHY_IRQSTATUS_ERRESC1 (1 << 10)
  1153. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTSYNCHS5 (1 << 9)
  1154. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTSYNCHS4 (1 << 8)
  1155. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTSYNCHS3 (1 << 7)
  1156. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTSYNCHS2 (1 << 6)
  1157. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTSYNCHS1 (1 << 5)
  1158. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTHS5 (1 << 4)
  1159. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTHS4 (1 << 3)
  1160. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTHS3 (1 << 2)
  1161. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTHS2 (1 << 1)
  1162. #define ISPCSI2_PHY_IRQSTATUS_ERRSOTHS1 1
  1163. #define ISPCSI2_SHORT_PACKET (0x05c)
  1164. #define ISPCSI2_PHY_IRQENABLE (0x060)
  1165. #define ISPCSI2_PHY_IRQENABLE_STATEALLULPMEXIT (1 << 26)
  1166. #define ISPCSI2_PHY_IRQENABLE_STATEALLULPMENTER (1 << 25)
  1167. #define ISPCSI2_PHY_IRQENABLE_STATEULPM5 (1 << 24)
  1168. #define ISPCSI2_PHY_IRQENABLE_STATEULPM4 (1 << 23)
  1169. #define ISPCSI2_PHY_IRQENABLE_STATEULPM3 (1 << 22)
  1170. #define ISPCSI2_PHY_IRQENABLE_STATEULPM2 (1 << 21)
  1171. #define ISPCSI2_PHY_IRQENABLE_STATEULPM1 (1 << 20)
  1172. #define ISPCSI2_PHY_IRQENABLE_ERRCONTROL5 (1 << 19)
  1173. #define ISPCSI2_PHY_IRQENABLE_ERRCONTROL4 (1 << 18)
  1174. #define ISPCSI2_PHY_IRQENABLE_ERRCONTROL3 (1 << 17)
  1175. #define ISPCSI2_PHY_IRQENABLE_ERRCONTROL2 (1 << 16)
  1176. #define ISPCSI2_PHY_IRQENABLE_ERRCONTROL1 (1 << 15)
  1177. #define ISPCSI2_PHY_IRQENABLE_ERRESC5 (1 << 14)
  1178. #define ISPCSI2_PHY_IRQENABLE_ERRESC4 (1 << 13)
  1179. #define ISPCSI2_PHY_IRQENABLE_ERRESC3 (1 << 12)
  1180. #define ISPCSI2_PHY_IRQENABLE_ERRESC2 (1 << 11)
  1181. #define ISPCSI2_PHY_IRQENABLE_ERRESC1 (1 << 10)
  1182. #define ISPCSI2_PHY_IRQENABLE_ERRSOTSYNCHS5 (1 << 9)
  1183. #define ISPCSI2_PHY_IRQENABLE_ERRSOTSYNCHS4 (1 << 8)
  1184. #define ISPCSI2_PHY_IRQENABLE_ERRSOTSYNCHS3 (1 << 7)
  1185. #define ISPCSI2_PHY_IRQENABLE_ERRSOTSYNCHS2 (1 << 6)
  1186. #define ISPCSI2_PHY_IRQENABLE_ERRSOTSYNCHS1 (1 << 5)
  1187. #define ISPCSI2_PHY_IRQENABLE_ERRSOTHS5 (1 << 4)
  1188. #define ISPCSI2_PHY_IRQENABLE_ERRSOTHS4 (1 << 3)
  1189. #define ISPCSI2_PHY_IRQENABLE_ERRSOTHS3 (1 << 2)
  1190. #define ISPCSI2_PHY_IRQENABLE_ERRSOTHS2 (1 << 1)
  1191. #define ISPCSI2_PHY_IRQENABLE_ERRSOTHS1 (1 << 0)
  1192. #define ISPCSI2_DBG_P (0x068)
  1193. #define ISPCSI2_TIMING (0x06c)
  1194. #define ISPCSI2_TIMING_FORCE_RX_MODE_IO(n) (1 << ((16 * ((n) - 1)) + 15))
  1195. #define ISPCSI2_TIMING_STOP_STATE_X16_IO(n) (1 << ((16 * ((n) - 1)) + 14))
  1196. #define ISPCSI2_TIMING_STOP_STATE_X4_IO(n) (1 << ((16 * ((n) - 1)) + 13))
  1197. #define ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_SHIFT(n) (16 * ((n) - 1))
  1198. #define ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_MASK(n) \
  1199. (0x1fff << ISPCSI2_TIMING_STOP_STATE_COUNTER_IO_SHIFT(n))
  1200. #define ISPCSI2_CTX_CTRL1(n) ((0x070) + 0x20 * (n))
  1201. #define ISPCSI2_CTX_CTRL1_COUNT_SHIFT 8
  1202. #define ISPCSI2_CTX_CTRL1_COUNT_MASK \
  1203. (0xff << ISPCSI2_CTX_CTRL1_COUNT_SHIFT)
  1204. #define ISPCSI2_CTX_CTRL1_EOF_EN (1 << 7)
  1205. #define ISPCSI2_CTX_CTRL1_EOL_EN (1 << 6)
  1206. #define ISPCSI2_CTX_CTRL1_CS_EN (1 << 5)
  1207. #define ISPCSI2_CTX_CTRL1_COUNT_UNLOCK (1 << 4)
  1208. #define ISPCSI2_CTX_CTRL1_PING_PONG (1 << 3)
  1209. #define ISPCSI2_CTX_CTRL1_CTX_EN (1 << 0)
  1210. #define ISPCSI2_CTX_CTRL2(n) ((0x074) + 0x20 * (n))
  1211. #define ISPCSI2_CTX_CTRL2_USER_DEF_MAP_SHIFT 13
  1212. #define ISPCSI2_CTX_CTRL2_USER_DEF_MAP_MASK \
  1213. (0x3 << ISPCSI2_CTX_CTRL2_USER_DEF_MAP_SHIFT)
  1214. #define ISPCSI2_CTX_CTRL2_VIRTUAL_ID_SHIFT 11
  1215. #define ISPCSI2_CTX_CTRL2_VIRTUAL_ID_MASK \
  1216. (0x3 << ISPCSI2_CTX_CTRL2_VIRTUAL_ID_SHIFT)
  1217. #define ISPCSI2_CTX_CTRL2_DPCM_PRED (1 << 10)
  1218. #define ISPCSI2_CTX_CTRL2_FORMAT_SHIFT 0
  1219. #define ISPCSI2_CTX_CTRL2_FORMAT_MASK \
  1220. (0x3ff << ISPCSI2_CTX_CTRL2_FORMAT_SHIFT)
  1221. #define ISPCSI2_CTX_CTRL2_FRAME_SHIFT 16
  1222. #define ISPCSI2_CTX_CTRL2_FRAME_MASK \
  1223. (0xffff << ISPCSI2_CTX_CTRL2_FRAME_SHIFT)
  1224. #define ISPCSI2_CTX_DAT_OFST(n) ((0x078) + 0x20 * (n))
  1225. #define ISPCSI2_CTX_DAT_OFST_OFST_SHIFT 0
  1226. #define ISPCSI2_CTX_DAT_OFST_OFST_MASK \
  1227. (0x1ffe0 << ISPCSI2_CTX_DAT_OFST_OFST_SHIFT)
  1228. #define ISPCSI2_CTX_DAT_PING_ADDR(n) ((0x07c) + 0x20 * (n))
  1229. #define ISPCSI2_CTX_DAT_PONG_ADDR(n) ((0x080) + 0x20 * (n))
  1230. #define ISPCSI2_CTX_IRQENABLE(n) ((0x084) + 0x20 * (n))
  1231. #define ISPCSI2_CTX_IRQENABLE_ECC_CORRECTION_IRQ (1 << 8)
  1232. #define ISPCSI2_CTX_IRQENABLE_LINE_NUMBER_IRQ (1 << 7)
  1233. #define ISPCSI2_CTX_IRQENABLE_FRAME_NUMBER_IRQ (1 << 6)
  1234. #define ISPCSI2_CTX_IRQENABLE_CS_IRQ (1 << 5)
  1235. #define ISPCSI2_CTX_IRQENABLE_LE_IRQ (1 << 3)
  1236. #define ISPCSI2_CTX_IRQENABLE_LS_IRQ (1 << 2)
  1237. #define ISPCSI2_CTX_IRQENABLE_FE_IRQ (1 << 1)
  1238. #define ISPCSI2_CTX_IRQENABLE_FS_IRQ (1 << 0)
  1239. #define ISPCSI2_CTX_IRQSTATUS(n) ((0x088) + 0x20 * (n))
  1240. #define ISPCSI2_CTX_IRQSTATUS_ECC_CORRECTION_IRQ (1 << 8)
  1241. #define ISPCSI2_CTX_IRQSTATUS_LINE_NUMBER_IRQ (1 << 7)
  1242. #define ISPCSI2_CTX_IRQSTATUS_FRAME_NUMBER_IRQ (1 << 6)
  1243. #define ISPCSI2_CTX_IRQSTATUS_CS_IRQ (1 << 5)
  1244. #define ISPCSI2_CTX_IRQSTATUS_LE_IRQ (1 << 3)
  1245. #define ISPCSI2_CTX_IRQSTATUS_LS_IRQ (1 << 2)
  1246. #define ISPCSI2_CTX_IRQSTATUS_FE_IRQ (1 << 1)
  1247. #define ISPCSI2_CTX_IRQSTATUS_FS_IRQ (1 << 0)
  1248. #define ISPCSI2_CTX_CTRL3(n) ((0x08c) + 0x20 * (n))
  1249. #define ISPCSI2_CTX_CTRL3_ALPHA_SHIFT 5
  1250. #define ISPCSI2_CTX_CTRL3_ALPHA_MASK \
  1251. (0x3fff << ISPCSI2_CTX_CTRL3_ALPHA_SHIFT)
  1252. /* This instance is for OMAP3630 only */
  1253. #define ISPCSI2_CTX_TRANSCODEH(n) (0x000 + 0x8 * (n))
  1254. #define ISPCSI2_CTX_TRANSCODEH_HCOUNT_SHIFT 16
  1255. #define ISPCSI2_CTX_TRANSCODEH_HCOUNT_MASK \
  1256. (0x1fff << ISPCSI2_CTX_TRANSCODEH_HCOUNT_SHIFT)
  1257. #define ISPCSI2_CTX_TRANSCODEH_HSKIP_SHIFT 0
  1258. #define ISPCSI2_CTX_TRANSCODEH_HSKIP_MASK \
  1259. (0x1fff << ISPCSI2_CTX_TRANSCODEH_HCOUNT_SHIFT)
  1260. #define ISPCSI2_CTX_TRANSCODEV(n) (0x004 + 0x8 * (n))
  1261. #define ISPCSI2_CTX_TRANSCODEV_VCOUNT_SHIFT 16
  1262. #define ISPCSI2_CTX_TRANSCODEV_VCOUNT_MASK \
  1263. (0x1fff << ISPCSI2_CTX_TRANSCODEV_VCOUNT_SHIFT)
  1264. #define ISPCSI2_CTX_TRANSCODEV_VSKIP_SHIFT 0
  1265. #define ISPCSI2_CTX_TRANSCODEV_VSKIP_MASK \
  1266. (0x1fff << ISPCSI2_CTX_TRANSCODEV_VCOUNT_SHIFT)
  1267. /* -----------------------------------------------------------------------------
  1268. * CSI PHY registers
  1269. */
  1270. #define ISPCSIPHY_REG0 (0x000)
  1271. #define ISPCSIPHY_REG0_THS_TERM_SHIFT 8
  1272. #define ISPCSIPHY_REG0_THS_TERM_MASK \
  1273. (0xff << ISPCSIPHY_REG0_THS_TERM_SHIFT)
  1274. #define ISPCSIPHY_REG0_THS_SETTLE_SHIFT 0
  1275. #define ISPCSIPHY_REG0_THS_SETTLE_MASK \
  1276. (0xff << ISPCSIPHY_REG0_THS_SETTLE_SHIFT)
  1277. #define ISPCSIPHY_REG1 (0x004)
  1278. #define ISPCSIPHY_REG1_RESET_DONE_CTRLCLK (1 << 29)
  1279. /* This field is for OMAP3630 only */
  1280. #define ISPCSIPHY_REG1_CLOCK_MISS_DETECTOR_STATUS (1 << 25)
  1281. #define ISPCSIPHY_REG1_TCLK_TERM_SHIFT 18
  1282. #define ISPCSIPHY_REG1_TCLK_TERM_MASK \
  1283. (0x7f << ISPCSIPHY_REG1_TCLK_TERM_SHIFT)
  1284. #define ISPCSIPHY_REG1_DPHY_HS_SYNC_PATTERN_SHIFT 10
  1285. #define ISPCSIPHY_REG1_DPHY_HS_SYNC_PATTERN_MASK \
  1286. (0xff << ISPCSIPHY_REG1_DPHY_HS_SYNC_PATTERN)
  1287. /* This field is for OMAP3430 only */
  1288. #define ISPCSIPHY_REG1_TCLK_MISS_SHIFT 8
  1289. #define ISPCSIPHY_REG1_TCLK_MISS_MASK \
  1290. (0x3 << ISPCSIPHY_REG1_TCLK_MISS_SHIFT)
  1291. /* This field is for OMAP3630 only */
  1292. #define ISPCSIPHY_REG1_CTRLCLK_DIV_FACTOR_SHIFT 8
  1293. #define ISPCSIPHY_REG1_CTRLCLK_DIV_FACTOR_MASK \
  1294. (0x3 << ISPCSIPHY_REG1_CTRLCLK_DIV_FACTOR_SHIFT)
  1295. #define ISPCSIPHY_REG1_TCLK_SETTLE_SHIFT 0
  1296. #define ISPCSIPHY_REG1_TCLK_SETTLE_MASK \
  1297. (0xff << ISPCSIPHY_REG1_TCLK_SETTLE_SHIFT)
  1298. /* This register is for OMAP3630 only */
  1299. #define ISPCSIPHY_REG2 (0x008)
  1300. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC0_SHIFT 30
  1301. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC0_MASK \
  1302. (0x3 << ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC0_SHIFT)
  1303. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC1_SHIFT 28
  1304. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC1_MASK \
  1305. (0x3 << ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC1_SHIFT)
  1306. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC2_SHIFT 26
  1307. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC2_MASK \
  1308. (0x3 << ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC2_SHIFT)
  1309. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC3_SHIFT 24
  1310. #define ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC3_MASK \
  1311. (0x3 << ISPCSIPHY_REG2_TRIGGER_CMD_RXTRIGESC3_SHIFT)
  1312. #define ISPCSIPHY_REG2_CCP2_SYNC_PATTERN_SHIFT 0
  1313. #define ISPCSIPHY_REG2_CCP2_SYNC_PATTERN_MASK \
  1314. (0x7fffff << ISPCSIPHY_REG2_CCP2_SYNC_PATTERN_SHIFT)
  1315. /* -----------------------------------------------------------------------------
  1316. * CONTROL registers for CSI-2 phy routing
  1317. */
  1318. /* OMAP343X_CONTROL_CSIRXFE */
  1319. #define OMAP343X_CONTROL_CSIRXFE_CSIB_INV (1 << 7)
  1320. #define OMAP343X_CONTROL_CSIRXFE_RESENABLE (1 << 8)
  1321. #define OMAP343X_CONTROL_CSIRXFE_SELFORM (1 << 10)
  1322. #define OMAP343X_CONTROL_CSIRXFE_PWRDNZ (1 << 12)
  1323. #define OMAP343X_CONTROL_CSIRXFE_RESET (1 << 13)
  1324. /* OMAP3630_CONTROL_CAMERA_PHY_CTRL */
  1325. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT 2
  1326. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY2_SHIFT 0
  1327. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_DPHY 0x0
  1328. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_CCP2_DATA_STROBE 0x1
  1329. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_CCP2_DATA_CLOCK 0x2
  1330. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_GPI 0x3
  1331. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_MASK 0x3
  1332. /* CCP2B: set to receive data from PHY2 instead of PHY1 */
  1333. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CSI1_RX_SEL_PHY2 (1 << 4)
  1334. #endif /* OMAP3_ISP_REG_H */