Thread (40 messages) 40 messages, 7 authors, 2021-04-23

Re: [PATCH] usb: dwc3: core: Do core softreset when switch mode

From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Date: 2021-04-15 22:31:57
Also in: stable

Hi Felipe,

Thinh Nguyen wrote:
Felipe Balbi wrote:
quoted
Hi,

Thinh Nguyen [off-list ref] writes:
quoted
quoted
Thinh Nguyen [off-list ref] writes:
quoted
From: Yu Chen <chenyu56@huawei.com>
From: John Stultz <redacted>

According to the programming guide, to switch mode for DRD controller,
the driver needs to do the following.

To switch from device to host:
1. Reset controller with GCTL.CoreSoftReset
2. Set GCTL.PrtCapDir(host mode)
3. Reset the host with USBCMD.HCRESET
4. Then follow up with the initializing host registers sequence

To switch from host to device:
1. Reset controller with GCTL.CoreSoftReset
2. Set GCTL.PrtCapDir(device mode)
3. Reset the device with DCTL.CSftRst
4. Then follow up with the initializing registers sequence

Currently we're missing step 1) to do GCTL.CoreSoftReset and step 3) of
we're not really missing, it was a deliberate choice :-) The only reason
why we need the soft reset is because host and gadget registers map to
the same physical space within dwc3 core. If we cache and restore the
affected registers, we're good ;-)
It's part of the programming model. I've already discussed with internal
RTL designers. This is needed, and I've provided the discussion we had
prior also. We have several different devices in the wild that need
this. What is the concern?
Timing :-) If anyone wants to support OTG spec, it'll be super hard to
guarantee the timing mandated by the spec if we have to go through full
reset.
This is for DRD only. It should not impact the old OTG flow. We already
have the check in place.
I thought I checked for OTG, but I missed it. I think v3 should cover it.

Thanks,
Thinh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help