summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-04-16 09:47:15 +0800
committerPeter Chen <peter.chen@freescale.com>2013-04-24 13:27:19 +0800
commitcb3695349bc4b7cc2a3baef1789d8d3f90d5e552 (patch)
treed8a851dada8c802fa2672692c4cb43075be4424f /arch
parent8086df3040dcac95688cecbeed3de052fe33ea2e (diff)
ENGR00258491-2 msl-mx6: usb: put PHY to be out of low power explicitly
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx6/usb_dr.c10
-rw-r--r--arch/arm/mach-mx6/usb_h1.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/usb_dr.c b/arch/arm/mach-mx6/usb_dr.c
index 3a51f96cedd3..31f8230165bc 100644
--- a/arch/arm/mach-mx6/usb_dr.c
+++ b/arch/arm/mach-mx6/usb_dr.c
@@ -99,6 +99,16 @@ static int usb_phy_enable(struct fsl_usb2_platform_data *pdata)
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);
diff --git a/arch/arm/mach-mx6/usb_h1.c b/arch/arm/mach-mx6/usb_h1.c
index c665f640bcb2..d14b537891d6 100644
--- a/arch/arm/mach-mx6/usb_h1.c
+++ b/arch/arm/mach-mx6/usb_h1.c
@@ -111,6 +111,16 @@ static int usb_phy_enable(struct fsl_usb2_platform_data *pdata)
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);