summaryrefslogtreecommitdiffstats
path: root/sys/i386/pci/pci_pir.c
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1995-06-28 15:54:57 +0000
committerse <se@FreeBSD.org>1995-06-28 15:54:57 +0000
commit09eec57f6a02549eec5c5b77356100d67f458782 (patch)
tree69231591e4a2aee425279d85666d17137bd96865 /sys/i386/pci/pci_pir.c
parentf3e714fb0e06ef49be7acbdf7e202c84c2d78b1d (diff)
downloadFreeBSD-src-09eec57f6a02549eec5c5b77356100d67f458782.zip
FreeBSD-src-09eec57f6a02549eec5c5b77356100d67f458782.tar.gz
PCI configuration mechanism now determined by a method, that doesn't
fail on new hardware (Compaq Prolinea and Compaq Prosignea), and that doesn't erroneously identify old mech. 2 chip sets as using mech. 1. (See section 3.6.4.1.1 of the PCI bus specs rev. 2.0)
Diffstat (limited to 'sys/i386/pci/pci_pir.c')
-rw-r--r--sys/i386/pci/pci_pir.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c
index 7fbb80f..d2a2ad9 100644
--- a/sys/i386/pci/pci_pir.c
+++ b/sys/i386/pci/pci_pir.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcibus.c,v 1.7 1995/03/22 19:51:59 se Exp $
+** $Id: pcibus.c,v 1.8 1995/03/22 21:35:39 se Exp $
**
** pci bus subroutines for i386 architecture.
**
@@ -139,6 +139,7 @@ DATA_SET (pcibus_set, i386pci);
#define CONF1_ENABLE 0x80000000ul
+#define CONF1_ENABLE_CHK 0xF0000000ul
#define CONF1_ADDR_PORT 0x0cf8
#define CONF1_DATA_PORT 0x0cfc
@@ -153,25 +154,13 @@ pcibus_setup (void)
u_long result, oldval;
/*---------------------------------------
- ** Configuration mode 2 ?
- **---------------------------------------
- */
-
- outb (CONF2_ENABLE_PORT, 0);
- outb (CONF2_FORWARD_PORT, 0);
- if (!inb (CONF2_ENABLE_PORT) && !inb (CONF2_FORWARD_PORT)) {
- pci_mechanism = 2;
- pci_maxdevice = 16;
- return;
- };
-
- /*---------------------------------------
** Configuration mode 1 ?
**---------------------------------------
*/
oldval = inl (CONF1_ADDR_PORT);
- outl (CONF1_ADDR_PORT, CONF1_ENABLE);
+ outl (CONF1_ADDR_PORT, CONF1_ENABLE_CHK);
+ outb (CONF1_ADDR_PORT +3, 0);
result = inl (CONF1_ADDR_PORT);
outl (CONF1_ADDR_PORT, oldval);
@@ -182,6 +171,19 @@ pcibus_setup (void)
};
/*---------------------------------------
+ ** Configuration mode 2 ?
+ **---------------------------------------
+ */
+
+ outb (CONF2_ENABLE_PORT, 0);
+ outb (CONF2_FORWARD_PORT, 0);
+ if (!inb (CONF2_ENABLE_PORT) && !inb (CONF2_FORWARD_PORT)) {
+ pci_mechanism = 2;
+ pci_maxdevice = 16;
+ return;
+ };
+
+ /*---------------------------------------
** No PCI bus available.
**---------------------------------------
*/
OpenPOWER on IntegriCloud