diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 1998-02-24 22:02:12 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 1998-02-24 22:02:12 +0000 |
commit | 56d872e11254cc8a8ca03e06d9b6ae78fb8a078a (patch) | |
tree | 62ecd9bb0df576d25332aa156fe27087dac7f799 /sys/arch/i386/pci | |
parent | b3cbc0b9e486970f437889ce506f6275f8ebcb1e (diff) |
First commit of /boot changes/fixes. More to come.
Add BIOS PCI probe stuff.
Diffstat (limited to 'sys/arch/i386/pci')
-rw-r--r-- | sys/arch/i386/pci/pci_machdep.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index 9146ad91640..5b16806b839 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.11 1998/01/20 18:40:23 niklas Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.12 1998/02/24 22:02:11 weingart Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -92,9 +92,14 @@ #define _I386_BUS_DMA_PRIVATE #include <machine/bus.h> - #include <machine/pio.h> +#include "bios.h" +#if NBIOS > 0 +#include <machine/biosvar.h> +extern bios_pciinfo_t *bios_pciinfo; +#endif + #include <i386/isa/icu.h> #include <dev/isa/isavar.h> #include <dev/pci/pcivar.h> @@ -136,8 +141,14 @@ pci_attach_hook(parent, self, pba) struct pcibus_attach_args *pba; { +#if NBIOS > 0 + if (pba->pba_bus == 0) + printf(": configuration mode %d (%s)", + pci_mode, (bios_pciinfo?"bios":"no bios")); +#else if (pba->pba_bus == 0) printf(": configuration mode %d", pci_mode); +#endif } int @@ -340,15 +351,32 @@ pci_mode_detect() if (pci_mode != -1) return pci_mode; +#if NBIOS > 0 + /* + * If we have PCI info passed from the BIOS, use the mode given there + * for all of this code. If not, pass on through to the previous tests + * to try and devine the correct mode. + */ + if (bios_pciinfo != NULL) { + if (bios_pciinfo->pci_chars & 0x2) + return (pci_mode = 2); + + if (bios_pciinfo->pci_chars & 0x1) + return (pci_mode = 1); + + /* We should never get here, but if we do, fall through... */ + } +#endif + /* * We try to divine which configuration mode the host bridge wants. We * try mode 2 first, because our probe for mode 1 is likely to succeed * for mode 2 also. * - * XXX - * This should really be done using the PCI BIOS. + * This should really be done using the PCI BIOS. If we get here, the + * PCI BIOS does not exist, or the boot blocks did not provide the + * information. */ - outb(PCI_MODE2_ENABLE_REG, 0); outb(PCI_MODE2_FORWARD_REG, 0); if (inb(PCI_MODE2_ENABLE_REG) != 0 || |