Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Add a config flag (0x02) that can force DMA to b...



details:   https://anonhg.NetBSD.org/src/rev/1d5b2037ec15
branches:  trunk
changeset: 516323:1d5b2037ec15
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Oct 21 18:55:14 2001 +0000

description:
Add a config flag (0x02) that can force DMA to be *disabled* on
chipsets for which it would otherwise be enabled by default.

diffstat:

 sys/dev/pci/pciide.c |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (55 lines):

diff -r 0ef21dd92f78 -r 1d5b2037ec15 sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c      Sun Oct 21 18:49:19 2001 +0000
+++ b/sys/dev/pci/pciide.c      Sun Oct 21 18:55:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciide.c,v 1.131 2001/10/16 08:22:50 tron Exp $        */
+/*     $NetBSD: pciide.c,v 1.132 2001/10/21 18:55:14 thorpej Exp $     */
 
 
 /*
@@ -538,7 +538,8 @@
 };
 
 /* options passed via the 'flags' config keyword */
-#define PCIIDE_OPTIONS_DMA     0x01
+#define        PCIIDE_OPTIONS_DMA      0x01
+#define        PCIIDE_OPTIONS_NODMA    0x02
 
 int    pciide_match __P((struct device *, struct cfdata *, void *));
 void   pciide_attach __P((struct device *, struct device *, void *));
@@ -823,7 +824,8 @@
                if ((sc->sc_pp->ide_flags & IDE_16BIT_IOSPACE)
                    && addr >= 0x10000) {
                        sc->sc_dma_ok = 0;
-                       printf(", but unused (registers at unsafe address %#lx)", (unsigned long)addr);
+                       printf(", but unused (registers at unsafe address "
+                           "%#lx)", (unsigned long)addr);
                        break;
                }
                /* FALLTHROUGH */
@@ -841,6 +843,12 @@
                        sc->sc_wdcdev.dma_start = pciide_dma_start;
                        sc->sc_wdcdev.dma_finish = pciide_dma_finish;
                }
+
+               if (sc->sc_wdcdev.sc_dev.dv_cfdata->cf_flags &
+                   PCIIDE_OPTIONS_NODMA) {
+                       printf(", but unused (forced off by config file)");
+                       sc->sc_dma_ok = 0;
+               }
                break;
 
        default:
@@ -1305,9 +1313,9 @@
                        sc->sc_dma_ok = 0;
                } else {
                        pciide_mapreg_dma(sc, pa);
-               if (sc->sc_dma_ok != 0)
-                       printf(", used without full driver "
-                           "support");
+                       if (sc->sc_dma_ok != 0)
+                               printf(", used without full driver "
+                                   "support");
                }
        } else {
                printf("%s: hardware does not support DMA",



Home | Main Index | Thread Index | Old Index