public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling
@ 2015-06-14 10:40 Hans de Goede
  2015-06-14 10:40 ` [U-Boot] [PATCH 1/2] sunxi: musb: Do not fully reset the controler from sunxi_musb_disable Hans de Goede
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Hans de Goede @ 2015-06-14 10:40 UTC (permalink / raw)
  To: u-boot

Hi Ian, Paul,

Here is a patch to fix the problems where most usb devices will no longer
work after a "usb reset ", when connected to the otg controller in host
mode + a related cleanup patch.

Ian I would like to send out a PR with these 2 as fixed for v2015.07, can
you review them please? Note I've not tested this with the otg in gadget
mode, but we do not have gadget mode enabled by default anywhere atm, so
I still consider this suitable as a bugfix for v2015.07.

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?

From my experience sofar we should avoid doing a full reset from musb_stop /
sunxi_musb_disable as musb_init_controller never gets re-run, so doing a
full reset leaves things in a bad state where only ep0 still seems to work,
this may be what you were seeing before.

Regards,

Hans

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-06-28 20:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-14 10:40 [U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling Hans de Goede
2015-06-14 10:40 ` [U-Boot] [PATCH 1/2] sunxi: musb: Do not fully reset the controler from sunxi_musb_disable Hans de Goede
2015-06-14 11:46   ` Ian Campbell
2015-06-14 17:21     ` Hans de Goede
2015-06-14 10:40 ` [U-Boot] [PATCH 2/2] sunxi: musb: Remove unused sunxi_musb_exit method Hans de Goede
2015-06-14 11:47   ` Ian Campbell
2015-06-15 19:21 ` [U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling Paul Kocialkowski
2015-06-17 13:39   ` Hans de Goede
2015-06-19  9:11     ` Paul Kocialkowski
2015-06-19 12:35 ` Marek Vasut
2015-06-19 13:07   ` Hans de Goede
2015-06-19 13:08     ` Marek Vasut
2015-06-26 10:20 ` Maxime Ripard
2015-06-26 11:01   ` Hans de Goede
2015-06-28 20:42     ` Maxime Ripard
2015-06-26 11:02   ` Hans de Goede
2015-06-26 11:11     ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox