mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 06:10:53 +07:00
fce7bbcd07
commit f88359e1588b85cf0e8209ab7d6620085f3441d9 upstream.
From: John Stultz <john.stultz@linaro.org>
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
switching from host to device. John Stult reported a lockup issue seen
with HiKey960 platform without these steps[1]. Similar issue is observed
with Ferry's testing platform[2].
So, apply the required steps along with some fixes to Yu Chen's and John
Stultz's version. The main fixes to their versions are the missing wait
for clocks synchronization before clearing GCTL.CoreSoftReset and only
apply DCTL.CSftRst when switching from host to device.
[1] https://lore.kernel.org/linux-usb/20210108015115.27920-1-john.stultz@linaro.org/
[2] https://lore.kernel.org/linux-usb/0ba7a6ba-e6a7-9cd4-0695-64fc927e01f1@gmail.com/
Fixes:
|
||
---|---|---|
.. | ||
core.c | ||
core.h | ||
debug.h | ||
debugfs.c | ||
drd.c | ||
dwc3-exynos.c | ||
dwc3-haps.c | ||
dwc3-keystone.c | ||
dwc3-meson-g12a.c | ||
dwc3-of-simple.c | ||
dwc3-omap.c | ||
dwc3-pci.c | ||
dwc3-qcom.c | ||
dwc3-st.c | ||
ep0.c | ||
gadget.c | ||
gadget.h | ||
host.c | ||
io.h | ||
Kconfig | ||
Makefile | ||
trace.c | ||
trace.h | ||
ulpi.c |