V4L/DVB (6163): cx23885: remove old comments
[powerpc.git] / drivers / media / video / cx23885 / cx23885-reg.h
1 /*
2  *  Driver for the Conexant CX23885 PCIe bridge
3  *
4  *  Copyright (c) 2006 Steven Toth <stoth@hauppauge.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22 #ifndef _CX23885_REG_H_
23 #define _CX23885_REG_H_
24
25
26 /*
27 Address Map
28 0x00000000 -> 0x00009000   TX SRAM  (Fifos)
29 0x00010000 -> 0x00013c00   RX SRAM  CMDS + CDT
30
31 EACH CMDS struct is 0x80 bytes long
32
33 DMAx_PTR1 = 0x03040 address of first cluster
34 DMAx_PTR2 = 0x10600 address of the CDT
35 DMAx_CNT1 = cluster size in (bytes >> 4) -1
36 DMAx_CNT2 = total cdt size for all entries >> 3
37
38 Cluster Descriptor entry = 4 DWORDS
39  DWORD 0 -> ptr to cluster
40  DWORD 1 Reserved
41  DWORD 2 Reserved
42  DWORD 3 Reserved
43
44 Channel manager Data Structure entry = 20 DWORD
45   0  IntialProgramCounterLow
46   1  IntialProgramCounterHigh
47   2  ClusterDescriptorTableBase
48   3  ClusterDescriptorTableSize
49   4  InstructionQueueBase
50   5  InstructionQueueSize
51 ...  Reserved
52  19  Reserved
53
54
55 */
56
57 /* Risc Instructions */
58 #define RISC_CNT_INC             0x00010000
59 #define RISC_CNT_RESET           0x00030000
60 #define RISC_IRQ1                0x01000000
61 #define RISC_IRQ2                0x02000000
62 #define RISC_EOL                 0x04000000
63 #define RISC_SOL                 0x08000000
64 #define RISC_WRITE               0x10000000
65 #define RISC_SKIP                0x20000000
66 #define RISC_JUMP                0x70000000
67 #define RISC_SYNC                0x80000000
68 #define RISC_RESYNC              0x80008000
69 #define RISC_READ                0x90000000
70 #define RISC_WRITERM             0xB0000000
71 #define RISC_WRITECM             0xC0000000
72 #define RISC_WRITECR             0xD0000000
73
74
75 /* Do we need these? */
76 #define RISC_WRITEC              0x50000000
77 #define RISC_READC               0xA0000000
78
79 /* Is this used? */
80 #define RISC_IMM                 0x00000001
81
82
83 /* Audio and Video Core */
84 #define HOST_REG1               0x00000000
85 #define HOST_REG2               0x00000001
86 #define HOST_REG3               0x00000002
87
88 /* Chip Configuration Registers */
89 #define CHIP_CTRL               0x00000100
90 #define AFE_CTRL                0x00000104
91 #define VID_PLL_INT_POST        0x00000108
92 #define VID_PLL_FRAC            0x0000010C
93 #define AUX_PLL_INT_POST        0x00000110
94 #define AUX_PLL_FRAC            0x00000114
95 #define SYS_PLL_INT_POST        0x00000118
96 #define SYS_PLL_FRAC            0x0000011C
97 #define PIN_CTRL                0x00000120
98 #define AUD_IO_CTRL             0x00000124
99 #define AUD_LOCK1               0x00000128
100 #define AUD_LOCK2               0x0000012C
101 #define POWER_CTRL              0x00000130
102 #define AFE_DIAG_CTRL1          0x00000134
103 #define AFE_DIAG_CTRL3          0x0000013C
104 #define PLL_DIAG_CTRL           0x00000140
105 #define AFE_CLK_OUT_CTRL        0x00000144
106 #define DLL1_DIAG_CTRL          0x0000015C
107
108 /* GPIO[23:19] Output Enable */
109 #define GPIO2_OUT_EN_REG        0x00000160
110 /* GPIO[23:19] Data Registers */
111 #define GPIO2                   0x00000164
112
113 #define IFADC_CTRL              0x00000180
114
115 /* Infrared Remote Registers */
116 #define IR_CNTRL_REG    0x00000200
117 #define IR_TXCLK_REG    0x00000204
118 #define IR_RXCLK_REG    0x00000208
119 #define IR_CDUTY_REG    0x0000020C
120 #define IR_STAT_REG     0x00000210
121 #define IR_IRQEN_REG    0x00000214
122 #define IR_FILTR_REG    0x00000218
123 #define IR_FIFO_REG     0x0000023C
124
125 /* Video Decoder Registers */
126 #define MODE_CTRL               0x00000400
127 #define OUT_CTRL1               0x00000404
128 #define OUT_CTRL2               0x00000408
129 #define GEN_STAT                0x0000040C
130 #define INT_STAT_MASK           0x00000410
131 #define LUMA_CTRL               0x00000414
132 #define HSCALE_CTRL             0x00000418
133 #define VSCALE_CTRL             0x0000041C
134 #define CHROMA_CTRL             0x00000420
135 #define VBI_LINE_CTRL1          0x00000424
136 #define VBI_LINE_CTRL2          0x00000428
137 #define VBI_LINE_CTRL3          0x0000042C
138 #define VBI_LINE_CTRL4          0x00000430
139 #define VBI_LINE_CTRL5          0x00000434
140 #define VBI_FC_CFG              0x00000438
141 #define VBI_MISC_CFG1           0x0000043C
142 #define VBI_MISC_CFG2           0x00000440
143 #define VBI_PAY1                0x00000444
144 #define VBI_PAY2                0x00000448
145 #define VBI_CUST1_CFG1          0x0000044C
146 #define VBI_CUST1_CFG2          0x00000450
147 #define VBI_CUST1_CFG3          0x00000454
148 #define VBI_CUST2_CFG1          0x00000458
149 #define VBI_CUST2_CFG2          0x0000045C
150 #define VBI_CUST2_CFG3          0x00000460
151 #define VBI_CUST3_CFG1          0x00000464
152 #define VBI_CUST3_CFG2          0x00000468
153 #define VBI_CUST3_CFG3          0x0000046C
154 #define HORIZ_TIM_CTRL          0x00000470
155 #define VERT_TIM_CTRL           0x00000474
156 #define SRC_COMB_CFG            0x00000478
157 #define CHROMA_VBIOFF_CFG       0x0000047C
158 #define FIELD_COUNT             0x00000480
159 #define MISC_TIM_CTRL           0x00000484
160 #define DFE_CTRL1               0x00000488
161 #define DFE_CTRL2               0x0000048C
162 #define DFE_CTRL3               0x00000490
163 #define PLL_CTRL                0x00000494
164 #define HTL_CTRL                0x00000498
165 #define COMB_CTRL               0x0000049C
166 #define CRUSH_CTRL              0x000004A0
167 #define SOFT_RST_CTRL           0x000004A4
168 #define CX885_VERSION           0x000004B4
169 #define VBI_PASS_CTRL           0x000004BC
170
171 /* Audio Decoder Registers */
172 /* 8051 Configuration */
173 #define DL_CTL          0x00000800
174 #define STD_DET_STATUS  0x00000804
175 #define STD_DET_CTL     0x00000808
176 #define DW8051_INT      0x0000080C
177 #define GENERAL_CTL     0x00000810
178 #define AAGC_CTL        0x00000814
179 #define DEMATRIX_CTL    0x000008CC
180 #define PATH1_CTL1      0x000008D0
181 #define PATH1_VOL_CTL   0x000008D4
182 #define PATH1_EQ_CTL    0x000008D8
183 #define PATH1_SC_CTL    0x000008DC
184 #define PATH2_CTL1      0x000008E0
185 #define PATH2_VOL_CTL   0x000008E4
186 #define PATH2_EQ_CTL    0x000008E8
187 #define PATH2_SC_CTL    0x000008EC
188
189 /* Sample Rate Converter */
190 #define SRC_CTL         0x000008F0
191 #define SRC_LF_COEF     0x000008F4
192 #define SRC1_CTL        0x000008F8
193 #define SRC2_CTL        0x000008FC
194 #define SRC3_CTL        0x00000900
195 #define SRC4_CTL        0x00000904
196 #define SRC5_CTL        0x00000908
197 #define SRC6_CTL        0x0000090C
198 #define BAND_OUT_SEL    0x00000910
199 #define I2S_N_CTL       0x00000914
200 #define I2S_OUT_CTL     0x00000918
201 #define AUTOCONFIG_REG  0x000009C4
202
203 /* Audio ADC Registers */
204 #define DSM_CTRL1       0x00000000
205 #define DSM_CTRL2       0x00000001
206 #define CHP_EN_CTRL     0x00000002
207 #define CHP_CLK_CTRL1   0x00000004
208 #define CHP_CLK_CTRL2   0x00000005
209 #define BG_REF_CTRL     0x00000006
210 #define SD2_SW_CTRL1    0x00000008
211 #define SD2_SW_CTRL2    0x00000009
212 #define SD2_BIAS_CTRL   0x0000000A
213 #define AMP_BIAS_CTRL   0x0000000C
214 #define CH_PWR_CTRL1    0x0000000E
215 #define CH_PWR_CTRL2    0x0000000F
216 #define DSM_STATUS1     0x00000010
217 #define DSM_STATUS2     0x00000011
218 #define DIG_CTL1        0x00000012
219 #define DIG_CTL2        0x00000013
220 #define I2S_TX_CFG      0x0000001A
221
222 #define DEV_CNTRL2      0x00040000
223 #define PCI_INT_MSK     0x00040010
224 #define PCI_MSK_APB_DMA   (1 << 12)
225 #define PCI_MSK_AL_WR     (1 << 11)
226 #define PCI_MSK_AL_RD     (1 << 10)
227 #define PCI_MSK_RISC_WR   (1 <<  9)
228 #define PCI_MSK_RISC_RD   (1 <<  8)
229 #define PCI_MSK_AUD_EXT   (1 <<  4)
230 #define PCI_MSK_AUD_INT   (1 <<  3)
231 #define PCI_MSK_VID_C     (1 <<  2)
232 #define PCI_MSK_VID_B     (1 <<  1)
233 #define PCI_MSK_VID_A      1
234 #define PCI_INT_STAT    0x00040014
235 #define PCI_INT_MSTAT   0x00040018
236
237 #define VID_A_INT_MSK   0x00040020
238 #define VID_A_INT_STAT  0x00040024
239 #define VID_A_INT_MSTAT 0x00040028
240 #define VID_A_INT_SSTAT 0x0004002C
241
242 #define VID_B_INT_MSK   0x00040030
243 #define VID_B_INT_STAT  0x00040034
244 #define VID_B_INT_MSTAT 0x00040038
245 #define VID_B_INT_SSTAT 0x0004003C
246
247 #define VID_C_INT_MSK   0x00040040
248 #define VID_C_MSK_BAD_PKT (1 << 20)
249 #define VID_C_MSK_OPC_ERR (1 << 16)
250 #define VID_C_MSK_SYNC    (1 << 12)
251 #define VID_C_MSK_OF      (1 <<  8)
252 #define VID_C_MSK_RISCI2  (1 <<  4)
253 #define VID_C_MSK_RISCI1   1
254 #define VID_C_INT_STAT  0x00040044
255 #define VID_C_INT_MSTAT 0x00040048
256 #define VID_C_INT_SSTAT 0x0004004C
257
258 #define AUDIO_INT_INT_MSK       0x00040050
259 #define AUDIO_INT_INT_STAT      0x00040054
260 #define AUDIO_INT_INT_MSTAT     0x00040058
261 #define AUDIO_INT_INT_SSTAT     0x0004005C
262
263 #define AUDIO_EXT_INT_MSK       0x00040060
264 #define AUDIO_EXT_INT_STAT      0x00040064
265 #define AUDIO_EXT_INT_MSTAT     0x00040068
266 #define AUDIO_EXT_INT_SSTAT     0x0004006C
267
268 #define RDR_CFG0        0x00050000
269 #define RDR_CFG1        0x00050004
270 #define RDR_TLCTL0      0x00050318
271
272 /* APB DMAC Current Buffer Pointer */
273 #define DMA1_PTR1       0x00100000
274 #define DMA2_PTR1       0x00100004
275 #define DMA3_PTR1       0x00100008
276 #define DMA4_PTR1       0x0010000C
277 #define DMA5_PTR1       0x00100010
278 #define DMA6_PTR1       0x00100014
279 #define DMA7_PTR1       0x00100018
280 #define DMA8_PTR1       0x0010001C
281
282 /* APB DMAC Current Table Pointer */
283 #define DMA1_PTR2       0x00100040
284 #define DMA2_PTR2       0x00100044
285 #define DMA3_PTR2       0x00100048
286 #define DMA4_PTR2       0x0010004C
287 #define DMA5_PTR2       0x00100050
288 #define DMA6_PTR2       0x00100054
289 #define DMA7_PTR2       0x00100058
290 #define DMA8_PTR2       0x0010005C
291
292 /* APB DMAC Buffer Limit */
293 #define DMA1_CNT1       0x00100080
294 #define DMA2_CNT1       0x00100084
295 #define DMA3_CNT1       0x00100088
296 #define DMA4_CNT1       0x0010008C
297 #define DMA5_CNT1       0x00100090
298 #define DMA6_CNT1       0x00100094
299 #define DMA7_CNT1       0x00100098
300 #define DMA8_CNT1       0x0010009C
301
302 /* APB DMAC Table Size */
303 #define DMA1_CNT2       0x001000C0
304 #define DMA2_CNT2       0x001000C4
305 #define DMA3_CNT2       0x001000C8
306 #define DMA4_CNT2       0x001000CC
307 #define DMA5_CNT2       0x001000D0
308 #define DMA6_CNT2       0x001000D4
309 #define DMA7_CNT2       0x001000D8
310 #define DMA8_CNT2       0x001000DC
311
312 /* Timer Counters */
313 #define TM_CNT_LDW      0x00110000
314 #define TM_CNT_UW       0x00110004
315 #define TM_LMT_LDW      0x00110008
316 #define TM_LMT_UW       0x0011000C
317
318 /* GPIO */
319 #define GP0_IO          0x00110010
320 #define GPIO_ISM        0x00110014
321 #define SOFT_RESET      0x0011001C
322
323 /* GPIO (417 Microsoftcontroller) RW Data */
324 #define MC417_RWD       0x00110020
325
326 /* GPIO (417 Microsoftcontroller) Output Enable, Low Active */
327 #define MC417_OEN       0x00110024
328 #define MC417_CTL       0x00110028
329 #define CLK_DELAY       0x00110048
330 #define PAD_CTRL        0x0011004C
331
332 /* Video A Interface */
333 #define VID_A_GPCNT             0x00130020
334 #define VBI_A_GPCNT             0x00130024
335 #define VID_A_GPCNT_CTL         0x00130030
336 #define VBI_A_GPCNT_CTL         0x00130034
337 #define VID_A_DMA_CTL           0x00130040
338 #define VID_A_VIP_CTRL          0x00130080
339 #define VID_A_PIXEL_FRMT        0x00130084
340 #define VID_A_VBI_CTRL          0x00130088
341
342 /* Video B Interface */
343 #define VID_B_DMA               0x00130100
344 #define VBI_B_DMA               0x00130108
345 #define VID_B_GPCNT             0x00130120
346 #define VBI_B_GPCNT             0x00130124
347 #define VID_B_GPCNT_CTL         0x00130130
348 #define VBI_B_GPCNT_CTL         0x00130134
349 #define VID_B_DMA_CTL           0x00130140
350 #define VID_B_SRC_SEL           0x00130144
351 #define VID_B_LNGTH             0x00130150
352 #define VID_B_HW_SOP_CTL        0x00130154
353 #define VID_B_GEN_CTL           0x00130158
354 #define VID_B_BD_PKT_STATUS     0x0013015C
355 #define VID_B_SOP_STATUS        0x00130160
356 #define VID_B_FIFO_OVFL_STAT    0x00130164
357 #define VID_B_VLD_MISC          0x00130168
358 #define VID_B_TS_CLK_EN         0x0013016C
359 #define VID_B_VIP_CTRL          0x00130180
360 #define VID_B_PIXEL_FRMT        0x00130184
361
362 /* Video C Interface */
363 #define VID_C_GPCNT             0x00130220
364 #define VID_C_GPCNT_CTL         0x00130230
365 #define VBI_C_GPCNT_CTL         0x00130234
366 #define VID_C_DMA_CTL           0x00130240
367 #define VID_C_LNGTH             0x00130250
368 #define VID_C_HW_SOP_CTL        0x00130254
369 #define VID_C_GEN_CTL           0x00130258
370 #define VID_C_BD_PKT_STATUS     0x0013025C
371 #define VID_C_SOP_STATUS        0x00130260
372 #define VID_C_FIFO_OVFL_STAT    0x00130264
373 #define VID_C_VLD_MISC          0x00130268
374 #define VID_C_TS_CLK_EN         0x0013026C
375
376 /* Internal Audio Interface */
377 #define AUD_INT_A_GPCNT         0x00140020
378 #define AUD_INT_B_GPCNT         0x00140024
379 #define AUD_INT_A_GPCNT_CTL     0x00140030
380 #define AUD_INT_B_GPCNT_CTL     0x00140034
381 #define AUD_INT_DMA_CTL         0x00140040
382 #define AUD_INT_A_LNGTH         0x00140050
383 #define AUD_INT_B_LNGTH         0x00140054
384 #define AUD_INT_A_MODE          0x00140058
385 #define AUD_INT_B_MODE          0x0014005C
386
387 /* External Audio Interface */
388 #define AUD_EXT_DMA             0x00140100
389 #define AUD_EXT_GPCNT           0x00140120
390 #define AUD_EXT_GPCNT_CTL       0x00140130
391 #define AUD_EXT_DMA_CTL         0x00140140
392 #define AUD_EXT_LNGTH           0x00140150
393 #define AUD_EXT_A_MODE          0x00140158
394
395 /* I2C Bus 1 */
396 #define I2C1_ADDR       0x00180000
397 #define I2C1_WDATA      0x00180004
398 #define I2C1_CTRL       0x00180008
399 #define I2C1_RDATA      0x0018000C
400 #define I2C1_STAT       0x00180010
401
402 /* I2C Bus 2 */
403 #define I2C2_ADDR       0x00190000
404 #define I2C2_WDATA      0x00190004
405 #define I2C2_CTRL       0x00190008
406 #define I2C2_RDATA      0x0019000C
407 #define I2C2_STAT       0x00190010
408
409 /* I2C Bus 3 */
410 #define I2C3_ADDR       0x001A0000
411 #define I2C3_WDATA      0x001A0004
412 #define I2C3_CTRL       0x001A0008
413 #define I2C3_RDATA      0x001A000C
414 #define I2C3_STAT       0x001A0010
415
416 /* UART */
417 #define UART_CTL        0x001B0000
418 #define UART_BRD        0x001B0004
419 #define UART_ISR        0x001B000C
420 #define UART_CNT        0x001B0010
421
422 #endif /* _CX23885_REG_H_ */