diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-03-16 19:00:29 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-03-16 19:00:29 +0000 |
commit | c5322cc7f26f297d89d5739341558d77a823ca0a (patch) | |
tree | 89262368ac92e725ff85a9bd6201003c7e69d4c7 /sys/arch/i386 | |
parent | 68d85f5a89fb982d3c281c6c189cd217dc0d9ae0 (diff) |
Make agp(4) attach at vga(4) instead of pchb(4). This is because sometimes
agp and drm need to use the same memory mapping, the best way to deal
with that is to allow them to share (that's coming later), for this to
work cleanly we move the attach point of agp.
Ideally most agp drivers would attach at pchb, with only agp_i810
(and any that work similarly) attaching at vga, but this will do for
now.
ok kettenis@, miod@.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/conf/GENERIC | 5 | ||||
-rw-r--r-- | sys/arch/i386/conf/files.i386 | 9 | ||||
-rw-r--r-- | sys/arch/i386/pci/pchb.c | 23 |
3 files changed, 16 insertions, 21 deletions
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC index 4ff07e85eef..68672b403c6 100644 --- a/sys/arch/i386/conf/GENERIC +++ b/sys/arch/i386/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.603 2008/02/25 23:16:47 brad Exp $ +# $OpenBSD: GENERIC,v 1.604 2008/03/16 19:00:28 oga Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -85,7 +85,6 @@ gpio* at gscpcib? glxpcib* at pci? # AMD CS5536 PCI-ISA bridge gpio* at glxpcib? -agp* at pchb? # AGP bridges # power management and other environmental stuff elansc* at pci? # AMD Elan SC520 System Controller gpio* at elansc? @@ -318,6 +317,8 @@ wskbd* at pckbd? mux 1 wsmouse* at pms? mux 0 wsmouse* at pmsi? mux 0 +agp* at vga? # AGP bridges + #vesabios0 at mainbus? # option VESABIOSVERBOSE diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386 index d7ef2e18a9e..669df8ef1f5 100644 --- a/sys/arch/i386/conf/files.i386 +++ b/sys/arch/i386/conf/files.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: files.i386,v 1.172 2008/03/04 21:14:29 oga Exp $ +# $OpenBSD: files.i386,v 1.173 2008/03/16 19:00:28 oga Exp $ # # new style config file for i386 architecture # @@ -96,12 +96,15 @@ file arch/i386/i386/mainbus.c mainbus # include "../../../dev/pci/files.pci" -include "../../../dev/pci/files.agp" file arch/i386/pci/pci_machdep.c pci -file arch/i386/pci/agp_machdep.c agp file arch/i386/pci/pciide_machdep.c pciide file arch/i386/pci/pcic_pci_machdep.c pcic_pci +# AGP devices +device agp: agp_ali, agp_amd, agp_i810, agp_intel, agp_sis, agp_via +attach agp at agpbus +file arch/i386/pci/agp_machdep.c agp + # PCI-Host bridge chipsets device pchb: pcibus, agpbus, agp_amd, agp_i810, agp_intel, agp_sis, agp_via diff --git a/sys/arch/i386/pci/pchb.c b/sys/arch/i386/pci/pchb.c index 759bd9c2953..28b8efad035 100644 --- a/sys/arch/i386/pci/pchb.c +++ b/sys/arch/i386/pci/pchb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pchb.c,v 1.66 2008/01/04 00:23:25 kettenis Exp $ */ +/* $OpenBSD: pchb.c,v 1.67 2008/03/16 19:00:28 oga Exp $ */ /* $NetBSD: pchb.c,v 1.65 2007/08/15 02:26:13 markd Exp $ */ /* @@ -79,6 +79,8 @@ #include <dev/ic/i82802reg.h> +#include "agp.h" + #define PCISET_INTEL_BRIDGETYPE_MASK 0x3 #define PCISET_INTEL_TYPE_COMPAT 0x1 #define PCISET_INTEL_TYPE_AUX 0x2 @@ -139,7 +141,6 @@ struct cfdriver pchb_cd = { }; 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); @@ -174,7 +175,6 @@ pchbattach(struct device *parent, struct device *self, void *aux) struct pchb_softc *sc = (struct pchb_softc *)self; struct pci_attach_args *pa = aux; struct pcibus_attach_args pba; - struct agpbus_attach_args apa; pcireg_t bcreg; u_char bdnum, pbnum; pcitag_t tag; @@ -396,17 +396,16 @@ pchbattach(struct device *parent, struct device *self, void *aux) break; } +#if NAGP > 0 /* * 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) { - apa.apa_busname = "agp"; - apa.apa_pci_args = *pa; - config_found(self, &apa, agpbus_print); - } + NULL, NULL) != 0) + agp_set_pchb(pa); +#endif /* NAGP > 0 */ #ifdef __i386__ if (doattach == 0) return; @@ -434,14 +433,6 @@ 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); -} - /* * Should do FIPS testing as per: * http://csrc.nist.gov/publications/fips/fips140-1/fips1401.pdf |