Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Support Adaptec U2W cards with a 64-bit PCI memo...



details:   https://anonhg.NetBSD.org/src/rev/5d6a306457d6
branches:  trunk
changeset: 485993:5d6a306457d6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 10 17:07:52 2000 +0000

description:
Support Adaptec U2W cards with a 64-bit PCI memory range (such cards
are available with Power Macintosh G3 and G4 systems).

diffstat:

 sys/dev/pci/ahc_pci.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 4b3be7a4aec7 -r 5d6a306457d6 sys/dev/pci/ahc_pci.c
--- a/sys/dev/pci/ahc_pci.c     Wed May 10 16:58:42 2000 +0000
+++ b/sys/dev/pci/ahc_pci.c     Wed May 10 17:07:52 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahc_pci.c,v 1.23 2000/03/16 10:34:33 fvdl Exp $        */
+/*     $NetBSD: ahc_pci.c,v 1.24 2000/05/10 17:07:52 thorpej Exp $     */
 
 /*
  * Product specific probe and attach routines for:
@@ -621,6 +621,7 @@
 #ifdef AHC_ALLOW_MEMIO
        bus_space_tag_t memt;
        bus_space_handle_t memh;
+       pcireg_t memtype;
 #endif
        pci_intr_handle_t ih;
        const char *intrstr;
@@ -638,9 +639,16 @@
        ioh_valid = memh_valid = 0;
 
 #ifdef AHC_ALLOW_MEMIO
-       memh_valid = (pci_mapreg_map(pa, AHC_PCI_MEMADDR,
-           PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
-           &memt, &memh, NULL, NULL) == 0);
+       memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, AHC_PCI_MEMADDR);
+       switch (memtype) {
+       case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
+       case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
+               memh_valid = (pci_mapreg_map(pa, AHC_PCI_MEMADDR,
+                   memtype, 0, &memt, &memh, NULL, NULL) == 0);
+               break;
+       default:
+               memh_valid = 0;
+       }
 #endif
        ioh_valid = (pci_mapreg_map(pa, AHC_PCI_IOADDR,
            PCI_MAPREG_TYPE_IO, 0, &iot, &ioh, NULL, NULL) == 0);



Home | Main Index | Thread Index | Old Index