Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/broadcom If _ARM32_NEED_BUS_DMA_BOUNCE is defin...
details: https://anonhg.NetBSD.org/src/rev/5a9693ee51a0
branches: trunk
changeset: 784759:5a9693ee51a0
user: matt <matt%NetBSD.org@localhost>
date: Fri Feb 08 23:21:35 2013 +0000
description:
If _ARM32_NEED_BUS_DMA_BOUNCE is defined, only define one dma_range
for the coherent dma tag.
diffstat:
sys/arch/arm/broadcom/bcm53xx_board.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diffs (58 lines):
diff -r 4e4539b695f5 -r 5a9693ee51a0 sys/arch/arm/broadcom/bcm53xx_board.c
--- a/sys/arch/arm/broadcom/bcm53xx_board.c Fri Feb 08 22:37:14 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_board.c Fri Feb 08 23:21:35 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm53xx_board.c,v 1.9 2013/01/10 22:06:32 matt Exp $ */
+/* $NetBSD: bcm53xx_board.c,v 1.10 2013/02/08 23:21:35 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.9 2013/01/10 22:06:32 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.10 2013/02/08 23:21:35 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -91,9 +91,11 @@
.dr_busbase = 0x80000000,
.dr_len = 0x10000000,
.dr_flags = _BUS_DMAMAP_COHERENT,
+#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
}, [1] = {
.dr_sysbase = 0x90000000,
.dr_busbase = 0x90000000,
+#endif
},
};
@@ -521,7 +523,13 @@
void
bcm53xx_dma_bootstrap(psize_t memsize)
{
- if (memsize > 256*1024*1024) {
+ if (memsize < 256*1024*1024) {
+ bcm53xx_dma_ranges[0].dr_len = memsize;
+ bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+ bcm53xx_dma_tag._nranges = 1;
+ bcm53xx_coherent_dma_tag._nranges = 1;
+ } else {
/*
* By setting up two ranges, bus_dmamem_alloc will always
* try to allocate from range 0 first resulting in allocations
@@ -529,11 +537,7 @@
*/
bcm53xx_dma_ranges[1].dr_len = memsize - 0x10000000;
bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x10000000;
- } else {
- bcm53xx_dma_ranges[0].dr_len = memsize;
- bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
- bcm53xx_dma_tag._nranges = 1;
- bcm53xx_coherent_dma_tag._nranges = 1;
+#endif
}
KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0);
KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
Home |
Main Index |
Thread Index |
Old Index