summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2015-03-05 22:50:19 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-06 07:53:48 +0100
commit0ba21609c447e324d6451f1ca2f52287b580c4f9 (patch)
tree70b02fa1f1446f7e73013a3484c84e5dac3d200b
parent602d399e63e6a42535f3208490ad1e63e6ca3470 (diff)
downloadbarebox-0ba21609c447e324d6451f1ca2f52287b580c4f9.tar.gz
barebox-0ba21609c447e324d6451f1ca2f52287b580c4f9.tar.xz
usb: host: ohci: 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>
-rw-r--r--drivers/usb/host/ohci-hcd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 010ba35014..1d511b7563 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -43,6 +43,7 @@
#include <common.h>
#include <dma.h>
#include <clock.h>
+#include <dma.h>
#include <malloc.h>
#include <usb/usb.h>
#include <usb/usb_defs.h>
@@ -52,7 +53,6 @@
#include <asm/byteorder.h>
#include <io.h>
-#include <asm/mmu.h>
#include "ohci.h"
@@ -857,7 +857,7 @@ static void td_fill(struct ohci *ohci, unsigned int info,
td->hwNextTD = virt_to_phys((void *)m32_swap((unsigned long)td_pt));
- dma_flush_range((unsigned long)data, (unsigned long)(data + len));
+ dma_sync_single_for_device((unsigned long)data, len, DMA_BIDIRECTIONAL);
/* append to queue */
td->ed->hwTailP = td->hwNextTD;
@@ -1093,7 +1093,8 @@ static int dl_done_list(struct ohci *ohci)
unsigned long ptdphys = virt_to_phys(ptd);
struct td *td_list;
- dma_clean_range(ptdphys, ptdphys + (sizeof(struct td) * NUM_TD));
+ dma_sync_single_for_device((unsigned long)ptdphys,
+ sizeof(struct td) * NUM_TD, DMA_BIDIRECTIONAL);
td_list = dl_reverse_done_list(ohci);
@@ -1529,7 +1530,8 @@ static int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *b
dev->status = stat;
dev->act_len = urb->actual_length;
- dma_inv_range((unsigned long)buffer, (unsigned long)(buffer + transfer_len));
+ dma_sync_single_for_cpu((unsigned long)buffer, transfer_len,
+ DMA_BIDIRECTIONAL);
pkt_print(urb, dev, pipe, buffer, transfer_len,
setup, "RET(ctlr)", usb_pipein(pipe));