diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-09-09 11:35:35 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-09-09 11:51:18 +0200 |
commit | 38fb079e3fa9ec8f3a84576d62ebf906db53b743 (patch) | |
tree | 0af3f57106dcfaffee2b3db42d40524627825057 /drivers | |
parent | 721975ba22f48577b0eb129cff6daff30c3783f9 (diff) | |
download | barebox-38fb079e3fa9ec8f3a84576d62ebf906db53b743.tar.gz barebox-38fb079e3fa9ec8f3a84576d62ebf906db53b743.tar.xz |
usb ehci driver: Add MMU support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/usb_ehci_core.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/usb/usb_ehci_core.c b/drivers/usb/usb_ehci_core.c index 9e530e1be5..4163500cce 100644 --- a/drivers/usb/usb_ehci_core.c +++ b/drivers/usb/usb_ehci_core.c @@ -31,6 +31,7 @@ #include <xfuncs.h> #include <clock.h> #include <errno.h> +#include <asm/mmu.h> #include "usb_ehci.h" @@ -119,18 +120,18 @@ static struct descriptor { #define ehci_is_TDI() (0) #endif -#if defined(CONFIG_EHCI_DCACHE) +#ifdef CONFIG_MMU /* * Routines to handle (flush/invalidate) the dcache for the QH and qTD * structures and data buffers. This is needed on platforms using this * EHCI support with dcache enabled. */ -static void flush_invalidate(u32 addr, int size, int flush) +static void flush_invalidate(void *addr, int size, int flush) { if (flush) - flush_dcache_range(addr, addr + size); + dma_flush_range(addr, addr + size); else - invalidate_dcache_range(addr, addr + size); + dma_inv_range(addr, addr + size); } static void cache_qtd(struct qTD *qtd, int flush) @@ -138,9 +139,9 @@ static void cache_qtd(struct qTD *qtd, int flush) u32 *ptr = (u32 *)qtd->qt_buffer[0]; int len = (qtd->qt_token & 0x7fff0000) >> 16; - flush_invalidate((u32)qtd, sizeof(struct qTD), flush); + flush_invalidate(qtd, sizeof(struct qTD), flush); if (ptr && len) - flush_invalidate((u32)ptr, len, flush); + flush_invalidate(ptr, len, flush); } @@ -159,8 +160,7 @@ static void cache_qh(struct QH *qh, int flush) * Walk the QH list and flush/invalidate all entries */ while (1) { - printf("huhu\n"); - flush_invalidate((u32)qh_addr(qh), sizeof(struct QH), flush); + flush_invalidate(qh_addr(qh), sizeof(struct QH), flush); if ((u32)qh & QH_LINK_TYPE_QH) break; qh = qh_addr(qh); @@ -181,7 +181,6 @@ static void cache_qh(struct QH *qh, int flush) * Walk the qTD list and flush/invalidate all entries */ while (1) { - printf("haha\n"); if (qtd == NULL) break; cache_qtd(qtd, flush); @@ -201,7 +200,7 @@ static inline void ehci_invalidate_dcache(struct QH *qh) { cache_qh(qh, 0); } -#else /* CONFIG_EHCI_DCACHE */ +#else /* CONFIG_MMU */ /* * */ @@ -212,7 +211,7 @@ static inline void ehci_flush_dcache(struct QH *qh) static inline void ehci_invalidate_dcache(struct QH *qh) { } -#endif /* CONFIG_EHCI_DCACHE */ +#endif /* CONFIG_MMU */ static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec) { |