From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Fri, 13 Aug 2010 14:25:05 +0400 Subject: [U-Boot] [PATCH] usb: musb: only write CLRDATATOG when appropriate In-Reply-To: References: <1281380304-23544-1-git-send-email-vapier@gentoo.org> <4C612954.2060207@mvista.com> Message-ID: <4C651D81.2030004@mvista.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello. Remy Bohmer 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? I meant to say "clearing RX toggle". >> 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? Well, if it's based on the Linux code... although it still does look wrong... I don't know. :-) > Kind regards, > Remy WBR, Sergei