Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Apply BUS_DMA_NOCACHE for the buffers in the cas...



details:   https://anonhg.NetBSD.org/src/rev/e467b9684f9c
branches:  trunk
changeset: 542412:e467b9684f9c
user:      kent <kent%NetBSD.org@localhost>
date:      Tue Jan 28 02:09:34 2003 +0000

description:
Apply BUS_DMA_NOCACHE for the buffers in the case of 440MX.  The
code was provided by DHOYASHIKI Shinichi in kern/19919, and
address kern/19435.

diffstat:

 sys/dev/pci/auich.c |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (60 lines):

diff -r 5717ee1e64b4 -r e467b9684f9c sys/dev/pci/auich.c
--- a/sys/dev/pci/auich.c       Tue Jan 28 01:43:34 2003 +0000
+++ b/sys/dev/pci/auich.c       Tue Jan 28 02:09:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auich.c,v 1.33 2003/01/21 16:05:21 kent Exp $  */
+/*     $NetBSD: auich.c,v 1.34 2003/01/28 02:09:34 kent Exp $  */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -115,7 +115,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.33 2003/01/21 16:05:21 kent Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.34 2003/01/28 02:09:34 kent Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -211,6 +211,8 @@
        /* SiS 7012 hack */
        int  sc_sample_size;
        int  sc_sts_reg;
+       /* 440MX workaround */
+       int  sc_dmamap_flags;
 
        void (*sc_pintr)(void *);
        void *sc_parg;
@@ -446,7 +448,13 @@
            && d->product == PCI_PRODUCT_NVIDIA_NFORCE_MCP_AC) {
                sc->sc_ignore_codecready = TRUE;
        }
-
+       /* Workaround for a 440MX B-stepping erratum */
+       sc->sc_dmamap_flags = BUS_DMA_COHERENT;
+       if (d->vendor == PCI_VENDOR_INTEL
+           && d->product == PCI_PRODUCT_INTEL_82440MX_ACA) {
+               sc->sc_dmamap_flags |= BUS_DMA_NOCACHE;
+               printf("%s: DMA bug workaround enabled\n", sc->sc_dev.dv_xname);
+       }
 
        /* Set up DMA lists. */
        sc->ptr_pcmo = sc->ptr_pcmi = sc->ptr_mici = 0;
@@ -1230,7 +1238,7 @@
                return (error);
 
        error = bus_dmamem_map(sc->dmat, p->segs, p->nsegs, p->size,
-                              &p->addr, BUS_DMA_NOWAIT|BUS_DMA_COHERENT);
+                              &p->addr, BUS_DMA_NOWAIT|sc->sc_dmamap_flags);
        if (error)
                goto free;
 
@@ -1286,7 +1294,7 @@
        if ((error = bus_dmamem_map(sc->dmat, &seg, rseg,
                                    sizeof(struct auich_cdata),
                                    (caddr_t *) &sc->sc_cdata,
-                                   BUS_DMA_COHERENT)) != 0) {
+                                   sc->sc_dmamap_flags)) != 0) {
                printf("%s: unable to map control data, error = %d\n",
                    sc->sc_dev.dv_xname, error);
                goto fail_1;



Home | Main Index | Thread Index | Old Index