[U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling
Maxime Ripard
maxime.ripard at free-electrons.com
Sun Jun 28 22:42:21 CEST 2015
On Fri, Jun 26, 2015 at 01:01:12PM +0200, Hans de Goede wrote:
> Hi,
>
> On 26-06-15 12:20, Maxime Ripard wrote:
> >Hi,
> >
> >On Sun, Jun 14, 2015 at 12:40:11PM +0200, Hans de Goede wrote:
> >>Paul, can you test these with gadget mode? Specifically if they help the
> >>problem you were seeing when switching roles?
> >>
> >>Also this bit from the kernel code for the sunxi glue may be relevant
> >>to your problems:
> >>
> >> if ((musb->int_usb & MUSB_INTR_RESET) && !is_host_active(musb)) {
> >> /* ep0 FADDR must be 0 when (re)entering peripheral mode */
> >> musb_ep_select(musb->mregs, 0);
> >> musb_writeb(musb->mregs, MUSB_FADDR, 0);
> >> }
> >>
> >>This is from the interrupt handler in the sunxi-musb glue in the kernel,
> >>maybe we can do the same, and/or maybe we need to do:
> >>
> >> /* ep0 FADDR must be 0 when (re)entering peripheral mode */
> >> musb_ep_select(musb->mregs, 0);
> >> musb_writeb(musb->mregs, MUSB_FADDR, 0);
> >>
> >> From sunxi_musb_disable?
> >
> >So, I was affected by this issue on a SinA33, even when not switching
> >roles (since the SinA33 is peripheral only). The issue I was seeing
> >what that when I was two subsequent use of any gadget (fastboot, USB
> >ethernet traffic), the second would silently fail on U-boot side with
> >the host failing to enumerate the device.
> >
> >Paul pointed me to that thread, and your suggestion on EP0 seems like
> >a good lead, since the ugly http://pastebin.com/9Y6S9Hpw makes it work.
>
> Ah, that is not that ugly actually, I can take that as is if you want me
> too just submit it to the u-boot list with me in the Cc and I'll pick it
> up and put it in u-boot-sunxi/next
I don't know, it felt quick and dirty while doing it :)
I haven't tested it with host though, so you'll probably want to give
that a test run, I'll submit it some time this week.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150628/78cc1cca/attachment.sig>
More information about the U-Boot
mailing list