MLK-13450-15 ehci-mx6: Add powerup_fixup implementation
authorYe Li <ye.li@nxp.com>
Thu, 17 Nov 2016 08:54:56 +0000 (16:54 +0800)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:00:02 +0000 (02:00 -0700)
commit82d6f24048d789c78834f2233ce008b930336d10
tree52b7057c0761de68f9cd6037d6a0e4448e5563a4
parenta3bc673a1b9456db4e393af7569776c46afbd20f
MLK-13450-15 ehci-mx6: Add powerup_fixup implementation

When doing port reset, the PR bit of PORTSC1 will be automatically
cleared by our IP, but standard EHCI needs explicit clear by software. The
EHCI-HCD driver follow the EHCI specification, so after 50ms wait, it
clear the PR bit by writting to the PORTSC1 register with value loaded before
setting PR.

This sequence is ok for our IP when the delay time is exact. But when the timer
is slower, some bits like PE, PSPD have been set by controller automatically
after the PR is automatically cleared. So the writing to the PORTSC1 will overwrite
these bits set by controller. And eventually the driver gets wrong status.

We implement the powerup_fixup operation which delays 50ms and will check
the PR until it is cleared by controller. And will update the reg value which is written
to PORTSC register by EHCI-HCD driver. This is much safer than depending on the delay
time to be accurate and aligining with controller's behaiver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8dfdf83abaff44efb487f801cd1757a729d427c5)
(cherry picked from commit cafc860907a408156a43fa20169dfc187648618e)
(cherry picked from commit b3ec67eece968431ba7f8307156ae2659907a03b)
drivers/usb/host/ehci-mx6.c