Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3083 leency 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
8
format MS COFF
9
 
10
DEBUG		equ 1
11
FDEBUG		equ 1
12
DEBUG_IRQ	equ 0
13
 
14
USE_SINGLE_MODE   equ  0   ; 1 = Single mode; 0 = Normal mode.
15
 
16
TEST_VERSION_NUMBER  equ '018b'
17
 
18
;Asper+ [
19
SDO_TAG  equ 1	      ;Asper: Output stream tag id (any number except 0)
20
SDO_IDX  equ 4	      ;Asper: Output stream index
21
;According to "Intel® I/O Controller Hub 6 (ICH6) High Definition Audio / AC ’97 Programmer’s Reference Manual (PRM) May 2005 Document"
22
;and "Intel® I/O Controller Hub 6 (ICH6) Family Datasheet" SDO0=4,
23
;but according to "High Definition Audio Specification Revision 1.0a June 17, 2010" SDO0 depends on the number of SDIs.
24
 
25
SDO_INT  equ 1 shl SDO_IDX  ;Asper: Output stream interrupt (must be power of 2)
26
SDO_OFS  equ 0x80+(SDO_IDX*0x20) ;Asper: Output stream offset
27
;Asper+ ]
28
 
29
include 'proc32.inc'
30
include 'imports.inc'
31
include 'codec_h.inc'
32
 
33
 
34
CURRENT_API	equ   0x0100	  ;1.00
35
COMPATIBLE_API	equ   0x0101	  ;1.01
36
API_VERSION	equ   (COMPATIBLE_API shl 16) or CURRENT_API
37
 
38
IRQ_REMAP	equ 0
39
IRQ_LINE	equ 0
40
 
41
CPU_FREQ	equ  2600d
42
 
43
; Vendors
44
VID_INTEL	  equ 0x8086
45
VID_NVIDIA	  equ 0x10DE
46
VID_ATI 	  equ 0x1002
47
VID_AMD 	  equ 0x1022
48
VID_VIA 	  equ 0x1006
49
VID_SIS 	  equ 0x1039
50
VID_ULI 	  equ 0x10B9
51
VID_CREATIVE	  equ 0x1102
52
VID_TERA	  equ 0x6549
53
VID_RDC 	  equ 0x17F3
54
VID_VMWARE	  equ 0x15AD
55
 
