Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sys/arch/alpha/pci Pull up revision 1.15 (requested by ...
details: https://anonhg.NetBSD.org/src/rev/ec6f123a9422
branches: netbsd-1-4
changeset: 470291:ec6f123a9422
user: he <he%NetBSD.org@localhost>
date: Sun Feb 06 17:30:01 2000 +0000
description:
Pull up revision 1.15 (requested by thorpej):
Fix host->device DMA data corruption problem on DEC Miata
workstations.
diffstat:
sys/arch/alpha/pci/cia_dma.c | 53 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 50 insertions(+), 3 deletions(-)
diffs (88 lines):
diff -r 99bead5fe186 -r ec6f123a9422 sys/arch/alpha/pci/cia_dma.c
--- a/sys/arch/alpha/pci/cia_dma.c Sun Feb 06 17:29:37 2000 +0000
+++ b/sys/arch/alpha/pci/cia_dma.c Sun Feb 06 17:30:01 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cia_dma.c,v 1.13.6.1 2000/01/31 19:19:53 he Exp $ */
+/* $NetBSD: cia_dma.c,v 1.13.6.2 2000/02/06 17:30:01 he Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cia_dma.c,v 1.13.6.1 2000/01/31 19:19:53 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cia_dma.c,v 1.13.6.2 2000/02/06 17:30:01 he Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -58,6 +58,9 @@
bus_dma_tag_t cia_dma_get_tag __P((bus_dma_tag_t, alpha_bus_t));
+int cia_bus_dmamap_create_direct __P((bus_dma_tag_t, bus_size_t, int,
+ bus_size_t, bus_size_t, int, bus_dmamap_t *));
+
int cia_bus_dmamap_create_sgmap __P((bus_dma_tag_t, bus_size_t, int,
bus_size_t, bus_size_t, int, bus_dmamap_t *));
@@ -118,7 +121,7 @@
t->_boundary = 0;
t->_sgmap = NULL;
t->_get_tag = cia_dma_get_tag;
- t->_dmamap_create = _bus_dmamap_create;
+ t->_dmamap_create = cia_bus_dmamap_create_direct;
t->_dmamap_destroy = _bus_dmamap_destroy;
t->_dmamap_load = _bus_dmamap_load_direct;
t->_dmamap_load_mbuf = _bus_dmamap_load_mbuf_direct;
@@ -285,6 +288,50 @@
}
/*
+ * Create a CIA direct-mapped DMA map.
+ */
+int
+cia_bus_dmamap_create_direct(t, size, nsegments, maxsegsz, boundary,
+ flags, dmamp)
+ bus_dma_tag_t t;
+ bus_size_t size;
+ int nsegments;
+ bus_size_t maxsegsz;
+ bus_size_t boundary;
+ int flags;
+ bus_dmamap_t *dmamp;
+{
+ struct cia_config *ccp = t->_cookie;
+ bus_dmamap_t map;
+ int error;
+
+ error = _bus_dmamap_create(t, size, nsegments, maxsegsz,
+ boundary, flags, dmamp);
+ if (error)
+ return (error);
+
+ map = *dmamp;
+
+ if ((ccp->cc_flags & CCF_PYXISBUG) != 0 &&
+ map->_dm_segcnt > 1) {
+ /*
+ * We have a Pyxis with the DMA page crossing bug, make
+ * sure we don't coalesce adjacent DMA segments.
+ *
+ * NOTE: We can only do this if the max segment count
+ * is greater than 1. This is because many network
+ * drivers allocate large contiguous blocks of memory
+ * for control data structures, even though they won't
+ * do any single DMA that crosses a page coundary.
+ * -- thorpej%netbsd.org@localhost, 2/5/2000
+ */
+ map->_dm_flags |= DMAMAP_NO_COALESCE;
+ }
+
+ return (0);
+}
+
+/*
* Create a CIA SGMAP-mapped DMA map.
*/
int
Home |
Main Index |
Thread Index |
Old Index