From 410268583a8caf3d3ef1eee9fa3f23f0802d4480 Mon Sep 17 00:00:00 2001 From: Cliff Cai Date: Thu, 28 Jan 2010 20:44:18 -0500 Subject: [PATCH] --- yaml --- r: 185381 b: refs/heads/master c: 9f445cb29918dc488b7a9a92ef018599cce33df7 h: refs/heads/master i: 185379: 6920c88f2fc0b391fec740a43e0bcc8de38370fe v: v3 --- [refs] | 2 +- trunk/drivers/usb/musb/musb_gadget.c | 17 +++++++++++++++-- trunk/drivers/usb/musb/musb_host.c | 10 ++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 9f478da09eaa..689945ca79ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0ded2f146acfaf71e5f4c15b80cf89b3af48134c +refs/heads/master: 9f445cb29918dc488b7a9a92ef018599cce33df7 diff --git a/trunk/drivers/usb/musb/musb_gadget.c b/trunk/drivers/usb/musb/musb_gadget.c index cbcf14a236e6..41de3a903152 100644 --- a/trunk/drivers/usb/musb/musb_gadget.c +++ b/trunk/drivers/usb/musb/musb_gadget.c @@ -895,7 +895,14 @@ static int musb_gadget_enable(struct usb_ep *ep, /* REVISIT if can_bulk_split(), use by updating "tmp"; * likewise high bandwidth periodic tx */ - musb_writew(regs, MUSB_TXMAXP, tmp); + /* Set TXMAXP with the FIFO size of the endpoint + * to disable double buffering mode. Currently, It seems that double + * buffering has problem if musb RTL revision number < 2.0. + */ + if (musb->hwvers < MUSB_HWVERS_2000) + musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); + else + musb_writew(regs, MUSB_TXMAXP, tmp); csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; if (musb_readw(regs, MUSB_TXCSR) @@ -925,7 +932,13 @@ static int musb_gadget_enable(struct usb_ep *ep, /* REVISIT if can_bulk_combine() use by updating "tmp" * likewise high bandwidth periodic rx */ - musb_writew(regs, MUSB_RXMAXP, tmp); + /* Set RXMAXP with the FIFO size of the endpoint + * to disable double buffering mode. + */ + if (musb->hwvers < MUSB_HWVERS_2000) + musb_writew(regs, MUSB_RXMAXP, hw_ep->max_packet_sz_rx); + else + musb_writew(regs, MUSB_RXMAXP, tmp); /* force shared fifo to OUT-only mode */ if (hw_ep->is_shared_fifo) { diff --git a/trunk/drivers/usb/musb/musb_host.c b/trunk/drivers/usb/musb/musb_host.c index c3fdd6d69f5e..3421cf9858b5 100644 --- a/trunk/drivers/usb/musb/musb_host.c +++ b/trunk/drivers/usb/musb/musb_host.c @@ -605,8 +605,14 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) musb_writeb(ep->regs, MUSB_RXTYPE, qh->type_reg); musb_writeb(ep->regs, MUSB_RXINTERVAL, qh->intv_reg); /* NOTE: bulk combining rewrites high bits of maxpacket */ - musb_writew(ep->regs, MUSB_RXMAXP, - qh->maxpacket | ((qh->hb_mult - 1) << 11)); + /* Set RXMAXP with the FIFO size of the endpoint + * to disable double buffer mode. + */ + if (musb->hwvers < MUSB_HWVERS_2000) + musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx); + else + musb_writew(ep->regs, MUSB_RXMAXP, + qh->maxpacket | ((qh->hb_mult - 1) << 11)); ep->rx_reinit = 0; }