Title: [3896] trunk/drivers/usb/musb: [#3220] enable USB OTG Host controller
Revision
3896
Author
cooloney
Date
2007-11-19 03:30:43 -0600 (Mon, 19 Nov 2007)

Log Message

[#3220] enable USB OTG Host controller

 - fix one data toggle bug in the MUSB OTG host code (should check with upstream maintainers)
 - tested with Full-Speed and High-Speed USB mass storage flash disk

Diffstat

 blackfin.c  |    2 +-
 musb_core.c |    1 +
 musb_host.c |   25 ++++++++-----------------
 3 files changed, 10 insertions(+), 18 deletions(-)

Modified Paths

Diff

Modified: trunk/drivers/usb/musb/blackfin.c (3895 => 3896)


--- trunk/drivers/usb/musb/blackfin.c	2007-11-19 01:43:19 UTC (rev 3895)
+++ trunk/drivers/usb/musb/blackfin.c	2007-11-19 09:30:43 UTC (rev 3896)
@@ -34,7 +34,7 @@
 #include "musb_core.h"
 #include "blackfin.h"
 
-#undef CONFIG_BLACKFIN_USB_DMA
+#define CONFIG_BLACKFIN_USB_DMA
 
 static struct otg_transceiver *xceiv;
 

Modified: trunk/drivers/usb/musb/musb_core.c (3895 => 3896)


--- trunk/drivers/usb/musb/musb_core.c	2007-11-19 01:43:19 UTC (rev 3895)
+++ trunk/drivers/usb/musb/musb_core.c	2007-11-19 09:30:43 UTC (rev 3896)
@@ -1457,6 +1457,7 @@
 	musb->endpoints[0].max_packet_sz_rx = MUSB_EP0_FIFOSIZE;
 #ifdef CONFIG_BLACKFIN
 	musb->endpoints[0].is_shared_fifo = true;
+	musb->is_multipoint = 0;
 #endif
 
 	/* discover endpoint configuration */

Modified: trunk/drivers/usb/musb/musb_host.c (3895 => 3896)


--- trunk/drivers/usb/musb/musb_host.c	2007-11-19 01:43:19 UTC (rev 3895)
+++ trunk/drivers/usb/musb/musb_host.c	2007-11-19 09:30:43 UTC (rev 3896)
@@ -594,7 +594,12 @@
 			WARN("rx%d, packet/%d ready?\n", ep->epnum,
 				musb_readw(ep->regs, MUSB_RXCOUNT));
 
+#ifdef CONFIG_BLACKFIN
+		musb_h_flush_rxfifo(ep, 0);
+#else
 		musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
+#endif
+
 	}
 
 	/* target addr and (for multipoint) hub addr/port */
@@ -616,10 +621,6 @@
 	/* NOTE: bulk combining rewrites high bits of maxpacket */
 	musb_writew(ep->regs, MUSB_RXMAXP, qh->maxpacket);
 
-	printk("MUSB_RXTYPE 0x%04x\n", musb_readb(ep->regs, MUSB_RXTYPE));
-	printk("MUSB_RXINTERVAL 0x%04x\n", musb_readb(ep->regs, MUSB_RXINTERVAL));
-	printk("MUSB_RXMAXP 0x%04x\n", musb_readw(ep->regs, MUSB_RXMAXP));
-
 	ep->rx_reinit = 0;
 }
 
@@ -706,8 +707,10 @@
 					qh->epnum, 1))
 				csr |= MUSB_TXCSR_H_WR_DATATOGGLE
 					| MUSB_TXCSR_H_DATATOGGLE;
+#ifndef CONFIG_BLACKFIN
 			else
 				csr |= MUSB_TXCSR_CLRDATATOG;
+#endif
 
 			/* twice in case of double packet buffering */
 			musb_writew(epio, MUSB_TXCSR, csr);
@@ -939,11 +942,6 @@
 		DBG(7, "RXCSR%d := %04x\n", epnum, csr);
 		musb_writew(hw_ep->regs, MUSB_RXCSR, csr);
 		csr = musb_readw(hw_ep->regs, MUSB_RXCSR);
-
-		printk("MUSB_RXCSR%d := %04x\n", epnum, csr);
-		printk("MUSB_RXTYPE 0x%04x\n", musb_readb(hw_ep->regs, MUSB_RXTYPE));
-		printk("MUSB_RXINTERVAL 0x%04x\n", musb_readb(hw_ep->regs, MUSB_RXINTERVAL));
-		printk("MUSB_RXMAXP 0x%04x\n", musb_readw(hw_ep->regs, MUSB_RXMAXP));
 	}
 }
 
@@ -1972,14 +1970,7 @@
 	unsigned long		flags;
 	int			status = -ENOENT;
 
-	int epnum = usb_pipeendpoint(urb->pipe);
-	struct musb_hw_ep	*hw_ep = musb->endpoints + epnum;
-	void __iomem		*epio = hw_ep->regs;
-
-	musb_ep_select(musb->mregs, epnum);
-	printk("epio %p, RXCSR 0x%04x, RXCOUNT 0x%04x\n", epio, musb_readw(epio, MUSB_RXCSR), musb_readw(epio, MUSB_RXCOUNT));
-
-	printk("urb=%p, dev%d ep%d%s\n", urb,
+	DBG(4, "urb=%p, dev%d ep%d%s\n", urb,
 			usb_pipedevice(urb->pipe),
 			usb_pipeendpoint(urb->pipe),
 			usb_pipein(urb->pipe) ? "in" : "out");
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to