u-boot-brain/drivers/usb
Fabrice Gasnier 7fd9f31c6b usb: dwc2: fix gadget disconnect
This fixes a disconnect issue detected with fastboot command, when using
dwc2 driver.
- On u-boot side:
uboot>$ fastboot 0
- On USB host PC side, few seconds after
PC>$ fastboot reboot # Get stuck, uboot target never reboots

By enabling DEBUG_ISR logs, the bus suspend interrupt is seen before the
PC command has been issued. When the USB bus suspend occurs, there's a HACK
that disables the fastboot (composite driver). Here is the call stack
upon USB bus suspend:
- dwc2_handle_usb_suspend_intr()
  - dev->driver->disconnect()
    - composite_disconnect()
      - reset_config()
        - f->disable()
          - fastboot_disable()
            - usb_ep_disable(f_fb->out_ep);
            - usb_ep_disable(f_fb->in_ep);
            .. other disable calls.

When the resume interrupt happens, everything has been disabled, then
nothing happens. fastboot command gets stuck on HOST side.

Remove original HACK, that disconnects the composite driver upon
USB bus suspend. Implement disconnect detection instead:
- check GINTSTS OTG interrupt
- read GOTGINT register
- check GOTGINT, SesEndDet bit (e.g. session end)
This is inspired by what is implemented currently in Linux dwc2 driver.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2019-04-21 10:26:52 +02:00
..
common usb: Introduce CONFIG_SPL_DM_USB 2018-11-26 21:19:03 +01:00
dwc3 dwc3-generic: Add support for the am437x 2018-12-14 17:59:09 +01:00
emul SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
eth usb: composite: Move bitmap related operations to ./include/linux/bitmap.h 2018-12-14 17:59:08 +01:00
gadget usb: dwc2: fix gadget disconnect 2019-04-21 10:26:52 +02:00
host configs: move CONFIG_USB_EHCI_VF to Kconfig 2019-04-13 20:30:09 +02:00
musb usb: musb: Remove legacy CONFIG_USB_DA8XX 2018-12-14 17:59:09 +01:00
musb-new usb: Select USB_MUSB_DSPS with USB_MUSB_TI 2019-04-19 11:32:01 +02:00
phy SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ulpi SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Kconfig usb: Don't enable CONFIG_SPL_DM_USB for non-DM SPL 2018-12-14 17:59:08 +01:00