[U-Boot] [PATCH] usb: musb: only write CLRDATATOG when appropriate

Mike Frysinger vapier at gentoo.org
Tue Aug 10 22:37:30 CEST 2010


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.

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


More information about the U-Boot mailing list