summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2015-03-05 22:50:20 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-06 07:53:48 +0100
commit59bf5f0b5d3f4d1619a09f3aea7278382d53c3a3 (patch)
tree3a6e18646b68375faf6e62dce1406bdbad607f5c /arch
parent0ba21609c447e324d6451f1ca2f52287b580c4f9 (diff)
downloadbarebox-59bf5f0b5d3f4d1619a09f3aea7278382d53c3a3.tar.gz
barebox-59bf5f0b5d3f4d1619a09f3aea7278382d53c3a3.tar.xz
ARM: bcm2835: mbox: convert to streaming DMA ops
Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-bcm2835/mbox.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-bcm2835/mbox.c b/arch/arm/mach-bcm2835/mbox.c
index 1a8077182a..9d69bc8ea7 100644
--- a/arch/arm/mach-bcm2835/mbox.c
+++ b/arch/arm/mach-bcm2835/mbox.c
@@ -7,9 +7,9 @@
*/
#include <asm/io.h>
-#include <asm/mmu.h>
#include <common.h>
#include <clock.h>
+#include <dma.h>
#include <mach/mbox.h>
@@ -55,7 +55,8 @@ static int bcm2835_mbox_call_raw(u32 chan, struct bcm2835_mbox_hdr *buffer,
/* Send the request */
val = BCM2835_MBOX_PACK(chan, send);
debug("mbox: TX raw: 0x%08x\n", val);
- dma_flush_range(send, send + buffer->buf_size);
+ dma_sync_single_for_device((unsigned long)send, buffer->buf_size,
+ DMA_BIDIRECTIONAL);
writel(val, &regs->write);
/* Wait for the response */
@@ -72,7 +73,8 @@ static int bcm2835_mbox_call_raw(u32 chan, struct bcm2835_mbox_hdr *buffer,
/* Read the response */
val = readl(&regs->read);
debug("mbox: RX raw: 0x%08x\n", val);
- dma_inv_range(send, send + buffer->buf_size);
+ dma_sync_single_for_cpu((unsigned long)send, buffer->buf_size,
+ DMA_BIDIRECTIONAL);
/* Validate the response */
if (BCM2835_MBOX_UNPACK_CHAN(val) != chan) {