summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/conf.c5
-rw-r--r--sys/arch/amd64/conf/GENERIC5
-rw-r--r--sys/arch/amd64/conf/files.amd6411
-rw-r--r--sys/arch/amd64/pci/agp_machdep.c12
-rw-r--r--sys/arch/amd64/pci/pchb.c35
5 files changed, 44 insertions, 24 deletions
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c
index 9f1323cb280..eed892fe3b6 100644
--- a/sys/arch/amd64/amd64/conf.c
+++ b/sys/arch/amd64/amd64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.16 2007/09/12 18:18:27 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.17 2007/11/25 17:11:12 oga Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -171,6 +171,8 @@ cdev_decl(cztty);
#include "radio.h"
#include "nvram.h"
cdev_decl(nvram);
+#include "agp.h"
+cdev_decl(agp);
#include "wsdisplay.h"
#include "wskbd.h"
@@ -293,6 +295,7 @@ struct cdevsw cdevsw[] =
cdev_acpi_init(NACPI,acpi), /* 83: ACPI */
cdev_bthub_init(NBTHUB,bthub), /* 84: bthub */
cdev_nvram_init(NNVRAM,nvram), /* 85: NVRAM interface */
+ cdev_agp_init(NAGP,agp), /* 86: agp */
};
int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC
index e0d1bb9ca78..ae3264f79a0 100644
--- a/sys/arch/amd64/conf/GENERIC
+++ b/sys/arch/amd64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.205 2007/11/25 12:00:46 jsg Exp $
+# $OpenBSD: GENERIC,v 1.206 2007/11/25 17:11:12 oga Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -64,6 +64,8 @@ pci* at pchb?
pcib* at pci? # PCI-ISA bridge
amdpcib* at pci? # AMD 8111 LPC bridge
+agp* at pchb? # AGP bridge
+
# National Semiconductor LM7[89] and compatible hardware monitors
lm0 at isa? port 0x290
#lm1 at isa? port 0x280
@@ -237,7 +239,6 @@ pms* at pckbc? # PS/2 mouse for wsmouse
pmsi* at pckbc? # PS/2 "Intelli"mouse for wsmouse
vga0 at isa?
vga* at pci?
-option PCIAGP
wsdisplay* at vga?
wskbd* at pckbd? mux 1
wsmouse* at pms? mux 0
diff --git a/sys/arch/amd64/conf/files.amd64 b/sys/arch/amd64/conf/files.amd64
index 6cd06816c70..5ab5f20a899 100644
--- a/sys/arch/amd64/conf/files.amd64
+++ b/sys/arch/amd64/conf/files.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: files.amd64,v 1.36 2007/10/10 15:53:51 art Exp $
+# $OpenBSD: files.amd64,v 1.37 2007/11/25 17:11:12 oga Exp $
maxpartitions 16
maxusers 2 16 128
@@ -102,8 +102,12 @@ file arch/amd64/pci/pciide_machdep.c pciide
include "dev/puc/files.puc"
+# AGP
+include "dev/pci/files.agp"
+file arch/amd64/pci/agp_machdep.c agp
+
# PCI Host bridge chipsets
-device pchb: pcibus
+device pchb: pcibus, agpbus, agp_i810
attach pchb at pci
file arch/amd64/pci/pchb.c pchb
@@ -222,6 +226,3 @@ major {cd = 6}
major {rd = 17}
major {wd = 0}
major {fd = 2}
-
-file arch/amd64/pci/agp_machdep.c pciagp
-file dev/pci/agp_i810.c pciagp
diff --git a/sys/arch/amd64/pci/agp_machdep.c b/sys/arch/amd64/pci/agp_machdep.c
index ff725b830cb..6237588010d 100644
--- a/sys/arch/amd64/pci/agp_machdep.c
+++ b/sys/arch/amd64/pci/agp_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agp_machdep.c,v 1.2 2007/08/04 19:40:25 reyk Exp $ */
+/* $OpenBSD: agp_machdep.c,v 1.3 2007/11/25 17:11:12 oga Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -36,16 +36,6 @@
#include <machine/cpufunc.h>
-const struct agp_product agp_products[] = {
- { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82915G_IV, agp_i810_attach },
- { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82915GM_IGD, agp_i810_attach },
- { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82945G_IGD_1, agp_i810_attach },
- { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82945GM_IGD, agp_i810_attach },
- { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82965_IGD_1, agp_i810_attach },
- { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82965GM_IGD_1, agp_i810_attach },
- { 0, 0, NULL }
-};
-
void
agp_flush_cache(void)
{
diff --git a/sys/arch/amd64/pci/pchb.c b/sys/arch/amd64/pci/pchb.c
index 358a82dd976..dfd27f45f4b 100644
--- a/sys/arch/amd64/pci/pchb.c
+++ b/sys/arch/amd64/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.11 2007/11/16 15:31:19 mikeb Exp $ */
+/* $OpenBSD: pchb.c,v 1.12 2007/11/25 17:11:12 oga Exp $ */
/* $NetBSD: pchb.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -73,6 +73,8 @@
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
+#include <dev/pci/agpvar.h>
+
#include <dev/rndvar.h>
#include <dev/ic/i82802reg.h>
@@ -128,6 +130,7 @@ int pchbmatch(struct device *, void *, void *);
void pchbattach(struct device *, struct device *, void *);
int pchb_print(void *, const char *);
+int agpbus_print(void *, const char *);
void pchb_rnd(void *);
void pchb_amd64ht_attach (struct device *, struct pci_attach_args *, int);
@@ -157,7 +160,10 @@ pchbattach(struct device *parent, struct device *self, void *aux)
{
struct pchb_softc *sc = (struct pchb_softc *)self;
struct pci_attach_args *pa = aux;
- int i, r;
+ struct agpbus_attach_args apa;
+ int has_agp, i, r;
+
+ has_agp = 0;
switch (PCI_VENDOR(pa->pa_id)) {
case PCI_VENDOR_AMD:
@@ -169,9 +175,6 @@ pchbattach(struct device *parent, struct device *self, void *aux)
}
break;
case PCI_VENDOR_INTEL:
-#ifdef PCIAGP
- pciagp_set_pchb(pa);
-#endif
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_INTEL_82915G_HB:
case PCI_PRODUCT_INTEL_82925X_HB:
@@ -217,6 +220,20 @@ pchbattach(struct device *parent, struct device *self, void *aux)
break;
}
printf("\n");
+
+ /*
+ * If we haven't detected AGP yet (via a product ID),
+ * then check for AGP capability on the device.
+ */
+ if (has_agp ||
+ pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_AGP,
+ NULL, NULL) != 0) {
+ printf("\n");
+ apa.apa_busname = "agp";
+ apa.apa_pci_args = *pa;
+ config_found(self, &apa, agpbus_print);
+ printf("\n");
+ }
}
int
@@ -230,6 +247,14 @@ pchb_print(void *aux, const char *pnp)
return (UNCONF);
}
+int
+agpbus_print(void *vaa, const char *pnp)
+{
+ if (pnp)
+ printf("agp at %s", pnp);
+ return (UNCONF);
+}
+
void
pchb_amd64ht_attach(struct device *self, struct pci_attach_args *pa, int i)
{