diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-08-05 18:49:31 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-08-05 18:49:31 +0000 |
commit | a0db8ad77a95c662d4080de2569a8db1c9b82052 (patch) | |
tree | ca5a3f84fbaeec401763010d83b331cfe1b64a61 | |
parent | 4c519a889b94394871649805ff3f03641448930e (diff) |
Be more liberal about attaching products unknown to us (we have got ID
ranges from ICP-Vortex). New GDT products are normally configured with
"Do not move DPMEM" as default, so try that mapping type first.
-rw-r--r-- | sys/dev/pci/gdt_pci.c | 58 |
1 files changed, 12 insertions, 46 deletions
diff --git a/sys/dev/pci/gdt_pci.c b/sys/dev/pci/gdt_pci.c index 32f3fa18355..a0641a41776 100644 --- a/sys/dev/pci/gdt_pci.c +++ b/sys/dev/pci/gdt_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_pci.c,v 1.6 2000/08/03 21:33:12 niklas Exp $ */ +/* $OpenBSD: gdt_pci.c,v 1.7 2000/08/05 18:49:30 niklas Exp $ */ /* * Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved. @@ -155,49 +155,9 @@ gdt_pci_probe(parent, match, aux) { struct pci_attach_args *pa = aux; - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_VORTEX) - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_VORTEX_GDT_60x0: - case PCI_PRODUCT_VORTEX_GDT_6000B: - case PCI_PRODUCT_VORTEX_GDT_6x10: - case PCI_PRODUCT_VORTEX_GDT_6x20: - case PCI_PRODUCT_VORTEX_GDT_6530: - case PCI_PRODUCT_VORTEX_GDT_6550: - case PCI_PRODUCT_VORTEX_GDT_6x17: - case PCI_PRODUCT_VORTEX_GDT_6x27: - case PCI_PRODUCT_VORTEX_GDT_6537: - case PCI_PRODUCT_VORTEX_GDT_6557: - case PCI_PRODUCT_VORTEX_GDT_6x15: - case PCI_PRODUCT_VORTEX_GDT_6x25: - case PCI_PRODUCT_VORTEX_GDT_6535: - case PCI_PRODUCT_VORTEX_GDT_6555: - case PCI_PRODUCT_VORTEX_GDT_6x17RP: - case PCI_PRODUCT_VORTEX_GDT_6x27RP: - case PCI_PRODUCT_VORTEX_GDT_6537RP: - case PCI_PRODUCT_VORTEX_GDT_6557RP: - case PCI_PRODUCT_VORTEX_GDT_6x11RP: - case PCI_PRODUCT_VORTEX_GDT_6x21RP: - case PCI_PRODUCT_VORTEX_GDT_6x17RD: - case PCI_PRODUCT_VORTEX_GDT_6x27RD: - case PCI_PRODUCT_VORTEX_GDT_6537RD: - case PCI_PRODUCT_VORTEX_GDT_6557RD: - case PCI_PRODUCT_VORTEX_GDT_6x11RD: - case PCI_PRODUCT_VORTEX_GDT_6x21RD: - case PCI_PRODUCT_VORTEX_GDT_6x18RD: - case PCI_PRODUCT_VORTEX_GDT_6x28RD: - case PCI_PRODUCT_VORTEX_GDT_6x38RD: - case PCI_PRODUCT_VORTEX_GDT_6x58RD: - case PCI_PRODUCT_VORTEX_GDT_6518RS: - case PCI_PRODUCT_VORTEX_GDT_7x18RN: - case PCI_PRODUCT_VORTEX_GDT_7x28RN: - case PCI_PRODUCT_VORTEX_GDT_7x38RN: - case PCI_PRODUCT_VORTEX_GDT_7x58RN: - case PCI_PRODUCT_VORTEX_GDT_6x19RD: - case PCI_PRODUCT_VORTEX_GDT_6x29RD: - case PCI_PRODUCT_VORTEX_GDT_7x19RN: - case PCI_PRODUCT_VORTEX_GDT_7x29RN: - return (1); - } + if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_VORTEX && + PCI_PRODUCT(pa->pa_id) >= 0x100 && PCI_PRODUCT(pa->pa_id) <= 0x2ff) + return (1); return (0); } @@ -225,6 +185,7 @@ gdt_pci_attach(parent, self, aux) printf(": "); + gdt->sc_class = 0; prod = PCI_PRODUCT(pa->pa_id); switch (prod) { case PCI_PRODUCT_VORTEX_GDT_60x0: @@ -274,17 +235,22 @@ gdt_pci_attach(parent, self, aux) case PCI_PRODUCT_VORTEX_GDT_7x29RN: gdt->sc_class = GDT_MPR; } + + /* If we don't recognize it, determine class heuristically. */ + if (gdt->sc_class == 0) + gdt->sc_class = prod < 0x100 ? GDT_PCINEW : GDT_MPR; + if (prod >= GDT_PCI_PRODUCT_FC) gdt->sc_class |= GDT_FC; if (pci_mapreg_map(pa, GDT_CLASS(gdt) == GDT_PCINEW ? GDT_PCINEW_DPMEM : GDT_PCI_DPMEM, - PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT_1M, 0, &dpmemt, + PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0, &dpmemt, &dpmemh, &dpmembase, &dpmemsize)) { if (pci_mapreg_map(pa, GDT_CLASS(gdt) == GDT_PCINEW ? GDT_PCINEW_DPMEM : GDT_PCI_DPMEM, - PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0, + PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT_1M, 0, &dpmemt,&dpmemh, &dpmembase, &dpmemsize)) { printf("cannot map DPMEM\n"); goto bail_out; |