[U-Boot] [PATCH 1/1] [rfc] usb: musb: some more Blackfin stuff
Mike Frysinger
vapier at gentoo.org
Mon Jan 18 02:51:40 CET 2010
From: Bryan Wu <bryan.wu at analog.com>
any thoughts on how to generalize this ?
Signed-off-by: Bryan Wu <bryan.wu at analog.com>
Signed-off-by: Cliff Cai <cliff.cai at analog.com>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
drivers/usb/musb/musb_hcd.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
index 040ac8a..7fcf803 100644
--- a/drivers/usb/musb/musb_hcd.c
+++ b/drivers/usb/musb/musb_hcd.c
@@ -143,7 +143,11 @@ static void write_toggle(struct usb_device *dev, u8 ep, u8 dir_out)
if (dir_out) {
if (!toggle)
+#ifdef CONFIG_USB_BLACKFIN
+ writew(0, &musbr->txcsr);
+#else
writew(MUSB_TXCSR_CLRDATATOG, &musbr->txcsr);
+#endif
else {
csr = readw(&musbr->txcsr);
csr |= MUSB_TXCSR_H_WR_DATATOGGLE;
@@ -153,7 +157,11 @@ static void write_toggle(struct usb_device *dev, u8 ep, u8 dir_out)
}
} else {
if (!toggle)
+#ifdef CONFIG_USB_BLACKFIN
+ writew(0, &musbr->rxcsr);
+#else
writew(MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
+#endif
else {
csr = readw(&musbr->rxcsr);
csr |= MUSB_RXCSR_H_WR_DATATOGGLE;
@@ -899,6 +907,13 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
dev->status = 0;
dev->act_len = len;
+
+#ifdef CONFIG_USB_BLACKFIN
+ /* Set device address to USB_FADDR register */
+ if (setup->request == USB_REQ_SET_ADDRESS)
+ writew(dev->devnum, &musbr->faddr);
+#endif
+
return len;
}
@@ -969,6 +984,11 @@ int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
nextlen = ((len-txlen) < dev->epmaxpacketout[ep]) ?
(len-txlen) : dev->epmaxpacketout[ep];
+#ifdef CONFIG_USB_BLACKFIN
+ /* Set the transfer data size */
+ writew(nextlen, &musbr->txcount);
+#endif
+
/* Write the data to the FIFO */
write_fifo(MUSB_BULK_EP, nextlen,
(void *)(((u8 *)buffer) + txlen));
--
1.6.6
More information about the U-Boot
mailing list