56
; Devices
57
; Intel
58
CTRL_INTEL_SCH2 	 equ  0x080a
59
CTRL_INTEL_HPT		 equ  0x0c0c
60
CTRL_INTEL_CPT		 equ  0x1c20
61
CTRL_INTEL_PGB		 equ  0x1d20
62
CTRL_INTEL_PPT1 	 equ  0x1e20
63
CTRL_INTEL_82801F	 equ  0x2668
64
CTRL_INTEL_63XXESB	 equ  0x269a
65
CTRL_INTEL_82801G	 equ  0x27d8
66
CTRL_INTEL_82801H	 equ  0x284b
67
CTRL_INTEL_82801_UNK1	 equ  0x2911
68
CTRL_INTEL_82801I	 equ  0x293e
69
CTRL_INTEL_82801_UNK2	 equ  0x293f
70
CTRL_INTEL_82801JI	 equ  0x3a3e
71
CTRL_INTEL_82801JD	 equ  0x3a6e
72
CTRL_INTEL_PCH		 equ  0x3b56
73
CTRL_INTEL_PCH2 	 equ  0x3b57
74
CTRL_INTEL_SCH		 equ  0x811b
75
CTRL_INTEL_LPT		 equ  0x8c20
76
; Nvidia
77
CTRL_NVIDIA_MCP51	 equ  0x026c
78
CTRL_NVIDIA_MCP55	 equ  0x0371
79
CTRL_NVIDIA_MCP61_1	 equ  0x03e4
80
CTRL_NVIDIA_MCP61_2	 equ  0x03f0
81
CTRL_NVIDIA_MCP65_1	 equ  0x044a
82
CTRL_NVIDIA_MCP65_2	 equ  0x044b
83
CTRL_NVIDIA_MCP67_1	 equ  0x055c
84
CTRL_NVIDIA_MCP67_2	 equ  0x055d
85
CTRL_NVIDIA_MCP78_1	 equ  0x0774
86
CTRL_NVIDIA_MCP78_2	 equ  0x0775
87
CTRL_NVIDIA_MCP78_3	 equ  0x0776
88
CTRL_NVIDIA_MCP78_4	 equ  0x0777
89
CTRL_NVIDIA_MCP73_1	 equ  0x07fc
90
CTRL_NVIDIA_MCP73_2	 equ  0x07fd
91
CTRL_NVIDIA_MCP79_1	 equ  0x0ac0
92
CTRL_NVIDIA_MCP79_2	 equ  0x0ac1
93
CTRL_NVIDIA_MCP79_3	 equ  0x0ac2
94
CTRL_NVIDIA_MCP79_4	 equ  0x0ac3
95
CTRL_NVIDIA_0BE2	 equ  0x0be2
96
CTRL_NVIDIA_0BE3	 equ  0x0be3
97
CTRL_NVIDIA_0BE4	 equ  0x0be4
98
CTRL_NVIDIA_GT100	 equ  0x0be5
99
CTRL_NVIDIA_GT106	 equ  0x0be9
100
CTRL_NVIDIA_GT108	 equ  0x0bea
101
CTRL_NVIDIA_GT104	 equ  0x0beb
102
CTRL_NVIDIA_GT116	 equ  0x0bee
103
CTRL_NVIDIA_MCP89_1	 equ  0x0d94
104
CTRL_NVIDIA_MCP89_2	 equ  0x0d95
105
CTRL_NVIDIA_MCP89_3	 equ  0x0d96
106
CTRL_NVIDIA_MCP89_4	 equ  0x0d97
107
CTRL_NVIDIA_GF119	 equ  0x0e08
108
CTRL_NVIDIA_GF110_1	 equ  0x0e09
109
CTRL_NVIDIA_GF110_2	 equ  0x0e0c
110
; ATI
111
CTRL_ATI_SB450		 equ  0x437b
112
CTRL_ATI_SB600		 equ  0x4383
113
; ATI HDMI
114
CTRL_ATI_RS600		 equ  0x793b
115
CTRL_ATI_RS690		 equ  0x7919
116
CTRL_ATI_RS780		 equ  0x960f
117
CTRL_ATI_RS_UNK1	 equ  0x970f
118
CTRL_ATI_R600		 equ  0xaa00
119
CTRL_ATI_RV630		 equ  0xaa08
120
CTRL_ATI_RV610		 equ  0xaa10
121
CTRL_ATI_RV670		 equ  0xaa18
122
CTRL_ATI_RV635		 equ  0xaa20
123
CTRL_ATI_RV620		 equ  0xaa28
124
CTRL_ATI_RV770		 equ  0xaa30
125
CTRL_ATI_RV730		 equ  0xaa38
126
CTRL_ATI_RV710		 equ  0xaa40
127
CTRL_ATI_RV740		 equ  0xaa48
128
; AMD
129
CTRL_AMD_HUDSON 	 equ  0x780d
130
; VIA
131
CTRL_VIA_VT82XX 	 equ  0x3288
132
CTRL_VIA_VT61XX 	 equ  0x9140
133
CTRL_VIA_VT71XX 	 equ  0x9170
134
; SiS
135
CTRL_SIS_966		 equ  0x7502
136
; ULI
137
CTRL_ULI_M5461		 equ  0x5461
138
; Creative
139
CTRL_CREATIVE_CA0110_IBG     equ  0x0009
140
CTRL_CREATIVE_SOUND_CORE3D_1 equ  0x0010
141
CTRL_CREATIVE_SOUND_CORE3D_2 equ  0x0012
142
; Teradici
143
CTRL_TERA_UNK1		 equ  0x1200
144
; RDC Semiconductor
145
CTRL_RDC_R3010		 equ  0x3010
146
;VMware
147
CTRL_VMWARE_UNK1	 equ  0x1977
148
 
