- pci irq initialisation added (TODO: initialize pci memory + i/o space)
This commit is contained in:
parent
3f096fdb9f
commit
0fd0fc7384
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: rombios.c,v 1.117 2004-09-13 17:53:09 vruppert Exp $
|
||||
// $Id: rombios.c,v 1.118 2004-09-25 17:21:09 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -916,10 +916,10 @@ Bit16u cdrom_boot();
|
||||
|
||||
#endif // BX_ELTORITO_BOOT
|
||||
|
||||
static char bios_cvs_version_string[] = "$Revision: 1.117 $";
|
||||
static char bios_date_string[] = "$Date: 2004-09-13 17:53:09 $";
|
||||
static char bios_cvs_version_string[] = "$Revision: 1.118 $";
|
||||
static char bios_date_string[] = "$Date: 2004-09-25 17:21:09 $";
|
||||
|
||||
static char CVSID[] = "$Id: rombios.c,v 1.117 2004-09-13 17:53:09 vruppert Exp $";
|
||||
static char CVSID[] = "$Id: rombios.c,v 1.118 2004-09-25 17:21:09 vruppert Exp $";
|
||||
|
||||
/* Offset to skip the CVS $Id: prefix */
|
||||
#define bios_version_string (CVSID + 4)
|
||||
@ -8783,7 +8783,7 @@ pci_real_select_reg:
|
||||
and di, #0xff
|
||||
or ax, di
|
||||
and al, #0xfc
|
||||
mov dx, #0x0cf8
|
||||
mov dx, #0x0cf8
|
||||
out dx, eax
|
||||
pop dx
|
||||
ret
|
||||
@ -8879,9 +8879,126 @@ pci_routing_table_structure:
|
||||
dw 0xdef8 ;; IRQ bitmap INTD#
|
||||
db 5 ;; physical slot (0 = embedded)
|
||||
db 0 ;; reserved
|
||||
|
||||
pci_irq_list:
|
||||
db 11, 10, 9, 5;
|
||||
|
||||
pcibios_init_sel_reg:
|
||||
push eax
|
||||
mov eax, #0x800000
|
||||
mov ax, bx
|
||||
shl eax, #8
|
||||
and dl, #0xfc
|
||||
or al, dl
|
||||
mov dx, #0x0cf8
|
||||
out dx, eax
|
||||
pop eax
|
||||
ret
|
||||
|
||||
pcibios_init:
|
||||
push ds
|
||||
push bp
|
||||
mov ax, #0xf000
|
||||
mov ds, ax
|
||||
mov dx, #0x04d0 ;; reset ELCR1 + ELCR2
|
||||
mov al, #0x00
|
||||
out dx, al
|
||||
inc dx
|
||||
out dx, al
|
||||
mov si, #pci_routing_table_structure
|
||||
mov bh, [si+8]
|
||||
mov bl, [si+9]
|
||||
mov dl, #0x00
|
||||
call pcibios_init_sel_reg
|
||||
mov dx, #0x0cfc
|
||||
in eax, dx
|
||||
cmp eax, [si+12] ;; check irq router
|
||||
jne pci_init_end
|
||||
mov dl, [si+34]
|
||||
call pcibios_init_sel_reg
|
||||
push bx ;; save irq router bus + devfunc
|
||||
mov dx, #0x0cfc
|
||||
mov ax, #0x8080
|
||||
out dx, ax ;; reset PIRQ route control
|
||||
inc dx
|
||||
inc dx
|
||||
out dx, ax
|
||||
mov ax, [si+6]
|
||||
sub ax, #0x20
|
||||
shr ax, #4
|
||||
mov cx, ax
|
||||
add si, #0x20 ;; set pointer to 1st entry
|
||||
mov bp, sp
|
||||
mov ax, #pci_irq_list
|
||||
push ax
|
||||
xor ax, ax
|
||||
push ax
|
||||
pci_init_loop1:
|
||||
mov bh, [si]
|
||||
mov bl, [si+1]
|
||||
pci_init_loop2:
|
||||
mov dl, #0x00
|
||||
call pcibios_init_sel_reg
|
||||
mov dx, #0x0cfc
|
||||
in ax, dx
|
||||
cmp ax, #0xffff
|
||||
jnz pci_test_int_pin
|
||||
test bl, #0x07
|
||||
jz next_pir_entry
|
||||
jmp next_pci_func
|
||||
pci_test_int_pin:
|
||||
mov dl, #0x3c
|
||||
call pcibios_init_sel_reg
|
||||
mov dx, #0x0cfd
|
||||
in al, dx
|
||||
and al, #0x07
|
||||
jz next_pci_func
|
||||
dec al ;; determine pirq reg
|
||||
mov dl, #0x03
|
||||
mul al, dl
|
||||
add al, #0x02
|
||||
xor ah, ah
|
||||
mov bx, ax
|
||||
mov al, [si+bx]
|
||||
mov dl, al
|
||||
mov bx, [bp]
|
||||
call pcibios_init_sel_reg
|
||||
mov dx, #0x0cfc
|
||||
and al, #0x03
|
||||
add dl, al
|
||||
in al, dx
|
||||
cmp al, #0x80
|
||||
jb pirq_found
|
||||
mov bx, [bp-2] ;; pci irq list pointer
|
||||
mov al, [bx]
|
||||
out dx, al
|
||||
inc bx
|
||||
mov [bp-2], bx
|
||||
pirq_found:
|
||||
mov bh, [si]
|
||||
mov bl, [si+1]
|
||||
add bl, [bp-3] ;; pci function number
|
||||
mov dl, #0x3c
|
||||
call pcibios_init_sel_reg
|
||||
mov dx, #0x0cfc
|
||||
out dx, al
|
||||
next_pci_func:
|
||||
inc byte ptr[bp-3]
|
||||
inc bl
|
||||
test bl, #0x07
|
||||
jnz pci_init_loop2
|
||||
next_pir_entry:
|
||||
add si, #0x10
|
||||
mov byte ptr[bp-3], #0x00
|
||||
loop pci_init_loop1
|
||||
mov sp, bp
|
||||
pop bx
|
||||
pci_init_end:
|
||||
pop bp
|
||||
pop ds
|
||||
ret
|
||||
#endif // BX_PCIBIOS
|
||||
|
||||
use16 386
|
||||
detect_parport:
|
||||
push dx
|
||||
add dx, #2
|
||||
@ -9277,6 +9394,8 @@ post_default_ints:
|
||||
#endif
|
||||
out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14
|
||||
|
||||
call pcibios_init
|
||||
|
||||
call rom_scan
|
||||
|
||||
call _print_bios_banner
|
||||
|
Loading…
x
Reference in New Issue
Block a user