On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG micro-B plug with ID and VBUS detection), the USB OTG port only works if a micro-B device (e.g. a USB stick) is plugged in first. Once this is done, both micro-B device and host (e.g. a PC via a USB A-to-microB cable) are correctly detected and recognized. If a USB host is plugged in first (e.g. a PC), then the PC does not detect the STM32MP1 at all. By running the core connect code in dwc2_hcd_init(), both device and host are detected and the USB works as expected. However, it is not clear whether this is the correct solution. Signed-off-by: Marek Vasut <marex@xxxxxxx> Cc: Amelie Delaunay <amelie.delaunay@xxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> Cc: Minas Harutyunyan <hminas@xxxxxxxxxxxx> To: linux-usb@xxxxxxxxxxxxxxx --- drivers/usb/dwc2/hcd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index b90f858af960..ead605efeb24 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -5237,6 +5237,11 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) dwc2_enable_global_interrupts(hsotg); + dwc2_hsotg_core_init_disconnected(hsotg, false); + /* Enable ACG feature in device mode,if supported */ + dwc2_enable_acg(hsotg); + dwc2_hsotg_core_connect(hsotg); + return 0; error4: -- 2.25.1