We have wrong understanding that reset controller will put PHY
to be out of low power automatically, but in fact, it is not.
So, we should put PHY to be out of low power explicitly if the
portsc.phcd = 1 before we need to access controller's register.
Some register writing will hang system (eg,PERIODICLISTBASE),
some reading will not get the correct value (eg, otgsc).
Signed-off-by: Peter Chen <peter.chen@freescale.com>
UOG_USBCMD |= UCMD_RESET;
while ((UOG_USBCMD) & (UCMD_RESET))
;
+
+ /*
+ * If the controller reset does not put the PHY be out of
+ * low power mode, do it manually.
+ */
+ if (UOG_PORTSC1 & PORTSC_PHCD) {
+ UOG_PORTSC1 &= ~PORTSC_PHCD;
+ mdelay(1);
+ }
+
/* Reset USBPHY module */
phy_ctrl = phy_reg + HW_USBPHY_CTRL;
tmp = __raw_readl(phy_ctrl);
UH1_USBCMD |= UCMD_RESET;
while ((UH1_USBCMD) & (UCMD_RESET))
;
+
+ /*
+ * If the controller reset does not put the PHY be out of
+ * low power mode, do it manually.
+ */
+ if (UH1_PORTSC1 & PORTSC_PHCD) {
+ UH1_PORTSC1 &= ~PORTSC_PHCD;
+ mdelay(1);
+ }
+
/* Reset USBPHY module */
phy_ctrl = phy_reg + HW_USBPHY_CTRL;
tmp = __raw_readl(phy_ctrl);