149
 
150
; driver types
151
AZX_DRIVER_ICH		 equ  0
152
AZX_DRIVER_PCH		 equ  1
153
AZX_DRIVER_SCH		 equ  2
154
AZX_DRIVER_ATI		 equ  3
155
AZX_DRIVER_ATIHDMI	 equ  4
156
AZX_DRIVER_VIA		 equ  5
157
AZX_DRIVER_SIS		 equ  6
158
AZX_DRIVER_ULI		 equ  7
159
AZX_DRIVER_NVIDIA	 equ  8
160
AZX_DRIVER_TERA 	 equ  9
161
AZX_DRIVER_CTX		 equ  10
162
AZX_DRIVER_GENERIC	 equ  11
163
AZX_NUM_DRIVERS 	 equ  12
164
 
165
 
166
; registers
167
 
168
ICH6_REG_GCAP		 equ  0x00
169
ICH6_REG_VMIN		 equ  0x02
170
ICH6_REG_VMAJ		 equ  0x03
171
ICH6_REG_OUTPAY 	 equ  0x04
172
ICH6_REG_INPAY		 equ  0x06
173
ICH6_REG_GCTL		 equ  0x08
174
  ICH6_GCTL_RESET	   equ	(1 shl 0)  ; controller reset
175
  ICH6_GCTL_FCNTRL	   equ	(1 shl 1)  ; flush control
176
  ICH6_GCTL_UNSOL	   equ	(1 shl 8)  ; accept unsol. response enable
177
ICH6_REG_WAKEEN 	 equ  0x0c
178
ICH6_REG_STATESTS	 equ  0x0e
179
ICH6_REG_GSTS		 equ  0x10
180
  ICH6_GSTS_FSTS	   equ	(1 shl 1)  ; flush status
181
ICH6_REG_INTCTL 	 equ  0x20
182
ICH6_REG_INTSTS 	 equ  0x24
183
ICH6_REG_WALLCLK	 equ  0x30  ; 24Mhz source
184
ICH6_REG_OLD_SSYNC	 equ  0x34  ; SSYNC for old ICH
185
ICH6_REG_SSYNC		 equ  0x38
186
ICH6_REG_CORBLBASE	 equ  0x40
187
ICH6_REG_CORBUBASE	 equ  0x44
188
ICH6_REG_CORBWP 	 equ  0x48
189
ICH6_REG_CORBRP 	 equ  0x4A
190
  ICH6_CORBRP_RST	   equ	(1 shl 15)  ; read pointer reset
191
ICH6_REG_CORBCTL	 equ  0x4c
192
  ICH6_CORBCTL_RUN	   equ	(1 shl 1)   ; enable DMA
193
  ICH6_CORBCTL_CMEIE	   equ	(1 shl 0)   ; enable memory error irq
194
ICH6_REG_CORBSTS	 equ  0x4d
195
  ICH6_CORBSTS_CMEI	   equ	(1 shl 0)   ; memory error indication
196
ICH6_REG_CORBSIZE	 equ  0x4e
197
 
198
ICH6_REG_RIRBLBASE	 equ  0x50
199
ICH6_REG_RIRBUBASE	 equ  0x54
200
ICH6_REG_RIRBWP 	 equ  0x58
201
  ICH6_RIRBWP_RST	   equ	(1 shl 15)  ; write pointer reset
202
ICH6_REG_RINTCNT	 equ  0x5a
203
ICH6_REG_RIRBCTL	 equ  0x5c
204
  ICH6_RBCTL_IRQ_EN	   equ	(1 shl 0)   ; enable IRQ
