bt848.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. /*
  2. bt848.h - Bt848 register offsets
  3. Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
  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. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef _BT848_H_
  17. #define _BT848_H_
  18. #ifndef PCI_VENDOR_ID_BROOKTREE
  19. #define PCI_VENDOR_ID_BROOKTREE 0x109e
  20. #endif
  21. #ifndef PCI_DEVICE_ID_BT848
  22. #define PCI_DEVICE_ID_BT848 0x350
  23. #endif
  24. #ifndef PCI_DEVICE_ID_BT849
  25. #define PCI_DEVICE_ID_BT849 0x351
  26. #endif
  27. #ifndef PCI_DEVICE_ID_FUSION879
  28. #define PCI_DEVICE_ID_FUSION879 0x36c
  29. #endif
  30. #ifndef PCI_DEVICE_ID_BT878
  31. #define PCI_DEVICE_ID_BT878 0x36e
  32. #endif
  33. #ifndef PCI_DEVICE_ID_BT879
  34. #define PCI_DEVICE_ID_BT879 0x36f
  35. #endif
  36. /* Brooktree 848 registers */
  37. #define BT848_DSTATUS 0x000
  38. #define BT848_DSTATUS_PRES (1<<7)
  39. #define BT848_DSTATUS_HLOC (1<<6)
  40. #define BT848_DSTATUS_FIELD (1<<5)
  41. #define BT848_DSTATUS_NUML (1<<4)
  42. #define BT848_DSTATUS_CSEL (1<<3)
  43. #define BT848_DSTATUS_PLOCK (1<<2)
  44. #define BT848_DSTATUS_LOF (1<<1)
  45. #define BT848_DSTATUS_COF (1<<0)
  46. #define BT848_IFORM 0x004
  47. #define BT848_IFORM_HACTIVE (1<<7)
  48. #define BT848_IFORM_MUXSEL (3<<5)
  49. #define BT848_IFORM_MUX0 (2<<5)
  50. #define BT848_IFORM_MUX1 (3<<5)
  51. #define BT848_IFORM_MUX2 (1<<5)
  52. #define BT848_IFORM_XTSEL (3<<3)
  53. #define BT848_IFORM_XT0 (1<<3)
  54. #define BT848_IFORM_XT1 (2<<3)
  55. #define BT848_IFORM_XTAUTO (3<<3)
  56. #define BT848_IFORM_XTBOTH (3<<3)
  57. #define BT848_IFORM_NTSC 1
  58. #define BT848_IFORM_NTSC_J 2
  59. #define BT848_IFORM_PAL_BDGHI 3
  60. #define BT848_IFORM_PAL_M 4
  61. #define BT848_IFORM_PAL_N 5
  62. #define BT848_IFORM_SECAM 6
  63. #define BT848_IFORM_PAL_NC 7
  64. #define BT848_IFORM_AUTO 0
  65. #define BT848_IFORM_NORM 7
  66. #define BT848_TDEC 0x008
  67. #define BT848_TDEC_DEC_FIELD (1<<7)
  68. #define BT848_TDEC_FLDALIGN (1<<6)
  69. #define BT848_TDEC_DEC_RAT (0x1f)
  70. #define BT848_E_CROP 0x00C
  71. #define BT848_O_CROP 0x08C
  72. #define BT848_E_VDELAY_LO 0x010
  73. #define BT848_O_VDELAY_LO 0x090
  74. #define BT848_E_VACTIVE_LO 0x014
  75. #define BT848_O_VACTIVE_LO 0x094
  76. #define BT848_E_HDELAY_LO 0x018
  77. #define BT848_O_HDELAY_LO 0x098
  78. #define BT848_E_HACTIVE_LO 0x01C
  79. #define BT848_O_HACTIVE_LO 0x09C
  80. #define BT848_E_HSCALE_HI 0x020
  81. #define BT848_O_HSCALE_HI 0x0A0
  82. #define BT848_E_HSCALE_LO 0x024
  83. #define BT848_O_HSCALE_LO 0x0A4
  84. #define BT848_BRIGHT 0x028
  85. #define BT848_E_CONTROL 0x02C
  86. #define BT848_O_CONTROL 0x0AC
  87. #define BT848_CONTROL_LNOTCH (1<<7)
  88. #define BT848_CONTROL_COMP (1<<6)
  89. #define BT848_CONTROL_LDEC (1<<5)
  90. #define BT848_CONTROL_CBSENSE (1<<4)
  91. #define BT848_CONTROL_CON_MSB (1<<2)
  92. #define BT848_CONTROL_SAT_U_MSB (1<<1)
  93. #define BT848_CONTROL_SAT_V_MSB (1<<0)
  94. #define BT848_CONTRAST_LO 0x030
  95. #define BT848_SAT_U_LO 0x034
  96. #define BT848_SAT_V_LO 0x038
  97. #define BT848_HUE 0x03C
  98. #define BT848_E_SCLOOP 0x040
  99. #define BT848_O_SCLOOP 0x0C0
  100. #define BT848_SCLOOP_CAGC (1<<6)
  101. #define BT848_SCLOOP_CKILL (1<<5)
  102. #define BT848_SCLOOP_HFILT_AUTO (0<<3)
  103. #define BT848_SCLOOP_HFILT_CIF (1<<3)
  104. #define BT848_SCLOOP_HFILT_QCIF (2<<3)
  105. #define BT848_SCLOOP_HFILT_ICON (3<<3)
  106. #define BT848_SCLOOP_PEAK (1<<7)
  107. #define BT848_SCLOOP_HFILT_MINP (1<<3)
  108. #define BT848_SCLOOP_HFILT_MEDP (2<<3)
  109. #define BT848_SCLOOP_HFILT_MAXP (3<<3)
  110. #define BT848_OFORM 0x048
  111. #define BT848_OFORM_RANGE (1<<7)
  112. #define BT848_OFORM_CORE0 (0<<5)
  113. #define BT848_OFORM_CORE8 (1<<5)
  114. #define BT848_OFORM_CORE16 (2<<5)
  115. #define BT848_OFORM_CORE32 (3<<5)
  116. #define BT848_E_VSCALE_HI 0x04C
  117. #define BT848_O_VSCALE_HI 0x0CC
  118. #define BT848_VSCALE_YCOMB (1<<7)
  119. #define BT848_VSCALE_COMB (1<<6)
  120. #define BT848_VSCALE_INT (1<<5)
  121. #define BT848_VSCALE_HI 15
  122. #define BT848_E_VSCALE_LO 0x050
  123. #define BT848_O_VSCALE_LO 0x0D0
  124. #define BT848_TEST 0x054
  125. #define BT848_ADELAY 0x060
  126. #define BT848_BDELAY 0x064
  127. #define BT848_ADC 0x068
  128. #define BT848_ADC_RESERVED (2<<6)
  129. #define BT848_ADC_SYNC_T (1<<5)
  130. #define BT848_ADC_AGC_EN (1<<4)
  131. #define BT848_ADC_CLK_SLEEP (1<<3)
  132. #define BT848_ADC_Y_SLEEP (1<<2)
  133. #define BT848_ADC_C_SLEEP (1<<1)
  134. #define BT848_ADC_CRUSH (1<<0)
  135. #define BT848_WC_UP 0x044
  136. #define BT848_WC_DOWN 0x078
  137. #define BT848_E_VTC 0x06C
  138. #define BT848_O_VTC 0x0EC
  139. #define BT848_VTC_HSFMT (1<<7)
  140. #define BT848_VTC_VFILT_2TAP 0
  141. #define BT848_VTC_VFILT_3TAP 1
  142. #define BT848_VTC_VFILT_4TAP 2
  143. #define BT848_VTC_VFILT_5TAP 3
  144. #define BT848_SRESET 0x07C
  145. #define BT848_COLOR_FMT 0x0D4
  146. #define BT848_COLOR_FMT_O_RGB32 (0<<4)
  147. #define BT848_COLOR_FMT_O_RGB24 (1<<4)
  148. #define BT848_COLOR_FMT_O_RGB16 (2<<4)
  149. #define BT848_COLOR_FMT_O_RGB15 (3<<4)
  150. #define BT848_COLOR_FMT_O_YUY2 (4<<4)
  151. #define BT848_COLOR_FMT_O_BtYUV (5<<4)
  152. #define BT848_COLOR_FMT_O_Y8 (6<<4)
  153. #define BT848_COLOR_FMT_O_RGB8 (7<<4)
  154. #define BT848_COLOR_FMT_O_YCrCb422 (8<<4)
  155. #define BT848_COLOR_FMT_O_YCrCb411 (9<<4)
  156. #define BT848_COLOR_FMT_O_RAW (14<<4)
  157. #define BT848_COLOR_FMT_E_RGB32 0
  158. #define BT848_COLOR_FMT_E_RGB24 1
  159. #define BT848_COLOR_FMT_E_RGB16 2
  160. #define BT848_COLOR_FMT_E_RGB15 3
  161. #define BT848_COLOR_FMT_E_YUY2 4
  162. #define BT848_COLOR_FMT_E_BtYUV 5
  163. #define BT848_COLOR_FMT_E_Y8 6
  164. #define BT848_COLOR_FMT_E_RGB8 7
  165. #define BT848_COLOR_FMT_E_YCrCb422 8
  166. #define BT848_COLOR_FMT_E_YCrCb411 9
  167. #define BT848_COLOR_FMT_E_RAW 14
  168. #define BT848_COLOR_FMT_RGB32 0x00
  169. #define BT848_COLOR_FMT_RGB24 0x11
  170. #define BT848_COLOR_FMT_RGB16 0x22
  171. #define BT848_COLOR_FMT_RGB15 0x33
  172. #define BT848_COLOR_FMT_YUY2 0x44
  173. #define BT848_COLOR_FMT_BtYUV 0x55
  174. #define BT848_COLOR_FMT_Y8 0x66
  175. #define BT848_COLOR_FMT_RGB8 0x77
  176. #define BT848_COLOR_FMT_YCrCb422 0x88
  177. #define BT848_COLOR_FMT_YCrCb411 0x99
  178. #define BT848_COLOR_FMT_RAW 0xee
  179. #define BT848_VTOTAL_LO 0xB0
  180. #define BT848_VTOTAL_HI 0xB4
  181. #define BT848_COLOR_CTL 0x0D8
  182. #define BT848_COLOR_CTL_EXT_FRMRATE (1<<7)
  183. #define BT848_COLOR_CTL_COLOR_BARS (1<<6)
  184. #define BT848_COLOR_CTL_RGB_DED (1<<5)
  185. #define BT848_COLOR_CTL_GAMMA (1<<4)
  186. #define BT848_COLOR_CTL_WSWAP_ODD (1<<3)
  187. #define BT848_COLOR_CTL_WSWAP_EVEN (1<<2)
  188. #define BT848_COLOR_CTL_BSWAP_ODD (1<<1)
  189. #define BT848_COLOR_CTL_BSWAP_EVEN (1<<0)
  190. #define BT848_CAP_CTL 0x0DC
  191. #define BT848_CAP_CTL_DITH_FRAME (1<<4)
  192. #define BT848_CAP_CTL_CAPTURE_VBI_ODD (1<<3)
  193. #define BT848_CAP_CTL_CAPTURE_VBI_EVEN (1<<2)
  194. #define BT848_CAP_CTL_CAPTURE_ODD (1<<1)
  195. #define BT848_CAP_CTL_CAPTURE_EVEN (1<<0)
  196. #define BT848_VBI_PACK_SIZE 0x0E0
  197. #define BT848_VBI_PACK_DEL 0x0E4
  198. #define BT848_VBI_PACK_DEL_VBI_HDELAY 0xfc
  199. #define BT848_VBI_PACK_DEL_EXT_FRAME 2
  200. #define BT848_VBI_PACK_DEL_VBI_PKT_HI 1
  201. #define BT848_INT_STAT 0x100
  202. #define BT848_INT_MASK 0x104
  203. #define BT848_INT_ETBF (1<<23)
  204. #define BT848_INT_RISCS (0xf<<28)
  205. #define BT848_INT_RISC_EN (1<<27)
  206. #define BT848_INT_RACK (1<<25)
  207. #define BT848_INT_FIELD (1<<24)
  208. #define BT848_INT_SCERR (1<<19)
  209. #define BT848_INT_OCERR (1<<18)
  210. #define BT848_INT_PABORT (1<<17)
  211. #define BT848_INT_RIPERR (1<<16)
  212. #define BT848_INT_PPERR (1<<15)
  213. #define BT848_INT_FDSR (1<<14)
  214. #define BT848_INT_FTRGT (1<<13)
  215. #define BT848_INT_FBUS (1<<12)
  216. #define BT848_INT_RISCI (1<<11)
  217. #define BT848_INT_GPINT (1<<9)
  218. #define BT848_INT_I2CDONE (1<<8)
  219. #define BT848_INT_VPRES (1<<5)
  220. #define BT848_INT_HLOCK (1<<4)
  221. #define BT848_INT_OFLOW (1<<3)
  222. #define BT848_INT_HSYNC (1<<2)
  223. #define BT848_INT_VSYNC (1<<1)
  224. #define BT848_INT_FMTCHG (1<<0)
  225. #define BT848_GPIO_DMA_CTL 0x10C
  226. #define BT848_GPIO_DMA_CTL_GPINTC (1<<15)
  227. #define BT848_GPIO_DMA_CTL_GPINTI (1<<14)
  228. #define BT848_GPIO_DMA_CTL_GPWEC (1<<13)
  229. #define BT848_GPIO_DMA_CTL_GPIOMODE (3<<11)
  230. #define BT848_GPIO_DMA_CTL_GPCLKMODE (1<<10)
  231. #define BT848_GPIO_DMA_CTL_PLTP23_4 (0<<6)
  232. #define BT848_GPIO_DMA_CTL_PLTP23_8 (1<<6)
  233. #define BT848_GPIO_DMA_CTL_PLTP23_16 (2<<6)
  234. #define BT848_GPIO_DMA_CTL_PLTP23_32 (3<<6)
  235. #define BT848_GPIO_DMA_CTL_PLTP1_4 (0<<4)
  236. #define BT848_GPIO_DMA_CTL_PLTP1_8 (1<<4)
  237. #define BT848_GPIO_DMA_CTL_PLTP1_16 (2<<4)
  238. #define BT848_GPIO_DMA_CTL_PLTP1_32 (3<<4)
  239. #define BT848_GPIO_DMA_CTL_PKTP_4 (0<<2)
  240. #define BT848_GPIO_DMA_CTL_PKTP_8 (1<<2)
  241. #define BT848_GPIO_DMA_CTL_PKTP_16 (2<<2)
  242. #define BT848_GPIO_DMA_CTL_PKTP_32 (3<<2)
  243. #define BT848_GPIO_DMA_CTL_RISC_ENABLE (1<<1)
  244. #define BT848_GPIO_DMA_CTL_FIFO_ENABLE (1<<0)
  245. #define BT848_I2C 0x110
  246. #define BT878_I2C_MODE (1<<7)
  247. #define BT878_I2C_RATE (1<<6)
  248. #define BT878_I2C_NOSTOP (1<<5)
  249. #define BT878_I2C_NOSTART (1<<4)
  250. #define BT848_I2C_DIV (0xf<<4)
  251. #define BT848_I2C_SYNC (1<<3)
  252. #define BT848_I2C_W3B (1<<2)
  253. #define BT848_I2C_SCL (1<<1)
  254. #define BT848_I2C_SDA (1<<0)
  255. #define BT848_RISC_STRT_ADD 0x114
  256. #define BT848_GPIO_OUT_EN 0x118
  257. #define BT848_GPIO_REG_INP 0x11C
  258. #define BT848_RISC_COUNT 0x120
  259. #define BT848_GPIO_DATA 0x200
  260. /* Bt848 RISC commands */
  261. /* only for the SYNC RISC command */
  262. #define BT848_FIFO_STATUS_FM1 0x06
  263. #define BT848_FIFO_STATUS_FM3 0x0e
  264. #define BT848_FIFO_STATUS_SOL 0x02
  265. #define BT848_FIFO_STATUS_EOL4 0x01
  266. #define BT848_FIFO_STATUS_EOL3 0x0d
  267. #define BT848_FIFO_STATUS_EOL2 0x09
  268. #define BT848_FIFO_STATUS_EOL1 0x05
  269. #define BT848_FIFO_STATUS_VRE 0x04
  270. #define BT848_FIFO_STATUS_VRO 0x0c
  271. #define BT848_FIFO_STATUS_PXV 0x00
  272. #define BT848_RISC_RESYNC (1<<15)
  273. /* WRITE and SKIP */
  274. /* disable which bytes of each DWORD */
  275. #define BT848_RISC_BYTE0 (1U<<12)
  276. #define BT848_RISC_BYTE1 (1U<<13)
  277. #define BT848_RISC_BYTE2 (1U<<14)
  278. #define BT848_RISC_BYTE3 (1U<<15)
  279. #define BT848_RISC_BYTE_ALL (0x0fU<<12)
  280. #define BT848_RISC_BYTE_NONE 0
  281. /* cause RISCI */
  282. #define BT848_RISC_IRQ (1U<<24)
  283. /* RISC command is last one in this line */
  284. #define BT848_RISC_EOL (1U<<26)
  285. /* RISC command is first one in this line */
  286. #define BT848_RISC_SOL (1U<<27)
  287. #define BT848_RISC_WRITE (0x01U<<28)
  288. #define BT848_RISC_SKIP (0x02U<<28)
  289. #define BT848_RISC_WRITEC (0x05U<<28)
  290. #define BT848_RISC_JUMP (0x07U<<28)
  291. #define BT848_RISC_SYNC (0x08U<<28)
  292. #define BT848_RISC_WRITE123 (0x09U<<28)
  293. #define BT848_RISC_SKIP123 (0x0aU<<28)
  294. #define BT848_RISC_WRITE1S23 (0x0bU<<28)
  295. /* Bt848A and higher only !! */
  296. #define BT848_TGLB 0x080
  297. #define BT848_TGCTRL 0x084
  298. #define BT848_FCAP 0x0E8
  299. #define BT848_PLL_F_LO 0x0F0
  300. #define BT848_PLL_F_HI 0x0F4
  301. #define BT848_PLL_XCI 0x0F8
  302. #define BT848_PLL_X (1<<7)
  303. #define BT848_PLL_C (1<<6)
  304. #define BT848_DVSIF 0x0FC
  305. /* Bt878 register */
  306. #define BT878_DEVCTRL 0x40
  307. #define BT878_EN_TBFX 0x02
  308. #define BT878_EN_VSFX 0x04
  309. #endif