aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>1995-06-28 15:54:57 +0000
committerStefan Eßer <se@FreeBSD.org>1995-06-28 15:54:57 +0000
commit0847c06d2e1f3164e4e074d834806d544b0ad184 (patch)
tree69231591e4a2aee425279d85666d17137bd96865 /sys
parent06cf932bcb53837c5cd62f3f0f6687e6616ddb5c (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/pci/pci_bus.c32
-rw-r--r--sys/amd64/pci/pci_cfgreg.c32
-rw-r--r--sys/i386/isa/pcibus.c32
-rw-r--r--sys/i386/pci/pci_bus.c32
-rw-r--r--sys/i386/pci/pci_cfgreg.c32
-rw-r--r--sys/i386/pci/pci_pir.c32
6 files changed, 102 insertions, 90 deletions
diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c
index 7fbb80f12cd1d..d2a2ad92797ed 100644
--- a/sys/amd64/pci/pci_bus.c
+++ b/sys/amd64/pci/pci_bus.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.
**---------------------------------------
*/
diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c
index 7fbb80f12cd1d..d2a2ad92797ed 100644
--- a/sys/amd64/pci/pci_cfgreg.c
+++ b/sys/amd64/pci/pci_cfgreg.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.
**---------------------------------------
*/
diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c
index 7fbb80f12cd1d..d2a2ad92797ed 100644
--- a/sys/i386/isa/pcibus.c
+++ b/sys/i386/isa/pcibus.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.
**---------------------------------------
*/
diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c
index 7fbb80f12cd1d..d2a2ad92797ed 100644
--- a/sys/i386/pci/pci_bus.c
+++ b/sys/i386/pci/pci_bus.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.
**---------------------------------------
*/
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index 7fbb80f12cd1d..d2a2ad92797ed 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.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.
**---------------------------------------
*/
diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c
index 7fbb80f12cd1d..d2a2ad92797ed 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.
**---------------------------------------
*/