205
  ICH6_RBCTL_DMA_EN	   equ	(1 shl 1)   ; enable DMA
206
  ICH6_RBCTL_OVERRUN_EN    equ	(1 shl 2)   ; enable overrun irq
207
ICH6_REG_RIRBSTS	 equ  0x5d
208
  ICH6_RBSTS_IRQ	   equ	(1 shl 0)   ; response irq
209
  ICH6_RBSTS_OVERRUN	   equ	(1 shl 2)   ; overrun irq
210
ICH6_REG_RIRBSIZE	 equ  0x5e
211
 
212
ICH6_REG_IC		 equ  0x60
213
ICH6_REG_IR		 equ  0x64
214
ICH6_REG_IRS		 equ  0x68
215
  ICH6_IRS_VALID	   equ	2
216
  ICH6_IRS_BUSY 	   equ	1
217
 
218
ICH6_REG_DPLBASE	 equ  0x70
219
ICH6_REG_DPUBASE	 equ  0x74
220
  ICH6_DPLBASE_ENABLE	   equ	1     ; Enable position buffer
221
 
222
; SD offset: SDI0=0x80, SDI1=0xa0, ... SDO3=0x160 */
223
SDI0_SD_OFFSET	  equ  0x80
224
SDI1_SD_OFFSET	  equ  0xA0
225
SDI2_SD_OFFSET	  equ  0xC0
226
SDI3_SD_OFFSET	  equ  0xE0
227
SDO0_SD_OFFSET	  equ  0x100
228
SDO1_SD_OFFSET	  equ  0x120
229
SDO2_SD_OFFSET	  equ  0X140
230
SDO3_SD_OFFSET	  equ  0x160
231
 
232
; stream register offsets from stream base
233
ICH6_REG_SD_CTL 	 equ  0x00
234
ICH6_REG_SD_STS 	 equ  0x03
235
ICH6_REG_SD_LPIB	 equ  0x04
236
ICH6_REG_SD_CBL 	 equ  0x08
237
ICH6_REG_SD_LVI 	 equ  0x0c
238
ICH6_REG_SD_FIFOW	 equ  0x0e
239
ICH6_REG_SD_FIFOSIZE	 equ  0x10
240
ICH6_REG_SD_FORMAT	 equ  0x12
241
ICH6_REG_SD_BDLPL	 equ  0x18
242
ICH6_REG_SD_BDLPU	 equ  0x1c
243
 
244
; PCI space
245
ICH6_PCIREG_TCSEL	 equ  0x44
246
 
247
; other constants
248
ICH6_RIRB_EX_UNSOL_EV	 equ   (1 shl 4)
249
 
250
; max number of SDs
251
MAX_ICH6_DEV		 equ  8
252
; max number of fragments - we may use more if allocating more pages for BDL
253
AZX_MAX_FRAG		 equ  (4096 / (MAX_ICH6_DEV * 16))
254
; max buffer size - no h/w limit, you can increase as you like
255
AZX_MAX_BUF_SIZE	 equ  (1024*1024*1024)
256
; max number of PCM devices per card
257
AZX_MAX_PCMS		 equ  8
258
 
259
; RIRB int mask: overrun[2], response[0]
260
RIRB_INT_RESPONSE	 equ  0x01
261
RIRB_INT_OVERRUN	 equ  0x04
262
RIRB_INT_MASK		 equ  0x05
263
 
264
; STATESTS int mask: SD2,SD1,SD0
265
STATESTS_INT_MASK	 equ  0x07
266
AZX_MAX_CODECS		 equ  4
267
 
268
; SD_CTL bits
269
SD_CTL_STREAM_RESET	 equ  0x01    ; stream reset bit
270
SD_CTL_DMA_START	 equ  0x02    ; stream DMA start bit
271
SD_CTL_STREAM_TAG_MASK	 equ  (0xf shl 20)
272
SD_CTL_STREAM_TAG_SHIFT  equ  20