This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DWC3 device mode not working always

Hi,

We are using DesignWare USB3 DRD core revision 0x183A for out custom OMAP5432 ES1.0 target The core is configured in device mode by default.

We made use of the below git and ported the same to our kernel to get the device mode working (partially).

 http://git.omapzoom.org/?p=kernel/omap.git;a=shortlog;h=refs/heads/p-ti-android-3.8.y-av-wip-final

Problem: When the DWC3 core is configured in default gadget mode, it does not get enumerated everytime when connected to a host. It gets enumerated/detected on host every alternate times of connection to the host. That is, first time it’s not enumerated when connected to the host, second time when reconnected to the host it gets detected and enumerated at host, and so on.

 It is seen that we only get link state change events for Rx.Detect and Suspend(U3) and never goes to normal state in non working conditions. We also never get a USB reset and/or connection done events in this case.

What could be going wrong in this case?

 In our case, we are using gadget zero (g_zero) driver for the testing purpose.

Logs are as follows:

During startup ---->

[ 0.532928] omap-dwc3 omap-dwc3: UNKNOWN utmi mode -284934632
[ 0.532958] omap-dwc3 omap-dwc3: IDPULLUP Rise
[ 1.735748] dwc3 dwc3.0: No power optimization available
[ 1.735778] dwc3 dwc3.0: Event buf ffdff000 dma ef1c3000 length 4096
[ 1.735809] omap-dwc3 omap-dwc3: IDPULLUP Fall
[ 1.897308] udc dwc3.0: registering UDC driver [zero]
[ 1.906768] dwc3 dwc3.0: ep0out: cmd 'Start New Configuration' params 00000000 00000000 00000000
[ 1.906768] dwc3 dwc3.0: Command Complete --> 0
[ 1.906799] dwc3 dwc3.0: ep0out: cmd 'Set Endpoint Configuration' params 00001000 00000500 00000000
[ 1.906799] dwc3 dwc3.0: Command Complete --> 0
[ 1.906829] dwc3 dwc3.0: ep0out: cmd 'Set Endpoint Transfer Resource' params 00000001 00000000 00000000
[ 1.906829] dwc3 dwc3.0: Command Complete --> 0
[ 1.906860] dwc3 dwc3.0: ep0in: cmd 'Set Endpoint Configuration' params 00001000 02000500 00000000
[ 1.906860] dwc3 dwc3.0: Command Complete --> 0
[ 1.906890] dwc3 dwc3.0: ep0in: cmd 'Set Endpoint Transfer Resource' params 00000001 00000000 00000000
[ 1.906890] dwc3 dwc3.0: Command Complete --> 0
[ 1.906921] dwc3 dwc3.0: ep0out: cmd 'Start Transfer' params 00000000 ef0c2000 00000000
[ 1.906921] dwc3 dwc3.0: Command Complete --> 0
[ 1.906951] dwc3 dwc3.0: gadget zero data soft-connect

 After Connecting to a host --->

[ 35.290100] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5
[ 35.388641] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 0
[ 35.391632] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5
[ 35.394622] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 3
[ 51.033111] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5
[ 51.036102] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 3
[ 51.283020] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5
[ 51.286041] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 3
[ 51.532806] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5
[ 51.535827] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 3
[ 51.782501] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5
[ 51.785491] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 3
[ 52.032135] dwc3 dwc3.0: dwc3_gadget_linksts_change_interrupt link 5

Any input will be really helpful.

Thanks and Regards,

Nikhil Rao.