sound.asm: fixed memory mapped BAR

git-svn-id: svn://kolibrios.org@563 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-07-03 08:14:15 +00:00
parent e83f71a425
commit d0a2212fb9
2 changed files with 80 additions and 34 deletions

View File

@ -60,13 +60,15 @@ proc detect_chip stdcall, chip_tab:dword
mov edi, [chip_tab]
@@:
mov ebx, [edi]
test ebx, ebx
jz .unknown
cmp ebx, 0xFF
je .unknown
cmp eax,ebx
jne .next
mov eax, [edi+4]
mov [codec.chip_ids], eax
mov esi, eax
call SysMsgBoardStr
ret
.next:
add edi, 8
@ -165,16 +167,20 @@ ac_unknown db 'unknown manufacturer',13,10,0
ac_Realtek db 'Realtek Semiconductor',13,10,0
ac_Analog db 'Analog Devices',13,10,0
ac_CMedia db 'C-Media Electronics',13,10,0
ac_Cirrus db 'Cirrus Logic',13,10,0
chip_unknown db 'unknown codec id ', 0
CHIP_ANALOG equ 0x41445300
CHIP_REALTEK equ 0x414C4700
CHIP_CMEDIA equ 0x434D4900
CHIP_CIRRUS equ 0x43525900
align 16
codecs dd CHIP_ANALOG, ac_Analog, chips_Analog
dd CHIP_CMEDIA, ac_CMedia, chips_CMedia
dd CHIP_REALTEK,ac_Realtek, chips_Realtek
dd CHIP_CIRRUS, ac_Cirrus, chips_Cirrus
dd 0
align 16
@ -187,7 +193,7 @@ chips_Analog dd 0x03, chip_AD1819
dd 0x63, chip_AD1886A
dd 0x70, chip_AD1980
dd 0x75, chip_AD1985
dd 0
dd 0xFF
chips_Realtek:
dd 0x20, chip_ALC650
@ -198,7 +204,7 @@ chips_Realtek:
dd 0x80, chip_ALC658
dd 0x81, chip_ALC658D
dd 0x90, chip_ALC850
dd 0
dd 0xFF
chips_CMedia dd 0x41, chip_CM9738
dd 0x61, chip_CM9739
@ -206,7 +212,20 @@ chips_CMedia dd 0x41, chip_CM9738
dd 0x78, chip_CM9761
dd 0x82, chip_CM9761
dd 0x83, chip_CM9761
dd 0
dd 0xFF
chips_Cirrus dd 0x00, chip_CS4297
dd 0x10, chip_CS4297A
dd 0x20, chip_CS4298
dd 0x28, chip_CS4294
dd 0x30, chip_CS4299
dd 0x34, chip_CS4299D
dd 0x48, chip_CS4201
dd 0x58, chip_CS4205
dd 0x60, chip_CS4291
dd 0x70, chip_CS4202
dd 0xFF
align 16
;Analog Devices
@ -237,3 +256,16 @@ chip_CM9739 db 'CMI9739', 0dh,0ah,0
chip_CM9780 db 'CMI9780', 0dh,0ah,0
chip_CM9761 db 'CMI9761', 0dh,0ah,0
;Cirrus
chip_CS4297 db 'CS4297',13,10,0
chip_CS4297A db 'CS4297A',13,10,0
chip_CS4298 db 'CS4298',13,10,0
chip_CS4294 db 'CS4294',13,10,0
chip_CS4299 db 'CS4299',13,10,0
chip_CS4299D db 'CS4299D',13,10,0
chip_CS4201 db 'CS4201',13,10,0
chip_CS4205 db 'CS4205',13,10,0
chip_CS4291 db 'CS4291',13,10,0
chip_CS4202 db 'CS4202',13,10,0

View File

@ -331,25 +331,24 @@ proc START stdcall, state:dword
call create_primary_buff
; if REMAP_IRQ
if REMAP_IRQ
; call get_LPC_bus
; cmp eax, -1
; jz .fail
; mov [lpc_bus], 0 ;eax
; call remap_irq
; end if
; call get_LPC_bus ;ïðîâåðêà íà èíòåëëîâñêèé ÷èïñåò
; cmp eax, -1 ;ìîæíî ïðîïóñòèòü
; jz .fail
mov [lpc_bus], 0 ;eax
call remap_irq
end if
mov eax, VALID_IRQ
mov ebx, [ctrl.int_line]
mov esi, msgInvIRQ
bt eax, ebx
jnc .fail
jnc .fail_msg
mov eax, ATTCH_IRQ
mov esi, msgAttchIRQ
bt eax, ebx
jnc .fail
jnc .fail_msg
stdcall AttachIntHandler, ebx, ac97_irq
.reg:
@ -362,6 +361,10 @@ proc START stdcall, state:dword
end if
xor eax, eax
ret
.fail_msg:
call SysMsgBoardStr
xor eax, eax
ret
.stop:
call stop
xor eax, eax
@ -692,7 +695,7 @@ proc get_LPC_bus ;for Intel chipsets ONLY !!!
xor eax, eax
mov [bus], eax
inc eax
call [PciApi]
call PciApi
cmp eax, -1
je .err
@ -818,11 +821,22 @@ align 4
proc set_ICH4
stdcall AllocKernelSpace, dword 0x2000
mov edi, eax
stdcall MapPage, edi,[ctrl.codec_mem_base],PG_SW+PG_NOCACHE
mov [ctrl.codec_mem_base], edi
mov ebx, [ctrl.codec_mem_base]
and ebx, -4096
stdcall MapPage, edi,ebx,PG_SW+PG_NOCACHE
mov ebx, [ctrl.codec_mem_base]
and ebx, 4095
add ebx, edi
mov [ctrl.codec_mem_base], ebx
add edi, 0x1000
stdcall MapPage, edi, [ctrl.ctrl_mem_base],PG_SW+PG_NOCACHE
mov [ctrl.ctrl_mem_base], edi
mov ebx, [ctrl.ctrl_mem_base]
and ebx, -4096
stdcall MapPage, edi, ebx,PG_SW+PG_NOCACHE
mov ebx, [ctrl.ctrl_mem_base]
and ebx, 4095
add ebx, edi
mov [ctrl.ctrl_mem_base], ebx
mov [ctrl.codec_read16], codec_mem_r16 ;virtual
mov [ctrl.codec_write16], codec_mem_w16 ;virtual