diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-05-10 14:44:43 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-05-10 14:44:43 +0000 |
commit | be700cb31669b73a1f90a83f992c3248c711640c (patch) | |
tree | 782f45882d54077d51c8acbd11510887fa570e95 /sys/dev/pci/agp_sis.c | |
parent | 344a2b71e8b6eb11177c15418fbfb117fc61d278 (diff) |
change agp driver attach so that the driver passes in the base address
of its aperture, instead of the BAR and memory type. This is a little
larger, but allows the driver to know it's aperture address. Needed for
some future stuff.
Diffstat (limited to 'sys/dev/pci/agp_sis.c')
-rw-r--r-- | sys/dev/pci/agp_sis.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/pci/agp_sis.c b/sys/dev/pci/agp_sis.c index 079809cf24c..b9f610e5ff0 100644 --- a/sys/dev/pci/agp_sis.c +++ b/sys/dev/pci/agp_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_sis.c,v 1.10 2008/11/09 22:54:01 oga Exp $ */ +/* $OpenBSD: agp_sis.c,v 1.11 2009/05/10 14:44:42 oga Exp $ */ /* $NetBSD: agp_sis.c,v 1.2 2001/09/15 00:25:00 thorpej Exp $ */ /*- @@ -54,6 +54,7 @@ struct agp_sis_softc { struct agp_gatt *gatt; pci_chipset_tag_t ssc_pc; pcitag_t ssc_tag; + bus_addr_t ssc_apaddr; bus_size_t initial_aperture; }; @@ -104,6 +105,12 @@ agp_sis_attach(struct device *parent, struct device *self, void *aux) struct agp_gatt *gatt; pcireg_t reg; + if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, AGP_APBASE, + PCI_MAPREG_TYPE_MEM, &ssc->ssc_apaddr, NULL, NULL) != 0) { + printf(": can't get aperture info\n"); + return; + } + ssc->ssc_pc = pa->pa_pc; ssc->ssc_tag = pa->pa_tag; ssc->initial_aperture = agp_sis_get_aperture(ssc); @@ -135,7 +142,7 @@ agp_sis_attach(struct device *parent, struct device *self, void *aux) pci_conf_write(ssc->ssc_pc, ssc->ssc_tag, AGP_SIS_WINCTRL, reg); ssc->agpdev = (struct agp_softc *)agp_attach_bus(pa, &agp_sis_methods, - AGP_APBASE, PCI_MAPREG_TYPE_MEM, &ssc->dev); + ssc->ssc_apaddr, &ssc->dev); return; } |