[U-Boot] [PATCH] usb: musb: only write CLRDATATOG when appropriate
Remy Bohmer
linux at bohmer.net
Thu Aug 12 20:04:00 CEST 2010
Hi,
2010/8/10 Mike Frysinger <vapier at gentoo.org>:
> On Tue, Aug 10, 2010 at 6:26 AM, Sergei Shtylyov wrote:
>> Mike Frysinger wrote:
>>> --- a/drivers/usb/musb/musb_hcd.c
>>> +++ b/drivers/usb/musb/musb_hcd.c
>>> } else {
>>> - if (!toggle)
>>> - writew(MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
>>> - else {
>>> + if (!toggle) {
>>> + csr = readw(&musbr->txcsr);
>>> + if (csr & MUSB_TXCSR_MODE)
>>> + csr = MUSB_RXCSR_CLRDATATOG;
>>
>> Clearing RXCSR when FIFO is in TX mode?
>
> unless i missed something, that is what Linux is doing.
Can Linux be wrong too?
> musb_host.c:musb_rx_reinit()
> csr = musb_readw(ep->regs, MUSB_RXCSR);
> if (csr & MUSB_RXCSR_RXPKTRDY)
> WARNING("rx%d, packet/%d ready?\n", ep->epnum,
> musb_readw(ep->regs, MUSB_RXCOUNT));
>
> csr = musb_readw(ep->regs, MUSB_TXCSR);
> if (csr & MUSB_TXCSR_MODE)
> musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
> else
> musb_h_flush_rxfifo(ep, 0);
>
> although i see that i need to also extend the MUSB_TXCSR_MODE define
> for Blackfin musb ports in u-boot. but this shouldnt affect
> non-Blackfin musb ports. i'll send a sep patch for that.
> -mike
>
Sergei, do you agree that I apply this patch?
Kind regards,
Remy
More information about the U-Boot
mailing list