On 4/17/20 11:00 AM, Minas Harutyunyan wrote: > Hi, Hi, > On 4/16/2020 6:31 PM, Marek Vasut wrote: >> On 4/16/20 3:37 PM, Minas Harutyunyan wrote: > >>> Or instead of patch, if you have any utility in system which will allow >>> from command line clear soft disconnect bit from DCTL register? Offset >>> of DCTL register is 0x804. SoftDiscon bit number is 1. Clear this bit >>> and then plug cable. >> >> Clearing that bit with devmem allows the host PC to detect some >> high-speed device got connected, but that's it, it does not detect it as >> a gadget and no communication really happens. >> > > Please provide part of debug log on above mentioned scenario. ~ # devmem 0x49000804 0x00000002 ~ # devmem 0x49000804 w 0 [ 38.420954] dwc2 49000000.usb-otg: gintsts=04008c20 gintmsk=d8000806 [ 38.425950] dwc2 49000000.usb-otg: USB SUSPEND [ 38.430395] dwc2 49000000.usb-otg: dwc2_handle_usb_suspend_intr: DSTS=0x400003 [ 38.437630] dwc2 49000000.usb-otg: DSTS.Suspend Status=1 HWCFG4.Power Optimize=1 HWCFG4.Hibernation=0 [ 38.446866] dwc2 49000000.usb-otg: ignore suspend request before enumeration [ 38.453934] dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04008420 00000000 (d8000806) retry 8 ~ # devmem 0x49000804 0x00000000 cable is plugged in below [ 50.224271] dwc2 49000000.usb-otg: gintsts=44008420 gintmsk=d8000806 [ 50.229268] dwc2 49000000.usb-otg: Session request interrupt - lx_state=0 [ 50.236072] dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04008420 00000000 (d8000806) retry 8 [ 50.292232] dwc2 49000000.usb-otg: gintsts=04008c20 gintmsk=d8000806 [ 50.297219] dwc2 49000000.usb-otg: USB SUSPEND [ 50.301666] dwc2 49000000.usb-otg: dwc2_handle_usb_suspend_intr: DSTS=0x400003 [ 50.308902] dwc2 49000000.usb-otg: DSTS.Suspend Status=1 HWCFG4.Power Optimize=1 HWCFG4.Hibernation=0 [ 50.318141] dwc2 49000000.usb-otg: ignore suspend request before enumeration [ 50.325209] dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04008420 00000000 (d8000806) retry 8 >>> Unfortunately, currently I'm working from home and can't remotely >>> connect/disconnect cable in lab to try to reproduce observed by you issue. >> >> Maybe you should consider using something like this in the lab: >> https://urldefense.com/v3/__https://www.ti.com/product/TS3USB30__;!!A4F2R9G_pg!O9sBVS3qah9rW57ccw0cT_8vz5fw0Ku3K_ZtNLuL2LNez4_AGF6wP2ZoKY2NF7yZ2vEfjmdg$ >> > Thanks for advise. I'll buy and setup multiplexer later, because > currently I'm on quarantine and can't visit office. Sure, hope it helps. >> [...] >> >> dwc2 49000000.usb-otg: mapped PA 49000000 to VA 473352f1 >> dwc2 49000000.usb-otg: mapped PA 49000000 to VA 923761cb >> dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator >> dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator >> dwc2 49000000.usb-otg: registering common handler for irq48 >> dwc2 49000000.usb-otg: dwc2_core_reset() >> dwc2 49000000.usb-otg: Core Release: 3.30a (snpsid=4f54330a) >> dwc2 49000000.usb-otg: Forcing mode to host >> dwc2 49000000.usb-otg: Waiting for host mode >> dwc2 49000000.usb-otg: Host mode set >> dwc2 49000000.usb-otg: Forcing mode to device >> dwc2 49000000.usb-otg: Waiting for device mode >> dwc2 49000000.usb-otg: Device mode set >> dwc2 49000000.usb-otg: Clearing force mode bits >> dwc2 49000000.usb-otg: NonPeriodic TXFIFO size: 32 >> dwc2 49000000.usb-otg: RXFIFO size: 256 >> dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM > >> dwc2 49000000.usb-otg: bound driver zero >> dwc2 49000000.usb-otg: dwc2_hsotg_pullup: is_on: 1 op_state: 0 > >> dwc2 49000000.usb-otg: DCFG=0x08100000, DCTL=0x00000002, DIEPMSK=00000000 >> dwc2 49000000.usb-otg: GAHBCFG=0x00000000, GHWCFG1=0x00000000 >> dwc2 49000000.usb-otg: GRXFSIZ=0x00000400, GNPTXFSIZ=0x04000400 >> dwc2 49000000.usb-otg: DPTx[1] FSize=1024, StAddr=0x00000800 >> dwc2 49000000.usb-otg: DPTx[2] FSize=1024, StAddr=0x00000c00 > > Do you use zero gadget? Yes > Pay attention that bounding function driver and > pullup set to 1 much earlier than core/dwc2 finished initialization. > Can you modprobe zero gadget after dwc2 fully initialized? I have the zero gadget compiled into the kernel, I would expect that should work too, right ?