Commit 41b4a7df authored by supriya karanth's avatar supriya karanth Committed by Greg Kroah-Hartman

usb: musb: set TXMAXP and AUTOSET for full speed bulk in device mode

commit bb3a2ef2 upstream.

The TXMAXP register is not set correctly for full speed bulk case
when the can_bulk_split() is used. Without this PIO transfers will
not take place correctly

The "mult" factor needs to be updated correctly for the
can_bulk_split() case

The AUTOSET bit in the TXCSR is not being set if the "mult"
factor is greater than 0 for the High Bandwidth ISO case.
But the "mult" factor is also greater than 0 in case of Full speed
bulk transfers with the packet splitting in TXMAXP register

Without the AUTOSET the DMA transfers will not progress in mode1

[ balbi@ti.com : add braces to both branches ]
Signed-off-by: default avatarsupriya karanth <supriya.karanth@stericsson.com>
Signed-off-by: default avatarPraveena NADAHALLY <praveen.nadahally@stericsson.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Cc: ian coolidge <iancoolidge@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 15e5f90c
...@@ -401,7 +401,19 @@ static void txstate(struct musb *musb, struct musb_request *req) ...@@ -401,7 +401,19 @@ static void txstate(struct musb *musb, struct musb_request *req)
csr |= (MUSB_TXCSR_DMAENAB csr |= (MUSB_TXCSR_DMAENAB
| MUSB_TXCSR_DMAMODE | MUSB_TXCSR_DMAMODE
| MUSB_TXCSR_MODE); | MUSB_TXCSR_MODE);
if (!musb_ep->hb_mult) /*
* Enable Autoset according to table
* below
* bulk_split hb_mult Autoset_Enable
* 0 0 Yes(Normal)
* 0 >0 No(High BW ISO)
* 1 0 Yes(HS bulk)
* 1 >0 Yes(FS bulk)
*/
if (!musb_ep->hb_mult ||
(musb_ep->hb_mult &&
can_bulk_split(musb,
musb_ep->type)))
csr |= MUSB_TXCSR_AUTOSET; csr |= MUSB_TXCSR_AUTOSET;
} }
csr &= ~MUSB_TXCSR_P_UNDERRUN; csr &= ~MUSB_TXCSR_P_UNDERRUN;
...@@ -1100,11 +1112,15 @@ static int musb_gadget_enable(struct usb_ep *ep, ...@@ -1100,11 +1112,15 @@ static int musb_gadget_enable(struct usb_ep *ep,
/* Set TXMAXP with the FIFO size of the endpoint /* Set TXMAXP with the FIFO size of the endpoint
* to disable double buffering mode. * to disable double buffering mode.
*/ */
if (musb->double_buffer_not_ok) if (musb->double_buffer_not_ok) {
musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx); musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx);
else } else {
if (can_bulk_split(musb, musb_ep->type))
musb_ep->hb_mult = (hw_ep->max_packet_sz_tx /
musb_ep->packet_sz) - 1;
musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz
| (musb_ep->hb_mult << 11)); | (musb_ep->hb_mult << 11));
}
csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG; csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG;
if (musb_readw(regs, MUSB_TXCSR) if (musb_readw(regs, MUSB_TXCSR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment