Rev 168 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 168 | Rev 188 | ||
---|---|---|---|
Line 93... | Line 93... | ||
93 | DEV_GET_MASTERVOL equ 7 |
93 | DEV_GET_MASTERVOL equ 7 |
94 | DEV_GET_INFO equ 8 |
94 | DEV_GET_INFO equ 8 |
95 | 95 | ||
Line 96... | Line 96... | ||
96 | struc AC_CNTRL ;AC controller base class |
96 | struc AC_CNTRL ;AC controller base class |
97 | { .bus dd 0 |
97 | { .bus dd ? |
98 | .devfn dd 0 |
98 | .devfn dd ? |
Line 99... | Line 99... | ||
99 | 99 | ||
100 | .vendor dd 0 |
100 | .vendor dd ? |
101 | .dev_id dd 0 |
101 | .dev_id dd ? |
102 | .pci_cmd dd 0 |
102 | .pci_cmd dd ? |
103 | .pci_stat dd 0 |
- | |
104 | - | ||
105 | .codec_io_base dd 0 |
- | |
106 | .codec_mem_base dd 0 |
- | |
107 | - | ||
108 | .ctrl_io_base dd 0 |
- | |
109 | .ctrl_mem_base dd 0 |
- | |
110 | .cfg_reg dd 0 |
- | |
111 | .int_line dd 0 |
- | |
112 | - | ||
113 | .vendor_ids dd 0 ;vendor id string |
- | |
114 | .ctrl_ids dd 0 ;hub id string |
- | |
115 | - | ||
116 | .buffer dd 0 |
- | |
117 | - | ||
118 | .notify_pos dd 0 |
- | |
119 | .notify_task dd 0 |
- | |
120 | - | ||
121 | .lvi_reg dd 0 |
- | |
122 | .ctrl_setup dd 0 |
- | |
123 | .user_callback dd 0 |
- | |
124 | .codec_read16 dd 0 |
- | |
125 | .codec_write16 dd 0 |
- | |
126 | - | ||
127 | .ctrl_read8 dd 0 |
- | |
128 | .ctrl_read16 dd 0 |
- | |
129 | .ctrl_read32 dd 0 |
- | |
130 | - | ||
131 | .ctrl_write8 dd 0 |
- | |
132 | .ctrl_write16 dd 0 |
- | |
133 | .ctrl_write32 dd 0 |
- | |
Line 134... | Line -... | ||
134 | } |
- | |
135 | - | ||
136 | struc CODEC ;Audio Chip base class |
103 | .pci_stat dd ? |
137 | { |
- | |
138 | .chip_id dd 0 |
104 | |
Line -... | Line 105... | ||
- | 105 | .codec_io_base dd ? |
|
- | 106 | .codec_mem_base dd ? |
|
139 | .flags dd 0 |
107 | |
140 | .status dd 0 |
108 | .ctrl_io_base dd ? |
Line 141... | Line 109... | ||
141 | 109 | .ctrl_mem_base dd ? |
|
- | 110 | .cfg_reg dd ? |
|
- | 111 | .int_line dd ? |
|
142 | .ac_vendor_ids dd 0 ;ac vendor id string |
112 | |
Line 143... | Line -... | ||
143 | .chip_ids dd 0 ;chip model string |
- | |
144 | - | ||
145 | .shadow_flag dd 0 |
- | |
146 | dd 0 |
- | |
147 | - | ||
148 | .regs dw 0 ; codec registers |
- | |
149 | .reg_master_vol dw 0 ;0x02 |
- | |
150 | .reg_aux_out_vol dw 0 ;0x04 |
113 | .vendor_ids dd ? ;vendor id string |
151 | .reg_mone_vol dw 0 ;0x06 |
- | |
152 | .reg_master_tone dw 0 ;0x08 |
114 | .ctrl_ids dd ? ;hub id string |
- | 115 | ||
153 | .reg_beep_vol dw 0 ;0x0A |
116 | .buffer dd ? |
154 | .reg_phone_vol dw 0 ;0x0C |
- | |
155 | .reg_mic_vol dw 0 ;0x0E |
- | |
156 | .reg_line_in_vol dw 0 ;0x10 |
117 | |
157 | .reg_cd_vol dw 0 ;0x12 |
- | |
158 | .reg_video_vol dw 0 ;0x14 |
118 | .notify_pos dd ? |
159 | .reg_aux_in_vol dw 0 ;0x16 |
119 | .notify_task dd ? |
160 | .reg_pcm_out_vol dw 0 ;0x18 |
120 | |
- | 121 | .lvi_reg dd ? |
|
161 | .reg_rec_select dw 0 ;0x1A |
122 | .ctrl_setup dd ? |
162 | .reg_rec_gain dw 0 ;0x1C |
- | |
163 | .reg_rec_gain_mic dw 0 ;0x1E |
123 | .user_callback dd ? |
164 | .reg_gen dw 0 ;0x20 |
- | |
165 | .reg_3d_ctrl dw 0 ;0X22 |
124 | .codec_read16 dd ? |
- | 125 | .codec_write16 dd ? |
|
166 | .reg_page dw 0 ;0X24 |
126 | |
167 | .reg_powerdown dw 0 ;0x26 |
127 | .ctrl_read8 dd ? |
168 | .reg_ext_audio dw 0 ;0x28 |
128 | .ctrl_read16 dd ? |
169 | .reg_ext_st dw 0 ;0x2a |
- | |
170 | .reg_pcm_front_rate dw 0 ;0x2c |
- | |
171 | .reg_pcm_surr_rate dw 0 ;0x2e |
- | |
172 | .reg_lfe_rate dw 0 ;0x30 |
- | |
173 | .reg_pcm_in_rate dw 0 ;0x32 |
- | |
174 | dw 0 ;0x34 |
- | |
175 | .reg_cent_lfe_vol dw 0 ;0x36 |
- | |
176 | .reg_surr_vol dw 0 ;0x38 |
- | |
177 | .reg_spdif_ctrl dw 0 ;0x3A |
- | |
178 | dw 0 ;0x3C |
- | |
179 | dw 0 ;0x3E |
- | |
180 | dw 0 ;0x40 |
- | |
181 | dw 0 ;0x42 |
- | |
182 | dw 0 ;0x44 |
- | |
183 | dw 0 ;0x46 |
- | |
184 | dw 0 ;0x48 |
- | |
185 | dw 0 ;0x4A |
- | |
186 | dw 0 ;0x4C |
- | |
187 | dw 0 ;0x4E |
- | |
188 | dw 0 ;0x50 |
- | |
189 | dw 0 ;0x52 |
- | |
190 | dw 0 ;0x54 |
- | |
191 | dw 0 ;0x56 |
- | |
192 | dw 0 ;0x58 |
- | |
193 | dw 0 ;0x5A |
- | |
194 | dw 0 ;0x5C |
- | |
195 | dw 0 ;0x5E |
- | |
196 | .reg_page_0 dw 0 ;0x60 |
- | |
197 | .reg_page_1 dw 0 ;0x62 |
- | |
198 | .reg_page_2 dw 0 ;0x64 |
- | |
199 | .reg_page_3 dw 0 ;0x66 |
- | |
200 | .reg_page_4 dw 0 ;0x68 |
- | |
201 | .reg_page_5 dw 0 ;0x6A |
- | |
202 | .reg_page_6 dw 0 ;0x6C |
- | |
203 | .reg_page_7 dw 0 ;0x6E |
- | |
204 | dw 0 ;0x70 |
- | |
205 | dw 0 ;0x72 |
- | |
206 | dw 0 ;0x74 |
- | |
- | 129 | .ctrl_read32 dd ? |
|
Line -... | Line 130... | ||
- | 130 | ||
- | 131 | .ctrl_write8 dd ? |
|
- | 132 | .ctrl_write16 dd ? |
|
- | 133 | .ctrl_write32 dd ? |
|
- | 134 | } |
|
- | 135 | ||
- | 136 | struc CODEC ;Audio Chip base class |
|
- | 137 | { |
|
- | 138 | .chip_id dd ? |
|
- | 139 | .flags dd ? |
|
- | 140 | .status dd ? |
|
- | 141 | ||
- | 142 | .ac_vendor_ids dd ? ;ac vendor id string |
|
- | 143 | .chip_ids dd ? ;chip model string |
|
- | 144 | ||
- | 145 | .shadow_flag dd ? |
|
- | 146 | dd ? |
|
- | 147 | ||
- | 148 | .regs dw ? ; codec registers |
|
- | 149 | .reg_master_vol dw ? ;0x02 |
|
- | 150 | .reg_aux_out_vol dw ? ;0x04 |
|
- | 151 | .reg_mone_vol dw ? ;0x06 |
|
- | 152 | .reg_master_tone dw ? ;0x08 |
|
- | 153 | .reg_beep_vol dw ? ;0x0A |
|
- | 154 | .reg_phone_vol dw ? ;0x0C |
|
- | 155 | .reg_mic_vol dw ? ;0x0E |
|
- | 156 | .reg_line_in_vol dw ? ;0x10 |
|
- | 157 | .reg_cd_vol dw ? ;0x12 |
|
- | 158 | .reg_video_vol dw ? ;0x14 |
|
- | 159 | .reg_aux_in_vol dw ? ;0x16 |
|
- | 160 | .reg_pcm_out_vol dw ? ;0x18 |
|
- | 161 | .reg_rec_select dw ? ;0x1A |
|
- | 162 | .reg_rec_gain dw ? ;0x1C |
|
- | 163 | .reg_rec_gain_mic dw ? ;0x1E |
|
- | 164 | .reg_gen dw ? ;0x20 |
|
- | 165 | .reg_3d_ctrl dw ? ;0X22 |
|
- | 166 | .reg_page dw ? ;0X24 |
|
- | 167 | .reg_powerdown dw ? ;0x26 |
|
- | 168 | .reg_ext_audio dw ? ;0x28 |
|
- | 169 | .reg_ext_st dw ? ;0x2a |
|
- | 170 | .reg_pcm_front_rate dw ? ;0x2c |
|
- | 171 | .reg_pcm_surr_rate dw ? ;0x2e |
|
- | 172 | .reg_lfe_rate dw ? ;0x30 |
|
- | 173 | .reg_pcm_in_rate dw ? ;0x32 |
|
- | 174 | dw ? ;0x34 |
|
- | 175 | .reg_cent_lfe_vol dw ? ;0x36 |
|
- | 176 | .reg_surr_vol dw ? ;0x38 |
|
- | 177 | .reg_spdif_ctrl dw ? ;0x3A |
|
- | 178 | dw ? ;0x3C |
|
- | 179 | dw ? ;0x3E |
|
- | 180 | dw ? ;0x40 |
|
- | 181 | dw ? ;0x42 |
|
- | 182 | dw ? ;0x44 |
|
- | 183 | dw ? ;0x46 |
|
- | 184 | dw ? ;0x48 |
|
- | 185 | dw ? ;0x4A |
|
- | 186 | dw ? ;0x4C |
|
- | 187 | dw ? ;0x4E |
|
- | 188 | dw ? ;0x50 |
|
- | 189 | dw ? ;0x52 |
|
- | 190 | dw ? ;0x54 |
|
- | 191 | dw ? ;0x56 |
|
- | 192 | dw ? ;0x58 |
|
- | 193 | dw ? ;0x5A |
|
- | 194 | dw ? ;0x5C |
|
- | 195 | dw ? ;0x5E |
|
- | 196 | .reg_page_0 dw ? ;0x60 |
|
- | 197 | .reg_page_1 dw ? ;0x62 |
|
- | 198 | .reg_page_2 dw ? ;0x64 |
|
- | 199 | .reg_page_3 dw ? ;0x66 |
|
- | 200 | .reg_page_4 dw ? ;0x68 |
|
- | 201 | .reg_page_5 dw ? ;0x6A |
|
- | 202 | .reg_page_6 dw ? ;0x6C |
|
- | 203 | .reg_page_7 dw ? ;0x6E |
|
- | 204 | dw ? ;0x70 |
|
- | 205 | dw ? ;0x72 |
|
Line -... | Line 206... | ||
- | 206 | dw ? ;0x74 |
|
207 | dw 0 ;0x76 |
207 | dw ? ;0x76 |
208 | dw 0 ;0x78 |
208 | dw ? ;0x78 |
209 | dw 0 ;0x7A |
209 | dw ? ;0x7A |
Line 210... | Line 210... | ||
210 | .reg_vendor_id_1 dw 0 ;0x7C |
210 | .reg_vendor_id_1 dw ? ;0x7C |
211 | .reg_vendor_id_2 dw 0 ;0x7E |
211 | .reg_vendor_id_2 dw ? ;0x7E |
212 | 212 | ||
Line 245... | Line 245... | ||
245 | OS_BASE equ 0; 0x80400000 |
245 | OS_BASE equ 0; 0x80400000 |
246 | new_app_base equ 0x60400000; 0x01000000 |
246 | new_app_base equ 0x60400000; 0x01000000 |
247 | PROC_BASE equ OS_BASE+0x0080000 |
247 | PROC_BASE equ OS_BASE+0x0080000 |
Line 248... | Line -... | ||
248 | - | ||
249 | - | ||
250 | public service_proc |
248 | |
251 | public START |
249 | public START |
- | 250 | public STOP |
|
Line -... | Line 251... | ||
- | 251 | public service_proc |
|
- | 252 | ||
- | 253 | extrn AttachIntHandler |
|
- | 254 | extrn SysMsgBoardStr |
|
- | 255 | extrn PciApi |
|
- | 256 | extrn PciRead32 |
|
- | 257 | extrn PciRead8 |
|
- | 258 | extrn PciWrite8 |
|
- | 259 | extrn AllocKernelSpace |
|
- | 260 | extrn MapPage |
|
- | 261 | extrn RegService |
|
- | 262 | extrn KernelAlloc |
|
- | 263 | extrn GetPgAddr |
|
252 | public IMPORTS |
264 | extrn GetCurrentTask |
Line 253... | Line 265... | ||
253 | 265 | ||
254 | section '.flat' align 16 |
266 | section '.flat' code readable align 16 |
255 | 267 | ||
256 | START: |
268 | START: |
257 | if DEBUG |
269 | if DEBUG |
Line 258... | Line 270... | ||
258 | mov esi, msgInit |
270 | mov esi, msgInit |
259 | call [SysMsgBoardStr] |
271 | call SysMsgBoardStr |
260 | end if |
272 | end if |
Line 261... | Line 273... | ||
261 | 273 | ||
262 | call detect_controller |
274 | call detect_controller |
263 | test eax, eax |
275 | test eax, eax |
264 | jz .fail |
276 | jz .fail |
265 | 277 | ||
266 | if DEBUG |
278 | if DEBUG |
Line 267... | Line 279... | ||
267 | mov esi,[ctrl.vendor_ids] |
279 | mov esi,[ctrl.vendor_ids] |
268 | call [SysMsgBoardStr] |
280 | call SysMsgBoardStr |
269 | mov esi, [ctrl.ctrl_ids] |
281 | mov esi, [ctrl.ctrl_ids] |
Line 270... | Line 282... | ||
270 | call [SysMsgBoardStr] |
282 | call SysMsgBoardStr |
271 | end if |
283 | end if |
272 | 284 | ||
273 | call init_controller |
285 | call init_controller |
Line 274... | Line 286... | ||
274 | test eax, eax |
286 | test eax, eax |
275 | jz .fail |
287 | jz .fail |
276 | 288 | ||
Line 277... | Line 289... | ||
277 | if DEBUG |
289 | if DEBUG |
278 | mov esi, msgInitCodec |
290 | mov esi, msgInitCodec |
279 | call [SysMsgBoardStr] |
291 | call SysMsgBoardStr |
Line 280... | Line 292... | ||
280 | end if |
292 | end if |
281 | 293 | ||
282 | call init_codec |
294 | call init_codec |
Line 283... | Line 295... | ||
283 | test eax, eax |
295 | test eax, eax |
284 | jz .fail |
296 | jz .fail |
Line 285... | Line 297... | ||
285 | 297 | ||
286 | if DEBUG |
298 | if DEBUG |
Line 287... | Line 299... | ||
287 | mov esi, [codec.ac_vendor_ids] |
299 | mov esi, [codec.ac_vendor_ids] |
Line 288... | Line 300... | ||
288 | call [SysMsgBoardStr] |
300 | call SysMsgBoardStr |
Line 289... | Line 301... | ||
289 | 301 | ||
Line 290... | Line 302... | ||
290 | mov esi, [codec.chip_ids] |
302 | mov esi, [codec.chip_ids] |
291 | call [SysMsgBoardStr] |
303 | call SysMsgBoardStr |
Line 292... | Line 304... | ||
292 | end if |
304 | end if |
Line 293... | Line 305... | ||
293 | 305 | ||
294 | call reset_controller |
306 | call reset_controller |
295 | call setup_codec |
307 | call setup_codec |
296 | 308 | ||
297 | mov esi, msgPrimBuff |
309 | mov esi, msgPrimBuff |
298 | call [SysMsgBoardStr] |
310 | call SysMsgBoardStr |
299 | 311 | ||
300 | call create_primary_buff |
312 | call create_primary_buff |
Line 301... | Line 313... | ||
301 | 313 | ||
302 | stdcall [AttachIntHandler], [ctrl.int_line], ac97_irq |
314 | stdcall AttachIntHandler, [ctrl.int_line], ac97_irq |
Line 332... | Line 344... | ||
332 | cmp eax, DEV_PLAY |
344 | cmp eax, DEV_PLAY |
333 | jne @F |
345 | jne @F |
334 | if DEBUG |
346 | if DEBUG |
335 | mov esi, msgPlay |
347 | mov esi, msgPlay |
336 | call [SysMsgBoardStr] |
348 | call SysMsgBoardStr |
337 | end if |
349 | end if |
338 | call play |
350 | call play |
339 | ret |
351 | ret |
340 | @@: |
352 | @@: |
341 | cmp eax, DEV_STOP |
353 | cmp eax, DEV_STOP |
342 | jne @F |
354 | jne @F |
343 | if DEBUG |
355 | if DEBUG |
344 | mov esi, msgStop |
356 | mov esi, msgStop |
345 | call [SysMsgBoardStr] |
357 | call SysMsgBoardStr |
346 | end if |
358 | end if |
347 | call stop |
359 | call stop |
348 | ret |
360 | ret |
349 | @@: |
361 | @@: |
350 | cmp eax, DEV_CALLBACK |
362 | cmp eax, DEV_CALLBACK |
351 | jne @F |
363 | jne @F |
Line 390... | Line 402... | ||
390 | proc ac97_irq |
402 | proc ac97_irq |
391 | 403 | ||
Line 392... | Line 404... | ||
392 | ; if DEBUG |
404 | ; if DEBUG |
393 | ; mov esi, msgIRQ |
405 | ; mov esi, msgIRQ |
394 | ; call [SysMsgBoardStr] |
406 | ; call SysMsgBoardStr |
395 | ; end if |
407 | ; end if |
Line 396... | Line 408... | ||
396 | 408 | ||
397 | mov edx, PCM_OUT_CR_REG |
409 | mov edx, PCM_OUT_CR_REG |
398 | mov al, 0x14 |
410 | mov al, 0x14 |
Line 442... | Line 454... | ||
442 | 454 | ||
Line 443... | Line 455... | ||
443 | align 4 |
455 | align 4 |
444 | proc create_primary_buff |
456 | proc create_primary_buff |
Line 445... | Line 457... | ||
445 | 457 | ||
446 | stdcall [KernelAlloc], 0x10000 |
458 | stdcall KernelAlloc, 0x10000 |
Line 447... | Line 459... | ||
447 | mov [ctrl.buffer], eax |
459 | mov [ctrl.buffer], eax |
448 | 460 | ||
449 | mov edi, eax |
461 | mov edi, eax |
450 | mov ecx, 0x10000/4 |
462 | mov ecx, 0x10000/4 |
Line 451... | Line 463... | ||
451 | xor eax, eax |
463 | xor eax, eax |
Line 452... | Line 464... | ||
452 | rep stosd |
464 | rep stosd |
453 | 465 | ||
454 | stdcall [GetPgAddr], [ctrl.buffer] |
466 | stdcall GetPgAddr, [ctrl.buffer] |
455 | 467 | ||
Line 502... | Line 514... | ||
502 | add edi, 4 |
514 | add edi, 4 |
503 | loop @B |
515 | loop @B |
504 | 516 | ||
Line 505... | Line 517... | ||
505 | mov ecx, pcmout_bdl |
517 | mov ecx, pcmout_bdl |
506 | stdcall [GetPgAddr], ecx |
518 | stdcall GetPgAddr, ecx |
507 | and ecx, 0xFFF |
519 | and ecx, 0xFFF |
508 | add eax, ecx |
520 | add eax, ecx |
Line 509... | Line 521... | ||
509 | 521 | ||
510 | mov edx, PCM_OUT_BDL |
522 | mov edx, PCM_OUT_BDL |
Line 535... | Line 547... | ||
535 | 547 | ||
Line 536... | Line 548... | ||
536 | xor eax, eax |
548 | xor eax, eax |
537 | mov [bus], eax |
549 | mov [bus], eax |
538 | inc eax |
550 | inc eax |
539 | call [PciApi] |
551 | call PciApi |
540 | cmp eax, -1 |
552 | cmp eax, -1 |
541 | je .err |
553 | je .err |
Line 542... | Line 554... | ||
542 | 554 | ||
Line 543... | Line 555... | ||
543 | mov [last_bus], eax |
555 | mov [last_bus], eax |
544 | 556 | ||
545 | .next_bus: |
557 | .next_bus: |
546 | and [devfn], 0 |
558 | and [devfn], 0 |
547 | .next_dev: |
559 | .next_dev: |
548 | stdcall [PciRead32], [bus], [devfn], dword 0 |
560 | stdcall PciRead32, [bus], [devfn], dword 0 |
549 | test eax, eax |
561 | test eax, eax |
550 | jz .next |
562 | jz .next |
Line 600... | Line 612... | ||
600 | 612 | ||
Line 601... | Line 613... | ||
601 | align 4 |
613 | align 4 |
602 | proc init_controller |
614 | proc init_controller |
Line 603... | Line 615... | ||
603 | 615 | ||
604 | stdcall [PciRead32], [ctrl.bus], [ctrl.devfn], dword 4 |
616 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 4 |
605 | mov ebx, eax |
617 | mov ebx, eax |
606 | and eax, 0xFFFF |
618 | and eax, 0xFFFF |
607 | mov [ctrl.pci_cmd], eax |
619 | mov [ctrl.pci_cmd], eax |
608 | shr ebx, 16 |
620 | shr ebx, 16 |
Line 609... | Line 621... | ||
609 | mov [ctrl.pci_stat], ebx |
621 | mov [ctrl.pci_stat], ebx |
610 | 622 | ||
611 | stdcall [PciRead32], [ctrl.bus], [ctrl.devfn], dword 0x10 |
623 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x10 |
Line 612... | Line 624... | ||
612 | and eax,0xFFFE |
624 | and eax,0xFFFE |
613 | mov [ctrl.codec_io_base], eax |
625 | mov [ctrl.codec_io_base], eax |
614 | 626 | ||
Line 615... | Line 627... | ||
615 | stdcall [PciRead32], [ctrl.bus], [ctrl.devfn], dword 0x14 |
627 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x14 |
616 | and eax, 0xFFC0 |
628 | and eax, 0xFFC0 |
Line 617... | Line 629... | ||
617 | mov [ctrl.ctrl_io_base], eax |
629 | mov [ctrl.ctrl_io_base], eax |
618 | 630 | ||
Line 619... | Line 631... | ||
619 | stdcall [PciRead32], [ctrl.bus], [ctrl.devfn], dword 0x18 |
631 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x18 |
620 | mov [ctrl.codec_mem_base], eax |
632 | mov [ctrl.codec_mem_base], eax |
621 | 633 | ||
Line 622... | Line 634... | ||
622 | stdcall [PciRead32], [ctrl.bus], [ctrl.devfn], dword 0x1C |
634 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x1C |
623 | mov [ctrl.ctrl_mem_base], eax |
635 | mov [ctrl.ctrl_mem_base], eax |
624 | 636 | ||
Line 625... | Line 637... | ||
625 | stdcall [PciRead32], [ctrl.bus], [ctrl.devfn], dword 0x3C |
637 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x3C |
626 | and eax, 0xFF |
638 | and eax, 0xFF |
Line 733... | Line 745... | ||
733 | jnc .ok |
745 | jnc .ok |
734 | 746 | ||
Line 735... | Line 747... | ||
735 | if DEBUG |
747 | if DEBUG |
736 | mov esi, msgCFail |
748 | mov esi, msgCFail |
737 | call [SysMsgBoardStr] |
749 | call SysMsgBoardStr |
738 | end if |
750 | end if |
739 | xor eax, eax ; timeout error |
751 | xor eax, eax ; timeout error |
740 | ret |
752 | ret |
741 | .ok: |
753 | .ok: |
742 | xor eax, eax |
754 | xor eax, eax |
Line 755... | Line 767... | ||
755 | call [ctrl.ctrl_write32] |
767 | call [ctrl.ctrl_write32] |
756 | 768 | ||
Line 757... | Line 769... | ||
757 | if DEBUG |
769 | if DEBUG |
758 | mov esi, msgWarm |
770 | mov esi, msgWarm |
759 | call [SysMsgBoardStr] |
771 | call SysMsgBoardStr |
760 | end if |
772 | end if |
Line 761... | Line 773... | ||
761 | 773 | ||
762 | mov [counter], 10 ; total 10*100 ms = 1s |
774 | mov [counter], 10 ; total 10*100 ms = 1s |
763 | .wait: |
775 | .wait: |
Line 772... | Line 784... | ||
772 | jnz .wait |
784 | jnz .wait |
773 | 785 | ||
Line 774... | Line 786... | ||
774 | if DEBUG |
786 | if DEBUG |
775 | mov esi, msgWRFail |
787 | mov esi, msgWRFail |
776 | call [SysMsgBoardStr] |
788 | call SysMsgBoardStr |
777 | end if |
789 | end if |
Line 778... | Line 790... | ||
778 | 790 | ||
779 | stc |
791 | stc |
780 | ret |
792 | ret |
Line 801... | Line 813... | ||
801 | call [ctrl.ctrl_write32] |
813 | call [ctrl.ctrl_write32] |
802 | 814 | ||
Line 803... | Line 815... | ||
803 | if DEBUG |
815 | if DEBUG |
804 | mov esi, msgCold |
816 | mov esi, msgCold |
805 | call [SysMsgBoardStr] |
817 | call SysMsgBoardStr |
806 | end if |
818 | end if |
Line 807... | Line 819... | ||
807 | 819 | ||
808 | mov eax, 1000000 ; wait 1 s |
820 | mov eax, 1000000 ; wait 1 s |
Line 825... | Line 837... | ||
825 | jnz .wait |
837 | jnz .wait |
826 | 838 | ||
Line 827... | Line 839... | ||
827 | if DEBUG |
839 | if DEBUG |
828 | mov esi, msgCRFail |
840 | mov esi, msgCRFail |
829 | call [SysMsgBoardStr] |
841 | call SysMsgBoardStr |
830 | end if |
842 | end if |
831 | stc |
843 | stc |
832 | ret |
844 | ret |
833 | .ok: |
845 | .ok: |
834 | mov edx, CTRL_STAT |
846 | mov edx, CTRL_STAT |
Line 1103... | Line 1115... | ||
1103 | endp |
1115 | endp |
1104 | 1116 | ||
Line 1105... | Line 1117... | ||
1105 | include "codec.inc" |
1117 | include "codec.inc" |
Line 1106... | Line -... | ||
1106 | - | ||
1107 | 1118 | ||
1108 | align 16 |
- | |
1109 | pcmout_bdl dq 32 dup(0) |
- | |
1110 | buff_list dd 32 dup(0) |
- | |
1111 | - | ||
1112 | align 16 |
- | |
1113 | ctrl AC_CNTRL |
- | |
1114 | - | ||
1115 | align 16 |
- | |
1116 | codec CODEC |
- | |
1117 | - | ||
1118 | civ_val dd 0 |
- | |
1119 | - | ||
1120 | align 16 |
1119 | align 4 |
1121 | devices dd (CTRL_SIS shl 16)+VID_SIS,msg_AC, set_SIS |
1120 | devices dd (CTRL_SIS shl 16)+VID_SIS,msg_AC, set_SIS |
Line 1122... | Line -... | ||
1122 | dd 0 |
- | |
1123 | - | ||
1124 | align 16 |
- | |
1125 | imp_table: |
- | |
1126 | IMPORTS: |
- | |
1127 | - | ||
1128 | AttachIntHandler dd szAttachIntHandler |
- | |
1129 | SysMsgBoardStr dd szSysMsgBoardStr |
- | |
1130 | PciApi dd szPciApi |
- | |
1131 | PciRead32 dd szPciRead32 |
- | |
1132 | PciRead8 dd szPciRead8 |
- | |
1133 | PciWrite8 dd szPciWrite8 |
- | |
1134 | AllocKernelSpace dd szAllocKernelSpace |
- | |
1135 | MapPage dd szMapPage |
- | |
1136 | KernelAlloc dd szKernelAlloc |
- | |
1137 | GetPgAddr dd szGetPgAddr |
- | |
1138 | RegService dd szRegService |
- | |
1139 | GetCurrentTask dd szGetCurrentTask |
- | |
1140 | dd 0 |
1121 | dd 0 |
1141 | 1122 | ||
Line 1142... | Line -... | ||
1142 | msg_AC db '7012 AC97 controller',13,10, 0 |
- | |
1143 | msg_SIS db 'Silicon Integrated Systems',13,10, 0 |
- | |
1144 | - | ||
1145 | szKernel db 'KERNEL', 0 |
- | |
1146 | szAttachIntHandler db 'AttachIntHandler',0 |
- | |
1147 | szSysMsgBoardStr db 'SysMsgBoardStr', 0 |
- | |
1148 | szPciApi db 'PciApi', 0 |
- | |
1149 | szPciRead32 db 'PciRead32', 0 |
- | |
1150 | szPciRead8 db 'PciRead8', 0 |
- | |
1151 | szPciWrite8 db 'PciWrite8',0 |
- | |
1152 | szAllocKernelSpace db 'AllocKernelSpace',0 |
- | |
1153 | szMapPage db 'MapPage',0 |
- | |
1154 | szRegService db 'RegService',0 |
- | |
1155 | szKernelAlloc db 'KernelAlloc',0 |
- | |
1156 | szGetPgAddr db 'GetPgAddr',0 |
1123 | msg_AC db '7012 AC97 controller',13,10, 0 |
Line 1157... | Line 1124... | ||
1157 | szGetCurrentTask db 'GetCurrentTask ',0 |
1124 | msg_SIS db 'Silicon Integrated Systems',13,10, 0 |
1158 | 1125 | ||
1159 | sz_sound_srv db 'SOUND',0 |
1126 | sz_sound_srv db 'SOUND',0 |
Line 1173... | Line 1140... | ||
1173 | msgWarm db 'warm reset',13,10,0 |
1140 | msgWarm db 'warm reset',13,10,0 |
1174 | msgWRFail db 'warm reset failed',13,10,0 |
1141 | msgWRFail db 'warm reset failed',13,10,0 |
1175 | msgCRFail db 'cold reset failed',13,10,0 |
1142 | msgCRFail db 'cold reset failed',13,10,0 |
1176 | msgCFail db 'codec not ready',13,10,0 |
1143 | msgCFail db 'codec not ready',13,10,0 |
1177 | 1144 | ||
- | 1145 | section '.data' data readable writable align 16 |
|
- | 1146 | ||
- | 1147 | pcmout_bdl rq 32 |
|
- | 1148 | buff_list rd 32 |
|
- | 1149 | ||
- | 1150 | codec CODEC |
|
- | 1151 | ctrl AC_CNTRL |
|
- | 1152 | ||
- | 1153 | lpc_bus rd 1 |
|
- | 1154 | civ_val rd 1 |
|
- | 1155 |