Rev 1348 | Rev 1354 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1348 | Rev 1353 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | ;; ;; |
19 | ;; ;; |
20 | ;; See file COPYING for details ;; |
20 | ;; See file COPYING for details ;; |
21 | ;; ;; |
21 | ;; ;; |
22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 23... | Line 23... | ||
23 | 23 | ||
Line 24... | Line 24... | ||
24 | $Revision: 1348 $ |
24 | $Revision: 1353 $ |
25 | 25 | ||
26 | ;*************************************************************************** |
26 | ;*************************************************************************** |
27 | ; Function |
27 | ; Function |
Line 429... | Line 429... | ||
429 | 429 | ||
430 | align 4 |
430 | align 4 |
431 | pci_mmio_map: |
431 | pci_mmio_map: |
432 | and edx,0x0ffff |
432 | and edx,0x0ffff |
433 | cmp ah,6 |
433 | cmp ah,6 |
- | 434 | jc .bar_0_5 |
|
434 | jc @f |
435 | jz .bar_rom |
435 | mov eax,-2 |
436 | mov eax,-2 |
- | 437 | ret |
|
- | 438 | .bar_rom: |
|
436 | ret |
439 | mov ah, 8 ; bar6 = Expansion ROM base address |
437 | @@: |
440 | .bar_0_5: |
438 | push ecx |
441 | push ecx |
439 | add ebx, 4095 |
442 | add ebx, 4095 |
440 | and ebx,-4096 |
443 | and ebx,-4096 |
441 | push ebx |
444 | push ebx |
442 | mov bl, ah ; bl = BAR# (0..5) |
445 | mov bl, ah ; bl = BAR# (0..5), however bl=8 for BAR6 |
443 | shl bl, 1 |
446 | shl bl, 1 |
444 | shl bl, 1 |
447 | shl bl, 1 |
445 | add bl, 0x10 ; bl = BARs offset in PCI config. space |
448 | add bl, 0x10 ; now bl = BAR offset in PCI config. space |
446 | mov ax,word [mmio_pci_addr] |
449 | mov ax,word [mmio_pci_addr] |
447 | mov bh, al ; bh = dddddfff |
450 | mov bh, al ; bh = dddddfff |
448 | mov al, 2 ; al : DW to read |
451 | mov al, 2 ; al : DW to read |
449 | call pci_read_reg |
452 | call pci_read_reg |