Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Don't map the aperture into KVA, it isn't needed.



details:   https://anonhg.NetBSD.org/src/rev/c9ab98236cd5
branches:  trunk
changeset: 515675:c9ab98236cd5
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon Oct 01 21:54:48 2001 +0000

description:
Don't map the aperture into KVA, it isn't needed.

diffstat:

 sys/dev/pci/agp.c     |  16 ++++++++++------
 sys/dev/pci/agp_amd.c |   3 ++-
 sys/dev/pci/agpvar.h  |   5 ++---
 3 files changed, 14 insertions(+), 10 deletions(-)

diffs (93 lines):

diff -r 744eb9316aef -r c9ab98236cd5 sys/dev/pci/agp.c
--- a/sys/dev/pci/agp.c Mon Oct 01 17:19:17 2001 +0000
+++ b/sys/dev/pci/agp.c Mon Oct 01 21:54:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp.c,v 1.10 2001/09/16 18:33:08 thorpej Exp $ */
+/*     $NetBSD: agp.c,v 1.11 2001/10/01 21:54:48 fvdl Exp $    */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -138,6 +138,8 @@
          NULL,                 agp_i810_attach },
        { PCI_VENDOR_INTEL,     PCI_PRODUCT_INTEL_82815_FULL_HUB,
          NULL,                 agp_i810_attach },
+       { PCI_VENDOR_INTEL,     PCI_PRODUCT_INTEL_82840_HB,
+         NULL,                 agp_i810_attach },
 #endif
 
 #if NAGP_INTEL > 0
@@ -280,13 +282,16 @@
 agp_map_aperture(struct pci_attach_args *pa, struct agp_softc *sc)
 {
        /*
-        * Find and map the aperture.
+        * Find and the aperture. Don't map it (yet), this would
+        * eat KVA.
         */
-       if (pci_mapreg_map(pa, AGP_APBASE, PCI_MAPREG_TYPE_MEM,
-           BUS_SPACE_MAP_LINEAR,
-           &sc->as_apt, &sc->as_aph, &sc->as_apaddr, &sc->as_apsize) != 0)
+       if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, AGP_APBASE,
+           PCI_MAPREG_TYPE_MEM, &sc->as_apaddr, &sc->as_apsize,
+           &sc->as_apflags) != 0)
                return ENXIO;
 
+       sc->as_apt = pa->pa_memt;
+
        return 0;
 }
 
@@ -872,7 +877,6 @@
            sc->as_capoff + AGP_STATUS);
        info->ai_aperture_base = sc->as_apaddr;
        info->ai_aperture_size = sc->as_apsize; /* XXXfvdl inconsistent */
-       info->ai_aperture_vaddr = bus_space_vaddr(sc->as_apt, sc->as_aph);
        info->ai_memory_allowed = sc->as_maxmem;
        info->ai_memory_used = sc->as_allocated;
 }
diff -r 744eb9316aef -r c9ab98236cd5 sys/dev/pci/agp_amd.c
--- a/sys/dev/pci/agp_amd.c     Mon Oct 01 17:19:17 2001 +0000
+++ b/sys/dev/pci/agp_amd.c     Mon Oct 01 21:54:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_amd.c,v 1.4 2001/10/01 14:41:09 fvdl Exp $ */
+/*     $NetBSD: agp_amd.c,v 1.5 2001/10/01 21:54:48 fvdl Exp $ */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -156,6 +156,7 @@
 
        switch (PCI_PRODUCT(pa->pa_id)) {
        case PCI_PRODUCT_AMD_SC751_SC:
+       case PCI_PRODUCT_AMD_SC762_NB:
                return 1;
        }
 
diff -r 744eb9316aef -r c9ab98236cd5 sys/dev/pci/agpvar.h
--- a/sys/dev/pci/agpvar.h      Mon Oct 01 17:19:17 2001 +0000
+++ b/sys/dev/pci/agpvar.h      Mon Oct 01 21:54:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agpvar.h,v 1.3 2001/09/15 00:25:00 thorpej Exp $       */
+/*     $NetBSD: agpvar.h,v 1.4 2001/10/01 21:54:48 fvdl Exp $  */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -56,7 +56,6 @@
        u_int32_t       ai_mode;
        bus_addr_t      ai_aperture_base;
        bus_size_t      ai_aperture_size;
-       void *          ai_aperture_vaddr;
        vsize_t         ai_memory_allowed;
        vsize_t         ai_memory_used;
        u_int32_t       ai_devid;
@@ -132,10 +131,10 @@
 struct agp_softc {
        struct device           as_dev;
        bus_space_tag_t         as_apt;
-       bus_space_handle_t      as_aph;
        int                     as_capoff;
        bus_addr_t              as_apaddr;
        bus_size_t              as_apsize;
+       int                     as_apflags;
        bus_dma_tag_t           as_dmat;
        u_int32_t               as_maxmem;      /* allocation upper bound */
        u_int32_t               as_allocated;   /* amount allocated */



Home | Main Index | Thread Index | Old Index