CHROMIUM: usb: dwc3: rockchip: fix otg reset problem
We need to ensure the dwc controller stay in P2 state prior
to phy init. In order to set dwc controller in P2 state,
there're two methods:
1. Hold dwc controller in reset while initialize phy.
2. Do OTG reset before phy init, one thing to note here is
that we can't reinit dwc controller again prior to phy init.
We choose the second mothod now. Because asserting the OTG
reset may affect dwc chip operation. The reset will clear all
of the dwc controller registers, and there are no synchronization
primitives, meaning the dwc3 core code could at least in theory
access chip registers while the reset is asserted, with unknown
impact. So we need to deassert the OTG reset as soon as possible.
Since phy init may take a long time, we can't hold the reset while
initialize phy.
Also, we add otg reset if dwc controller works as peripheral mode.
Change-Id: I54fec922308f62bfc7ebdde3e07ede9347e8f70a
Signed-off-by: William wu <wulf@rock-chips.com>