summaryrefslogtreecommitdiff
path: root/arch/x86/lib/bios_pci.S
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-12-02 00:17:49 +0100
committerWolfgang Denk <wd@denx.de>2011-12-02 00:17:49 +0100
commit7708d8b352e9e595f6f08afd3206af6495c7dc09 (patch)
treefb9811040b2b1f55c44fc7274473f2ef0847c19b /arch/x86/lib/bios_pci.S
parentd887ad54ca74063338bc3108beed0aa4f15d1f6b (diff)
parentf008b17f8c2995996b5d100b71f8851d6f74a136 (diff)
downloadolio-uboot-2014.01-7708d8b352e9e595f6f08afd3206af6495c7dc09.tar.xz
olio-uboot-2014.01-7708d8b352e9e595f6f08afd3206af6495c7dc09.zip
Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/master
* 'master' of ssh://gemini/home/wd/git/u-boot/master: board/emk/top860/top860.c: Fix GCC 4.6 build warning board/sbc405/strataflash.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc86xx/cpu.c: Fix GCC 4.6 build warning board/freescale/mpc8610hpcd/mpc8610hpcd.c: Fix GCC 4.6 build warning board/mpl/common/flash.c: Fix GCC 4.6 build warning post/board/lwmon5/gdc.c: Fix GCC 4.6 build warning drivers/usb/host/sl811-hcd.c: Fix GCC 4.6 build warning board/sandburst/common/flash.c: Fix GCC 4.6 build warning DB64460: Fix GCC 4.6 build warnings DB64360: Fix GCC 4.6 build warnings board/cray/L1/flash.c: Fix GCC 4.6 build warning drivers/block/sata_dwc.c: Fix GCC 4.6 build warning board/amirix/ap1000/flash.c: Fix GCC 4.6 build warning alpr board: Fix GCC 4.6 build warnings image: Don't detect XIP images as overlapping. image: Implement IH_TYPE_KERNEL_NOLOAD ppc4xx: Add Io64 board support ppc4xx: fix PMC440 painit command ppc4xx: remove invalid access to PCI_BRDGOPT2 register ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation mpc85xx: support for Freescale COM Express P2020 arch/powerpc/cpu/mpc8xxx/ddr/interactive.c: Fix GCC 4.6 build warning mpc85xx: support board-specific reset function powerpc/85xx: verify the localbus device tree address before booting the OS mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification powerpc/p3060qds: Add board related support for P3060QDS platform powerpc/85xx: clean up and document the QE/FMAN microcode macros powerpc/85xx: always implement the work-around for Erratum SATA_A001 powerpc/85xx: CONFIG_FSL_SATA_V2 should be defined in config_mpc85xx.h powerpc/85xx: Add workaround for erratum A-003474 powerpc/85xx: fixup flexcan device tree clock-frequency powerpc/85xx: Add workaround for erratum CPU-A003999 x86: Fix some bugs in the i8402 driver when no controller is present x86: Make the i8042 driver checkpatch clean x86: Wrap small helper functions from libgcc to avoid an ABI mismatch x86: Import the glibc memset implementation x86: Fix a few recently added bugs x86: Don't relocate symbols which point to things that aren't relocated x86: Fix how the location of the realmode and bios blobs are calculated x86: Misc cleanups x86: Misc PCI touchups x86: Ensure IDT and GDT remain 16-byte aligned post relocation x86: Provide more configuration granularity x86: Add multiboot header sc520: Create arch asm-offsets x86: Punt cold- and warm-boot flags cosmetic: checkpatch cleanup of board/eNET/*.c cosmetic: checkpatch cleanup of arch/x86/lib/*.c cosmetic: checkpatch cleanup of arch/x86/cpu/sc520/*.c cosmetic: checkpatch cleanup of arch/x86/cpu/*.c x86: Call hang() on unrecoverable exception menu.c: use puts() instead of printf() where possible MAKEALL: drop obsolete mx31pdk_nand target dataflash: fix parameters order in write_dataflash() hawkboard: Replace HAWKBOARD_KICK{0, 1}_UNLOCK defines davinci_sonata: define CONFIG_MACH_TYPE for davinci_sonata board davinci_schmoogie: define CONFIG_MACH_TYPE for davinci_schmoogie board arm: a320evb: define mach-type in board config file OMAP3: Use sdelay from arch/arm/cpu/armv7/syslib.c instead of cloning that. Fix Stelian's email address DIU: 1080P and 720P support CFB: Fix font rendering on mx5 framebuffer
Diffstat (limited to 'arch/x86/lib/bios_pci.S')
-rw-r--r--arch/x86/lib/bios_pci.S92
1 files changed, 63 insertions, 29 deletions
diff --git a/arch/x86/lib/bios_pci.S b/arch/x86/lib/bios_pci.S
index 53d2ea047..47c478b27 100644
--- a/arch/x86/lib/bios_pci.S
+++ b/arch/x86/lib/bios_pci.S
@@ -80,11 +80,15 @@ cs incl num_pci_bios_present
#endif
movl $0x20494350, %eax
gs movl %eax, OFFS_EDX(%bp)
+
+ /* We support cfg type 1 version 2.10 */
movb $0x01, %al
-gs movb %al, OFFS_AL(%bp) /* We support cfg type 1 */
- movw $0x0210, %ax /* version 2.10 */
+gs movb %al, OFFS_AL(%bp)
+ movw $0x0210, %ax
gs movw %ax, OFFS_BX(%bp)
-cs movb pci_last_bus, %al /* last bus number */
+
+ /* last bus number */
+cs movb pci_last_bus, %al
gs movb %al, OFFS_CL(%bp)
jmp clear_carry
@@ -97,16 +101,22 @@ cs incl num_pci_bios_find_device
#endif
gs movw OFFS_CX(%bp), %di
shll $16, %edi
-gs movw OFFS_DX(%bp), %di /* edi now holds device in upper 16
- * bits and vendor in lower 16 bits */
+gs movw OFFS_DX(%bp), %di
+ /* edi now holds device in upper 16 bits and vendor in lower 16 bits */
+
gs movw OFFS_SI(%bp), %si
- xorw %bx, %bx /* start at bus 0 dev 0 function 0 */
+
+ /* start at bus 0 dev 0 function 0 */
+ xorw %bx, %bx
pfd_loop:
- xorw %ax, %ax /* dword 0 is vendor/device */
+ /* dword 0 is vendor/device */
+ xorw %ax, %ax
call __pci_bios_select_register
movw $0xcfc, %dx
inl %dx, %eax
- cmpl %edi, %eax /* our device ? */
+
+ /* our device ? */
+ cmpl %edi, %eax
je pfd_found_one
pfd_next_dev:
/* check for multi function devices */
@@ -120,13 +130,16 @@ pfd_next_dev:
andb $0x80, %al
jz pfd_not_multi_function
pfd_function_not_zero:
- incw %bx /* next function, overflows in to
- * device number, then bus number */
+ /* next function, overflows in to device number, then bus number */
+ incw %bx
jmp pfd_check_bus
pfd_not_multi_function:
- andw $0xfff8, %bx /* remove function bits */
- addw $0x0008, %bx /* next device, overflows in to bus number */
+ /* remove function bits */
+ andw $0xfff8, %bx
+
+ /* next device, overflows in to bus number */
+ addw $0x0008, %bx
pfd_check_bus:
cs movb pci_last_bus, %ah
cmpb %ah, %bh
@@ -142,7 +155,8 @@ gs movw %bx, OFFS_BX(%bp)
jmp clear_carry
pfd_not_found:
- movb $0x86, %ah /* device not found */
+ /* device not found */
+ movb $0x86, %ah
jmp set_carry
/*****************************************************************************/
@@ -152,17 +166,24 @@ pci_bios_find_class:
cs incl num_pci_bios_find_class
#endif
gs movl OFFS_ECX(%bp), %edi
- andl $0x00ffffff, %edi /* edi now holds class-code in lower 24 bits */
+
+ /* edi now holds class-code in lower 24 bits */
+ andl $0x00ffffff, %edi
gs movw OFFS_SI(%bp), %si
- xorw %bx, %bx /* start at bus 0 dev 0 function 0 */
+
+ /* start at bus 0 dev 0 function 0 */
+ xorw %bx, %bx
pfc_loop:
- movw $8, %ax /* dword 8 is class-code high 24bits */
+ /* dword 8 is class-code high 24bits */
+ movw $8, %ax
call __pci_bios_select_register
movw $0xcfc, %dx
inl %dx, %eax
shrl $8, %eax
andl $0x00ffffff, %eax
- cmpl %edi, %eax /* our device ? */
+
+ /* our device ? */
+ cmpl %edi, %eax
je pfc_found_one
pfc_next_dev:
/* check for multi function devices */
@@ -175,13 +196,16 @@ pfc_next_dev:
andb $0x80, %al
jz pfc_not_multi_function
pfc_function_not_zero:
- incw %bx /* next function, overflows in to
- * device number, then bus number */
+ /* next function, overflows in to device number, then bus number */
+ incw %bx
jmp pfc_check_bus
pfc_not_multi_function:
- andw $0xfff8, %bx /* remove function bits */
- addw $0x0008, %bx /* next device, overflows in to bus number */
+ /* remove function bits */
+ andw $0xfff8, %bx
+
+ /* next device, overflows in to bus number */
+ addw $0x0008, %bx
pfc_check_bus:
cs movb pci_last_bus, %ah
cmpb %ah, %bh
@@ -197,7 +221,8 @@ gs movw %bx, OFFS_BX(%bp)
jmp clear_carry
pfc_not_found:
- movb $0x86, %ah /* device not found */
+ /* device not found */
+ movb $0x86, %ah
jmp set_carry
/*****************************************************************************/
@@ -206,7 +231,8 @@ pci_bios_generate_special_cycle:
#ifdef PCI_BIOS_DEBUG
cs incl num_pci_bios_generate_special_cycle
#endif
- movb $0x81, %ah /* function not supported */
+ /* function not supported */
+ movb $0x81, %ah
jmp set_carry
/*****************************************************************************/
@@ -296,7 +322,8 @@ pci_bios_get_irq_routing:
#ifdef PCI_BIOS_DEBUG
cs incl num_pci_bios_get_irq_routing
#endif
- movb $0x81, %ah /* function not supported */
+ /* function not supported */
+ movb $0x81, %ah
jmp set_carry
/*****************************************************************************/
@@ -305,7 +332,8 @@ pci_bios_set_irq:
#ifdef PCI_BIOS_DEBUG
cs incl num_pci_bios_set_irq
#endif
- movb $0x81, %ah /* function not supported */
+ /* function not supported */
+ movb $0x81, %ah
jmp set_carry
/*****************************************************************************/
@@ -314,7 +342,8 @@ unknown_function:
#ifdef PCI_BIOS_DEBUG
cs incl num_pci_bios_unknown_function
#endif
- movb $0x81, %ah /* function not supported */
+ /* function not supported */
+ movb $0x81, %ah
jmp set_carry
/*****************************************************************************/
@@ -323,7 +352,8 @@ pci_bios_select_register:
gs movw OFFS_BX(%bp), %bx
gs movw OFFS_DI(%bp), %ax
/* destroys eax, dx */
-__pci_bios_select_register: /* BX holds device id, AX holds register index */
+__pci_bios_select_register:
+ /* BX holds device id, AX holds register index */
pushl %ebx
andl $0xfc, %eax
andl $0xffff, %ebx
@@ -338,7 +368,9 @@ __pci_bios_select_register: /* BX holds device id, AX holds regist
clear_carry:
gs movw OFFS_FLAGS(%bp), %ax
- andw $0xfffe, %ax /* clear carry -- function succeeded */
+
+ /* clear carry -- function succeeded */
+ andw $0xfffe, %ax
gs movw %ax, OFFS_FLAGS(%bp)
xorw %ax, %ax
gs movb %ah, OFFS_AH(%bp)
@@ -347,7 +379,9 @@ gs movb %ah, OFFS_AH(%bp)
set_carry:
gs movb %ah, OFFS_AH(%bp)
gs movw OFFS_FLAGS(%bp), %ax
- orw $1, %ax /* return carry -- function not supported */
+
+ /* return carry -- function not supported */
+ orw $1, %ax
gs movw %ax, OFFS_FLAGS(%bp)
movw $-1, %ax
ret