summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-07-12 20:17:04 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-07-12 20:17:04 +0000
commit5865d6a998391648e294e7a7d4670166fb810364 (patch)
treef676c2582d4801871f0dcc11309adaa318343ddc /sys/arch/i386/pci
parentb7951dd4c58d1d7d1cbd884949af928addaa1330 (diff)
support for the agp gart on various agp chipsets.
only i810 driver was tested though. based on the netbsd's lkm, initially ported by hunter@dg.net.ua and later made into shape by mickey. testing by art@ and millert@ .
Diffstat (limited to 'sys/arch/i386/pci')
-rw-r--r--sys/arch/i386/pci/agp_machdep.c57
-rw-r--r--sys/arch/i386/pci/pchb.c26
2 files changed, 79 insertions, 4 deletions
diff --git a/sys/arch/i386/pci/agp_machdep.c b/sys/arch/i386/pci/agp_machdep.c
new file mode 100644
index 00000000000..4f6f7780e0c
--- /dev/null
+++ b/sys/arch/i386/pci/agp_machdep.c
@@ -0,0 +1,57 @@
+/* $OpenBSD: agp_machdep.c,v 1.1 2002/07/12 20:17:03 mickey Exp $ */
+
+/*
+ * Copyright (c) 2002 Michael Shalayeff
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/device.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcidevs.h>
+#include <dev/pci/agpvar.h>
+
+#include <machine/cpufunc.h>
+
+const struct agp_product agp_products[] = {
+ { PCI_VENDOR_ALI, -1, agp_ali_attach },
+ { PCI_VENDOR_AMD, -1, agp_amd_attach },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810_GC, agp_i810_attach },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810_DC100_GC, agp_i810_attach },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82810E_GC, agp_i810_attach },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82815_FULL_GRAPH, agp_i810_attach },
+/* { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82830MP_IV, agp_i810_attach }, */
+ { PCI_VENDOR_INTEL, -1, agp_intel_attach },
+ { PCI_VENDOR_SIS, -1, agp_sis_attach },
+ { PCI_VENDOR_VIATECH, -1, agp_via_attach },
+ { 0, 0, NULL }
+};
+
+void
+agp_flush_cache(void)
+{
+ wbinvd();
+}
diff --git a/sys/arch/i386/pci/pchb.c b/sys/arch/i386/pci/pchb.c
index 8be6bbd297e..f7c6d5aca1f 100644
--- a/sys/arch/i386/pci/pchb.c
+++ b/sys/arch/i386/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.34 2002/06/12 15:52:54 mickey Exp $ */
+/* $OpenBSD: pchb.c,v 1.35 2002/07/12 20:17:03 mickey Exp $ */
/* $NetBSD: pchb.c,v 1.6 1997/06/06 23:29:16 thorpej Exp $ */
/*
@@ -165,6 +165,21 @@ pchbattach(parent, self, aux)
*/
switch (PCI_VENDOR(pa->pa_id)) {
+#ifdef PCIAGP
+ case PCI_VENDOR_ALI:
+ case PCI_VENDOR_SIS:
+ case PCI_VENDOR_VIATECH:
+ pciagp_set_pchb(pa);
+ break;
+ case PCI_VENDOR_AMD:
+ switch (PCI_PRODUCT(pa->pa_id)) {
+ case PCI_PRODUCT_AMD_SC751_SC:
+ case PCI_PRODUCT_AMD_762_PCHB:
+ pciagp_set_pchb(pa);
+ break;
+ }
+ break;
+#endif
case PCI_VENDOR_RCC:
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_RCC_CNB20HE:
@@ -195,6 +210,9 @@ pchbattach(parent, self, aux)
}
break;
case PCI_VENDOR_INTEL:
+#ifdef PCIAGP
+ pciagp_set_pchb(pa);
+#endif
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_INTEL_82443BX_AGP: /* 82443BX AGP (PAC) */
case PCI_PRODUCT_INTEL_82443BX_NOAGP: /* 82443BX Host-PCI (no AGP) */
@@ -286,13 +304,13 @@ pchbattach(parent, self, aux)
printf(": disabled CPU-PCI write posting");
}
break;
- case PCI_PRODUCT_INTEL_82810E_MCH:
- case PCI_PRODUCT_INTEL_82810_DC100_MCH:
case PCI_PRODUCT_INTEL_82810_MCH:
+ case PCI_PRODUCT_INTEL_82810_DC100_MCH:
+ case PCI_PRODUCT_INTEL_82810E_MCH:
case PCI_PRODUCT_INTEL_82815_DC100_HUB:
- case PCI_PRODUCT_INTEL_82815_NOAGP_HUB:
case PCI_PRODUCT_INTEL_82815_NOGRAPH_HUB:
case PCI_PRODUCT_INTEL_82815_FULL_HUB:
+ case PCI_PRODUCT_INTEL_82815_NOAGP_HUB:
case PCI_PRODUCT_INTEL_82820_MCH:
case PCI_PRODUCT_INTEL_82840_HB:
case PCI_PRODUCT_INTEL_82850_HB: