Linux USB
 help / color / mirror / Atom feed
* Use device tree to disable U1/U2 in gadget devices based on DWC3
@ 2019-04-24 16:26 Claus H. Stovgaard
  2019-04-24 18:33 ` Alan Stern
  0 siblings, 1 reply; 7+ messages in thread
From: Claus H. Stovgaard @ 2019-04-24 16:26 UTC (permalink / raw)
  To: balbi@kernel.org
  Cc: linux-usb@vger.kernel.org, mnarani@xilinx.com, Michal Simek

Hi Balbi and other USB developers.

I am developing camera devices based on Xilinx ZynqMP, using the gadget framework and the build-in dwc3 core of the ZynqMP as USB3 controller and the build-in Cirrus SERDES as phy.
Testing with a number of hosts and Windows 7, has shown sporadic reconnects when leaving U2/U1, caused by failing link training, where the host resets the bus. Sometime it also means it reconnect via USB2.

So to overcome this, I will like to have the option for disabling U1/U2 on the core when working with those hosts.

Currently I have made a hack in ep0.c  where I return EINVAL in dwc3_ep0_handle_u1 and dwc3_ep0_handle_u2 together with not setting DWC3_DCTL_ACCEPTU1ENA and DWC3_DCTL_ACCEPTU2ENA in dwc3_ep0_set_config
Will though prefer a solution possible to upstream, so was thinking about adding two devicetree bindings.

* snps,u1_disable_as_gadget: When set the core will not enable U1 if requested from host, nor initiate U1.
* snps,u2_disable_as_gadget: When set the core will not enable U2 if requested from host, nor initiate U2.

If you think this might be something which can be upstreamed I will prepare the code and send a patch for discussion.
On the other hand, if you think that disabling U1/U2 via device tree as suggested should not be a feature no need for me to try making it a feature.

Kind regards / Med venlig hilsen 

Claus Stovgaard 
Firmware Design Engineer 
Phase One

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-26 13:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-24 16:26 Use device tree to disable U1/U2 in gadget devices based on DWC3 Claus H. Stovgaard
2019-04-24 18:33 ` Alan Stern
2019-04-25 20:11   ` Rob Weber
2019-04-25 20:11     ` Rob Weber
2019-04-26 13:15     ` Claus H. Stovgaard
2019-04-26 13:15       ` Claus H. Stovgaard
2019-04-26 12:44   ` Claus H. Stovgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox