Title: [3966] trunk/drivers/usb/musb/blackfin.c: [#2424] For now have BF54x sue busy waiting DMA and BF52x use insw and outsw
Revision
3966
Author
hennerich
Date
2007-11-30 07:07:13 -0600 (Fri, 30 Nov 2007)

Log Message

[#2424] For now have BF54x sue busy waiting DMA and BF52x use insw and outsw

Diffstat

 blackfin.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

Modified Paths

Diff

Modified: trunk/drivers/usb/musb/blackfin.c (3965 => 3966)


--- trunk/drivers/usb/musb/blackfin.c	2007-11-30 07:26:25 UTC (rev 3965)
+++ trunk/drivers/usb/musb/blackfin.c	2007-11-30 13:07:13 UTC (rev 3966)
@@ -89,7 +89,7 @@
 #define dump_fifo_data(buf, len)	do{} while (0)
 #endif
 
-#ifdef CONFIG_MUSB_PIO_ONLY
+#if defined(CONFIG_BF54x)
 
 #define USB_DMA_BASE		USB_DMA_INTERRUPT
 #define USB_DMAx_CTRL		0x04
@@ -122,7 +122,7 @@
 
 	dump_fifo_data(src, len);
 
-#ifdef CONFIG_MUSB_PIO_ONLY
+#if defined(CONFIG_BF54x)
 	flush_dcache_range((unsigned int)src,
 		(unsigned int)(src + len));
 
@@ -157,6 +157,7 @@
 	bfin_write16(USB_DMA_REG(epnum, USB_DMAx_CTRL), 0);
 	SSYNC();
 #else
+#if (0)
 	/* we can't assume unaligned reads work */
 	if (likely((0x01 & (u16) src) == 0)) {
 		data = "" *) src;
@@ -187,7 +188,12 @@
 		}
 	}
 	SSYNC();
+#else
+	BUG_ON((unsigned long)src & 0x01);
+	outsw(fifo, src, len & 0x01 ? (len >> 1) + 1 : len >> 1);
 #endif
+
+#endif
 }
 
 /*
@@ -204,7 +210,7 @@
 	DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
 			'R', hw_ep->epnum, fifo, len, dst);
 
-#ifdef CONFIG_MUSB_PIO_ONLY
+#if defined(CONFIG_BF54x)
 	invalidate_dcache_range((unsigned int)dst,
 		(unsigned int)(dst + len));
 
@@ -240,6 +246,7 @@
 	SSYNC();
 #else
 	/* we can't assume unaligned writes work */
+#if (0)
 	if (likely((0x01 & (unsigned long) dst) == 0)) {
 		data = "" *) dst;
 
@@ -260,8 +267,13 @@
 		readsb(fifo, dst, len);
 	}
 	SSYNC();
+#else
+	BUG_ON((unsigned long)dst & 0x01);
+	insw(fifo, dst, len & 0x01 ? (len >> 1) + 1 : len >> 1);
 #endif
 
+#endif
+
 	dump_fifo_data(dst, len);
 }
 
@@ -392,7 +404,7 @@
 	bfin_write_USB_PLLOSC_CTRL(0x30a8);
 	SSYNC();
 
-	bfin_write_USB_SRP_CLKDIV(4061);
+	bfin_write_USB_SRP_CLKDIV((get_sclk()/1000) / 32 - 1);
 	SSYNC();
 
 	bfin_write_USB_EP_NI0_RXMAXP(64);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to