Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Get rid of _BUS_DMAMAP_MEM_XLATE



details:   https://anonhg.NetBSD.org/src/rev/68b5f1b3e700
branches:  trunk
changeset: 784395:68b5f1b3e700
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Jan 27 19:00:08 2013 +0000

description:
Get rid of _BUS_DMAMAP_MEM_XLATE

diffstat:

 sys/arch/arm/arm32/bus_dma.c    |  27 +++++++++------------------
 sys/arch/arm/include/bus_defs.h |   5 ++---
 2 files changed, 11 insertions(+), 21 deletions(-)

diffs (75 lines):

diff -r 22171a06d92b -r 68b5f1b3e700 sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c      Sun Jan 27 18:52:01 2013 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c      Sun Jan 27 19:00:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.70 2013/01/27 18:31:31 matt Exp $        */
+/*     $NetBSD: bus_dma.c,v 1.71 2013/01/27 19:00:08 matt Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.70 2013/01/27 18:31:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.71 2013/01/27 19:00:08 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1228,14 +1228,9 @@
                if (t->_ranges != NULL) {
                        const struct arm32_dma_range * const dr =
                            _bus_dma_paddr_inrange(t->_ranges, t->_nranges, pa);
-                       if (dr != NULL) {
-                               if (dr->dr_flags & _BUS_DMAMAP_COHERENT) {
-                                       direct_mapable = true;
-                               }
-                               if (flags & _BUS_DMAMAP_MEM_XLATE) {
-                                       pa = (pa - dr->dr_sysbase)
-                                           + dr->dr_busbase;
-                               }
+                       if (dr != NULL
+                           && (dr->dr_flags & _BUS_DMAMAP_COHERENT)) {
+                               direct_mapable = true;
                        }
                }
 
@@ -1290,15 +1285,11 @@
                         * If this dma region is coherent then there is
                         * no need for an uncached mapping.
                         */
-                       if (dr != NULL) {
-                               if (dr->dr_flags & _BUS_DMAMAP_COHERENT) {
-                                       uncached = false;
-                               }
-                               if (flags & _BUS_DMAMAP_MEM_XLATE) {
-                                       pa = (pa - dr->dr_sysbase)
-                                            + dr->dr_busbase;
-                               }
+                       if (dr != NULL
+                           && (dr->dr_flags & _BUS_DMAMAP_COHERENT)) {
+                               uncached = false;
                        }
+
                        pmap_kenter_pa(va, pa,
                            VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
 
diff -r 22171a06d92b -r 68b5f1b3e700 sys/arch/arm/include/bus_defs.h
--- a/sys/arch/arm/include/bus_defs.h   Sun Jan 27 18:52:01 2013 +0000
+++ b/sys/arch/arm/include/bus_defs.h   Sun Jan 27 19:00:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_defs.h,v 1.7 2013/01/27 18:31:31 matt Exp $        */
+/*     $NetBSD: bus_defs.h,v 1.8 2013/01/27 19:00:08 matt Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -301,8 +301,7 @@
  */
 #define        _BUS_DMAMAP_COHERENT    0x10000 /* no cache flush necessary on sync */
 #define        _BUS_DMAMAP_IS_BOUNCING 0x20000 /* is bouncing current xfer */
-#define        _BUS_DMAMAP_MEM_XLATE   0x40000 /* translate sys->bus for dmamam_map */
-#define        _BUS_DMAMAP_NOALLOC     0x80000 /* don't alloc memory from this range */
+#define        _BUS_DMAMAP_NOALLOC     0x40000 /* don't alloc memory from this range */
 
 /* Forwards needed by prototypes below. */
 struct mbuf;



Home | Main Index | Thread Index | Old Index