Re: Enabling Device DWC3 Device Mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello list and Ran,

Well, the error I saw in dmesg about an unassignable address is something
I had only seen one other time when a device was miswired. I flipped the
USB-C connector over and it started working in USB3 ports, but at USB2
speeds. I thought of this days ago but figured the port should be handling it...

On Windows the system reports a bad setup, so I think my SS descriptors
are malformed. I'm using functionfs. I'll start a separate thread on this. On
Linux the device connects as USB2 instead of reporting an error.

If I use the NCM/ECM configfs driver debugging tools in Windows show me
that the port is superspeed capable though registered as HS. Patches hit the
list to fix this only a few days ago. Hooray!

It seems I may be able to select device mode by writing to nodes in
/sys/class/typec/port0. But I am still not sure.

On Sun, Sep 20, 2020, at 8:20 PM, Ran Wang wrote:
> Hi Sid,
> 
> > -----Original Message-----
> > From: Sid Spry <sid@xxxxxxx>
> > Sent: Saturday, September 19, 2020 1:59 PM
> > To: Ran Wang <ran.wang_1@xxxxxxx>
> > Cc: linux-usb@xxxxxxxxxxxxxxx
> > Subject: Re: Enabling Device DWC3 Device Mode
> > 
> > Hello list and Ran, I've some more observations. Firstly, I have to set the dwc3
> > mode to peripheral directly. Checking the code I was unable to find what
> > actually allows you to select the mode if specifying OTG.
> 
> Yeah, I also think debugging on peripheral firstly would be easier than OTG.
> 
> > I have devices in /sys/class/udc and they function properly via configfs when
> > plugged into a USB2 only port. If I plug them into a superspeed port I get
> > nothing in dmesg on the host side. At first, I did get a response on the host, in
> > the form of:
> 
> So the gadget registration for DWC3 UDC encountered no error, right?
> dwc3_core_init_mode()->dwc3_gadget_init()->usb_add_gadget_udc() return 0?
> If yes, it looks like SoC internal configuring has no big issue, I think.
> 
> > [591550.770819] usb 1-1.2: new full-speed USB device number 76 using
> > xhci_hcd [591550.870962] usb 1-1.2: device descriptor read/64, error -32
> > [591551.078865] usb 1-1.2: device descriptor read/64, error -32
> > [591551.286875] usb 1-1.2: new full-speed USB device number 77 using
> > xhci_hcd [591551.386873] usb 1-1.2: device descriptor read/64, error -32
> > [591551.594859] usb 1-1.2: device descriptor read/64, error -32
> > [591551.703160] usb 1-1-port2: attempt power cycle
> 
> For the speed issue (expect SS but got FS), you could try adding below 
> property to dwc3 node,
> On our platform this is necessary (see dwc3_gadget_set_speed()):
> 
> maximum-speed = "super-speed";
> 

For anyone following along I did implement this. It may be necessary. I will
see later.

> If the get descriptor read issue still happen with above change, maybe 
> you need to check PHY status,
> or using protocol-analyzer to see what happen on bus.
> 
> > However now I get no driver activity when binding the UDC in configfs or
> > loading or unloading the respective modules. Kernel is 5.7.15 w/ patches.
> > 
> > It doesn't seem like a fried the port or tripped a polyfuse, the port still works
> > after attempting USB3 device mode.
> 
> How about dr_mode="host"? Does it work? I think it would help to verify 
> your HW is good to go (such as PHY at least).
> 

It seems to work, the issue is that the hardware isn't handling the reversible
connector properly.

Cheers.



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux