From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Fri, 19 Jun 2015 15:07:04 +0200 Subject: [U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling In-Reply-To: <201506191435.48863.marex@denx.de> References: <1434278413-21157-1-git-send-email-hdegoede@redhat.com> <201506191435.48863.marex@denx.de> Message-ID: <558413F8.1060607@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 19-06-15 14:35, Marek Vasut wrote: > On Sunday, June 14, 2015 at 12:40:11 PM, Hans de Goede wrote: >> 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. > > Hi, > > do you want me to pick this via u-boot-usb/master ? No, I've already send a pull-req for them via u-boot-sunxi/master and they are already merged :) Regards, Hans