xref: /haiku/src/add-ons/kernel/drivers/dvb/cx23882/cx23882_regs.h (revision 083a11a3f4b17abb0e5c8d97bb9886af54626abf)
1*083a11a3SMarcus Overhagen /*
2*083a11a3SMarcus Overhagen  * Copyright (c) 2004-2007 Marcus Overhagen <marcus@overhagen.de>
3*083a11a3SMarcus Overhagen  *
4*083a11a3SMarcus Overhagen  * Permission is hereby granted, free of charge, to any person
5*083a11a3SMarcus Overhagen  * obtaining a copy of this software and associated documentation
6*083a11a3SMarcus Overhagen  * files (the "Software"), to deal in the Software without restriction,
7*083a11a3SMarcus Overhagen  * including without limitation the rights to use, copy, modify,
8*083a11a3SMarcus Overhagen  * merge, publish, distribute, sublicense, and/or sell copies of
9*083a11a3SMarcus Overhagen  * the Software, and to permit persons to whom the Software is
10*083a11a3SMarcus Overhagen  * furnished to do so, subject to the following conditions:
11*083a11a3SMarcus Overhagen  *
12*083a11a3SMarcus Overhagen  * The above copyright notice and this permission notice shall be
13*083a11a3SMarcus Overhagen  * included in all copies or substantial portions of the Software.
14*083a11a3SMarcus Overhagen  *
15*083a11a3SMarcus Overhagen  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16*083a11a3SMarcus Overhagen  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17*083a11a3SMarcus Overhagen  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18*083a11a3SMarcus Overhagen  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19*083a11a3SMarcus Overhagen  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20*083a11a3SMarcus Overhagen  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21*083a11a3SMarcus Overhagen  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22*083a11a3SMarcus Overhagen  * OTHER DEALINGS IN THE SOFTWARE.
23*083a11a3SMarcus Overhagen  */
24*083a11a3SMarcus Overhagen 
25*083a11a3SMarcus Overhagen #ifndef __CX23882_REGS_H
26*083a11a3SMarcus Overhagen #define __CX23882_REGS_H
27*083a11a3SMarcus Overhagen 
28*083a11a3SMarcus Overhagen #define PCI_PCICMD_IOS			0x01
29*083a11a3SMarcus Overhagen #define PCI_PCICMD_MSE			0x02
30*083a11a3SMarcus Overhagen #define PCI_PCICMD_BME			0x04
31*083a11a3SMarcus Overhagen 
32*083a11a3SMarcus Overhagen #define PCI_VENDOR_SIS			0x1039
33*083a11a3SMarcus Overhagen #define PCI_VENDOR_VIA			0x1106
34*083a11a3SMarcus Overhagen 
35*083a11a3SMarcus Overhagen #define REG_PDMA_STHRSH			0x200000
36*083a11a3SMarcus Overhagen #define REG_PDMA_DTHRSH			0x200010
37*083a11a3SMarcus Overhagen 
38*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_1			0x0100
39*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_2			0x0200
40*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_3			0x0300
41*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_4			0x0400
42*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_5			0x0500
43*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_6			0x0600
44*083a11a3SMarcus Overhagen #define PDMA_ISBTHRSH_7			0x0700
45*083a11a3SMarcus Overhagen 
46*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_1			0x0001
47*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_2			0x0002
48*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_3			0x0003
49*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_4			0x0004
50*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_5			0x0005
51*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_6			0x0006
52*083a11a3SMarcus Overhagen #define PDMA_PCITHRSH_7			0x0007
53*083a11a3SMarcus Overhagen 
54*083a11a3SMarcus Overhagen #define REG_DEV_CNTRL2			0x200034
55*083a11a3SMarcus Overhagen 
56*083a11a3SMarcus Overhagen #define DEV_CNTRL2_RUN_RISC		0x20
57*083a11a3SMarcus Overhagen 
58*083a11a3SMarcus Overhagen #define REG_PCI_INT_MSK			0x200040
59*083a11a3SMarcus Overhagen #define REG_PCI_INT_STAT		0x200044
60*083a11a3SMarcus Overhagen #define REG_PCI_INT_MSTAT		0x200048
61*083a11a3SMarcus Overhagen 
62*083a11a3SMarcus Overhagen #define PCI_INT_STAT_VID_INT	0x01
63*083a11a3SMarcus Overhagen #define PCI_INT_STAT_AUD_INT	0x02
64*083a11a3SMarcus Overhagen #define PCI_INT_STAT_TS_INT		0x04
65*083a11a3SMarcus Overhagen #define PCI_INT_STAT_VIP_INT	0x08
66*083a11a3SMarcus Overhagen #define PCI_INT_STAT_HST_INT	0x10
67*083a11a3SMarcus Overhagen 
68*083a11a3SMarcus Overhagen #define REG_VID_INT_MSK			0x200050
69*083a11a3SMarcus Overhagen #define REG_VID_INT_STAT		0x200054
70*083a11a3SMarcus Overhagen #define REG_VID_INT_MSTAT		0x200058
71*083a11a3SMarcus Overhagen 
72*083a11a3SMarcus Overhagen #define REG_AUD_INT_MSK			0x200060
73*083a11a3SMarcus Overhagen #define REG_AUD_INT_STAT		0x200064
74*083a11a3SMarcus Overhagen #define REG_AUD_INT_MSTAT		0x200068
75*083a11a3SMarcus Overhagen 
76*083a11a3SMarcus Overhagen #define REG_TS_INT_MSK			0x200070
77*083a11a3SMarcus Overhagen #define REG_TS_INT_STAT			0x200074
78*083a11a3SMarcus Overhagen #define REG_TS_INT_MSTAT		0x200078
79*083a11a3SMarcus Overhagen 
80*083a11a3SMarcus Overhagen #define TS_INT_STAT_TS_RISC1	0x000001
81*083a11a3SMarcus Overhagen #define TS_INT_STAT_TS_RISC2	0x000010
82*083a11a3SMarcus Overhagen #define TS_INT_STAT_OPC_ERR		0x010000
83*083a11a3SMarcus Overhagen 
84*083a11a3SMarcus Overhagen #define REG_VIP_INT_MSK			0x200080
85*083a11a3SMarcus Overhagen #define REG_VIP_INT_STAT		0x200084
86*083a11a3SMarcus Overhagen #define REG_VIP_INT_MSTAT		0x200088
87*083a11a3SMarcus Overhagen 
88*083a11a3SMarcus Overhagen #define REG_HST_INT_MSK			0x200090
89*083a11a3SMarcus Overhagen #define REG_HST_INT_STAT		0x200094
90*083a11a3SMarcus Overhagen #define REG_HST_INT_MSTAT		0x200098
91*083a11a3SMarcus Overhagen 
92*083a11a3SMarcus Overhagen #define REG_F2_DEV_CNTRL1		0x2f0240
93*083a11a3SMarcus Overhagen #define F2_DEV_CNTRL1_EN_VSFX	0x8
94*083a11a3SMarcus Overhagen 
95*083a11a3SMarcus Overhagen #define REG_DMA28_PTR1			0x30009c
96*083a11a3SMarcus Overhagen #define REG_DMA28_PTR2			0x3000dc
97*083a11a3SMarcus Overhagen #define REG_DMA28_CNT1			0x30011c
98*083a11a3SMarcus Overhagen #define REG_DMA28_CNT2			0x30015c
99*083a11a3SMarcus Overhagen 
100*083a11a3SMarcus Overhagen #define REG_TS_GP_CNT_CNTRL		0x33c030
101*083a11a3SMarcus Overhagen #define REG_TS_DMA_CNTRL		0x33c040
102*083a11a3SMarcus Overhagen 
103*083a11a3SMarcus Overhagen #define TS_DMA_CNTRL_TS_FIFO_EN	0x01
104*083a11a3SMarcus Overhagen #define TS_DMA_CNTRL_TS_RISC_EN	0x10
105*083a11a3SMarcus Overhagen 
106*083a11a3SMarcus Overhagen #define REG_TS_LNGTH			0x33c048
107*083a11a3SMarcus Overhagen #define REG_HW_SOP_CONTROL		0x33c04c
108*083a11a3SMarcus Overhagen #define REG_TS_GEN_CONTROL		0x33c050
109*083a11a3SMarcus Overhagen 
110*083a11a3SMarcus Overhagen #define TS_GEN_CONTROL_IPB_SMODE 0x08
111*083a11a3SMarcus Overhagen 
112*083a11a3SMarcus Overhagen #define REG_TS_BD_PKT_STATUS	0x33c054
113*083a11a3SMarcus Overhagen #define REG_TS_SOP_STATUS		0x33c058
114*083a11a3SMarcus Overhagen 
115*083a11a3SMarcus Overhagen #define REG_VIP_STREAM_EN		0x34c040
116*083a11a3SMarcus Overhagen 
117*083a11a3SMarcus Overhagen // these 3 are not in my spec, taken form Linux
118*083a11a3SMarcus Overhagen #define REG_DMA_RISC_INT_MSK 	0x35C060
119*083a11a3SMarcus Overhagen #define REG_DMA_RISC_INT_STAT	0x35C064
120*083a11a3SMarcus Overhagen #define REG_DMA_RISC_INT_MSTAT	0x35C068
121*083a11a3SMarcus Overhagen 
122*083a11a3SMarcus Overhagen #define REG_I2C_CONTROL			0x368000
123*083a11a3SMarcus Overhagen #define I2C_SDA					0x01
124*083a11a3SMarcus Overhagen #define I2C_SCL					0x02
125*083a11a3SMarcus Overhagen #define I2C_HW_MODE				0x80
126*083a11a3SMarcus Overhagen 
127*083a11a3SMarcus Overhagen #define REG_HST_STREAM_EN		0x38c040
128*083a11a3SMarcus Overhagen 
129*083a11a3SMarcus Overhagen 
130*083a11a3SMarcus Overhagen // RISC instructions
131*083a11a3SMarcus Overhagen #define RISC_RESYNC				0x80008000
132*083a11a3SMarcus Overhagen #define RISC_WRITE				0x10000000
133*083a11a3SMarcus Overhagen #define RISC_SKIP				0x20000000
134*083a11a3SMarcus Overhagen #define RISC_JUMP				0x70000000
135*083a11a3SMarcus Overhagen #define RISC_WRITECR			0xd0000000
136*083a11a3SMarcus Overhagen 
137*083a11a3SMarcus Overhagen #define RISC_IMM				0x00000001
138*083a11a3SMarcus Overhagen #define RISC_SOL				0x08000000
139*083a11a3SMarcus Overhagen #define RISC_EOL				0x04000000
140*083a11a3SMarcus Overhagen #define RISC_IRQ2				0x02000000
141*083a11a3SMarcus Overhagen #define RISC_IRQ1				0x01000000
142*083a11a3SMarcus Overhagen #define RISC_SRP				0x00000001
143*083a11a3SMarcus Overhagen 
144*083a11a3SMarcus Overhagen #endif
145