diff options
author | gibbs <gibbs@FreeBSD.org> | 1997-01-22 18:07:15 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1997-01-22 18:07:15 +0000 |
commit | e6557b5a6ecd86e6f23f1e5ab3bb562dd5a0f205 (patch) | |
tree | 59988d55e1a247d776702e22c1d32f25852eb05d /sys/pci/aic7870.c | |
parent | f11f4d48e778cef044a5ef7c0eddfee8491dcee6 (diff) | |
download | FreeBSD-src-e6557b5a6ecd86e6f23f1e5ab3bb562dd5a0f205.zip FreeBSD-src-e6557b5a6ecd86e6f23f1e5ab3bb562dd5a0f205.tar.gz |
Be smarter about enabling memory mapped I/O. The AHC_ALLOW_MEMIO option
should not be required anymore.
Turn on ULTRA for cards that don't have a BIOS or SEEPROM.
Diffstat (limited to 'sys/pci/aic7870.c')
-rw-r--r-- | sys/pci/aic7870.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/pci/aic7870.c b/sys/pci/aic7870.c index 9e00523..15e2573 100644 --- a/sys/pci/aic7870.c +++ b/sys/pci/aic7870.c @@ -321,6 +321,7 @@ ahc_pci_attach(parent, self, aux) const char *intrstr; #endif u_int32_t id; + u_int32_t command; struct scb_data *shared_scb_data; int opri; ahc_type ahc_t = AHC_NONE; @@ -336,12 +337,12 @@ ahc_pci_attach(parent, self, aux) paddr = NULL; #if defined(__FreeBSD__) io_port = 0; -#ifdef AHC_ALLOW_MEMIO - if (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr) == 0) -#endif - if (pci_map_port(config_id, PCI_BASEADR0, &io_port) == 0) + command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); + if ((command & PCI_COMMAND_MEM_ENABLE) == 0 + || (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr)) == 0) + if ((command & PCI_COMMAND_IO_ENABLE) == 0 + || (pci_map_port(config_id, PCI_BASEADR0, &io_port)) == 0) return; - #elif defined(__NetBSD__) /* XXX Memory mapped I/O?? */ if (bus_io_map(pa->pa_bc, iobase, iosize, &ioh)) @@ -618,7 +619,8 @@ ahc_pci_attach(parent, self, aux) /* In case we are a wide card */ ahc_outb(ahc, SCSICONF + 1, our_id); - if (!ultra_enb || (ahc->flags & AHC_USEDEFAULTS)) { + if (ultra_enb == 0 + && (ahc->flags & AHC_USEDEFAULTS) == 0) { /* * If there wasn't a BIOS or the board * wasn't in this mode to begin with, |