aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-12-06 08:28:17 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-12-06 08:28:17 +0000
commit8f915a7e4e0ae077c7e36c26208ffa8b4ae86ee8 (patch)
treec9e86bbe364b2c535ec3d6f3b3ff4efb92dda758
parentd8112c1194b6a988e1019be1557c33316ec461b7 (diff)
Notes
-rw-r--r--sys/i386/isa/pci_cfgreg.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/sys/i386/isa/pci_cfgreg.c b/sys/i386/isa/pci_cfgreg.c
index a0a4f3762d10..458d1283c437 100644
--- a/sys/i386/isa/pci_cfgreg.c
+++ b/sys/i386/isa/pci_cfgreg.c
@@ -572,6 +572,7 @@ pcireg_cfgopen(void)
unsigned long mode1res,oldval1;
unsigned char mode2res,oldval2;
+ /* Check for type #1 first. */
oldval1 = inl(CONF1_ADDR_PORT);
if (bootverbose) {
@@ -579,39 +580,37 @@ pcireg_cfgopen(void)
oldval1);
}
- if ((oldval1 & CONF1_ENABLE_MSK) == 0) {
+ cfgmech = 1;
+ devmax = 32;
- cfgmech = 1;
- devmax = 32;
+ outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK);
+ DELAY(1);
+ mode1res = inl(CONF1_ADDR_PORT);
+ outl(CONF1_ADDR_PORT, oldval1);
- outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK);
- DELAY(1);
- mode1res = inl(CONF1_ADDR_PORT);
- outl(CONF1_ADDR_PORT, oldval1);
+ if (bootverbose)
+ printf("pci_open(1a):\tmode1res=0x%08lx (0x%08lx)\n",
+ mode1res, CONF1_ENABLE_CHK);
- if (bootverbose)
- printf("pci_open(1a):\tmode1res=0x%08lx (0x%08lx)\n",
- mode1res, CONF1_ENABLE_CHK);
-
- if (mode1res) {
- if (pci_cfgcheck(32))
- return (cfgmech);
- }
+ if (mode1res) {
+ if (pci_cfgcheck(32))
+ return (cfgmech);
+ }
- outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK1);
- mode1res = inl(CONF1_ADDR_PORT);
- outl(CONF1_ADDR_PORT, oldval1);
+ outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK1);
+ mode1res = inl(CONF1_ADDR_PORT);
+ outl(CONF1_ADDR_PORT, oldval1);
- if (bootverbose)
- printf("pci_open(1b):\tmode1res=0x%08lx (0x%08lx)\n",
- mode1res, CONF1_ENABLE_CHK1);
+ if (bootverbose)
+ printf("pci_open(1b):\tmode1res=0x%08lx (0x%08lx)\n",
+ mode1res, CONF1_ENABLE_CHK1);
- if ((mode1res & CONF1_ENABLE_MSK1) == CONF1_ENABLE_RES1) {
- if (pci_cfgcheck(32))
- return (cfgmech);
- }
+ if ((mode1res & CONF1_ENABLE_MSK1) == CONF1_ENABLE_RES1) {
+ if (pci_cfgcheck(32))
+ return (cfgmech);
}
+ /* Type #1 didn't work, so try type #2. */
oldval2 = inb(CONF2_ENABLE_PORT);
if (bootverbose) {
@@ -641,6 +640,7 @@ pcireg_cfgopen(void)
}
}
+ /* Nothing worked, so punt. */
cfgmech = 0;
devmax = 0;
return (cfgmech);