]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00209480-4 mx6sl_usb remove the sw workaround to verify IC fix
authorTony LIU <junjie.liu@freescale.com>
Thu, 3 May 2012 02:00:29 +0000 (10:00 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:11:49 +0000 (14:11 +0200)
- add a function to tell if sw walkaround is needed
  for the IC bug

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
arch/arm/mach-mx6/usb_dr.c
arch/arm/mach-mx6/usb_h1.c
arch/arm/plat-mxc/usb_common.c

index 24c8cb9c4d315cc2348d66fe2370ee8ae41039f9..0a15a8ce3327f1b85268d3d0aa2de5e243761783 100644 (file)
@@ -32,6 +32,7 @@ static int usbotg_init_ext(struct platform_device *pdev);
 static void usbotg_uninit_ext(struct platform_device *pdev);
 static void usbotg_clock_gate(bool on);
 static void _dr_discharge_line(bool enable);
+extern bool usb_icbug_swfix_need(void);
 
 /* The usb_phy1_clk do not have enable/disable function at clock.c
  * and PLL output for usb1's phy should be always enabled.
@@ -160,6 +161,9 @@ static int usb_phy_enable(struct fsl_usb2_platform_data *pdata)
                                , phy_reg + HW_USBPHY_CTRL_SET);
        }
 
+       if (!usb_icbug_swfix_need())
+               __raw_writel(((1 << 17) | (1 << 18)),
+                               phy_reg + HW_USBPHY_IP_SET);
        return 0;
 }
 /* Notes: configure USB clock*/
@@ -553,6 +557,7 @@ void __init mx6_usb_dr_init(void)
 {
        struct platform_device *pdev, *pdev_wakeup;
        static void __iomem *anatop_base_addr = MX6_IO_ADDRESS(ANATOP_BASE_ADDR);
+
 #ifdef CONFIG_USB_OTG
        /* wake_up_enable is useless, just for usb_register_remote_wakeup execution*/
        dr_utmi_config.wake_up_enable = _device_wakeup_enable;
@@ -564,8 +569,13 @@ void __init mx6_usb_dr_init(void)
 #ifdef CONFIG_USB_EHCI_ARC_OTG
        dr_utmi_config.operating_mode = DR_HOST_MODE;
        dr_utmi_config.wake_up_enable = _host_wakeup_enable;
-       dr_utmi_config.platform_rh_suspend = _host_platform_rh_suspend;
-       dr_utmi_config.platform_rh_resume  = _host_platform_rh_resume;
+       if (usb_icbug_swfix_need()) {
+               dr_utmi_config.platform_rh_suspend = _host_platform_rh_suspend;
+               dr_utmi_config.platform_rh_resume  = _host_platform_rh_resume;
+       } else {
+               dr_utmi_config.platform_rh_suspend = NULL;
+               dr_utmi_config.platform_rh_resume  = NULL;
+       }
        dr_utmi_config.platform_set_disconnect_det = fsl_platform_otg_set_usb_phy_dis;
        dr_utmi_config.phy_lowpower_suspend = _host_phy_lowpower_suspend;
        dr_utmi_config.is_wakeup_event = _is_host_wakeup;
index 2155098678434c768cf0996e5dceb236a296f122..bff9a29aef02f8ec06aa8a2ebfa57248feeefc30 100644 (file)
@@ -34,6 +34,7 @@
 static struct clk *usb_oh3_clk;
 extern int clk_get_usecount(struct clk *clk);
 static struct fsl_usb2_platform_data usbh1_config;
+extern bool usb_icbug_swfix_need(void);
 
 static void fsl_platform_h1_set_usb_phy_dis(
                struct fsl_usb2_platform_data *pdata, bool enable)
@@ -124,6 +125,9 @@ static int usb_phy_enable(struct fsl_usb2_platform_data *pdata)
        tmp |= (BM_USBPHY_CTRL_ENUTMILEVEL2 | BM_USBPHY_CTRL_ENUTMILEVEL3);
        __raw_writel(tmp, phy_reg + HW_USBPHY_CTRL);
 
+       if (!usb_icbug_swfix_need())
+               __raw_writel(((1 << 17) | (1 << 18)),
+                               phy_reg + HW_USBPHY_IP_SET);
        return 0;
 }
 static int fsl_usb_host_init_ext(struct platform_device *pdev)
@@ -329,8 +333,6 @@ static struct fsl_usb2_platform_data usbh1_config = {
        .power_budget = 500,    /* 500 mA max power */
        .wake_up_enable = _wake_up_enable,
        .usb_clock_for_pm  = usbh1_clock_gate,
-       .platform_rh_suspend  = usbh1_platform_rh_suspend,
-       .platform_rh_resume   = usbh1_platform_rh_resume,
        .platform_set_disconnect_det = fsl_platform_h1_set_usb_phy_dis,
        .phy_lowpower_suspend = _phy_lowpower_suspend,
        .is_wakeup_event = _is_usbh1_wakeup,
@@ -349,7 +351,15 @@ void __init mx6_usb_h1_init(void)
 {
        struct platform_device *pdev, *pdev_wakeup;
        static void __iomem *anatop_base_addr = MX6_IO_ADDRESS(ANATOP_BASE_ADDR);
+
        usbh1_config.wakeup_pdata = &usbh1_wakeup_config;
+       if (usb_icbug_swfix_need()) {
+               usbh1_config.platform_rh_suspend = usbh1_platform_rh_suspend;
+               usbh1_config.platform_rh_resume  = usbh1_platform_rh_resume;
+       } else {
+               usbh1_config.platform_rh_suspend = NULL;
+               usbh1_config.platform_rh_resume  = NULL;
+       }
        if (cpu_is_mx6sl())
                pdev = imx6sl_add_fsl_ehci_hs(1, &usbh1_config);
        else
@@ -361,6 +371,7 @@ void __init mx6_usb_h1_init(void)
                pdev_wakeup = imx6q_add_fsl_usb2_hs_wakeup(1, &usbh1_wakeup_config);
        ((struct fsl_usb2_platform_data *)(pdev->dev.platform_data))->wakeup_pdata =
                (struct fsl_usb2_wakeup_platform_data *)(pdev_wakeup->dev.platform_data);
+
        /* Some phy and power's special controls for host1
         * 1. The external charger detector needs to be disabled
         * or the signal at DP will be poor
index 6cf2fa8fb682d2200c596e34bab1361bd113415e..b18f5239c8b9f0ce28e71e51924c7d6e47ae8796 100755 (executable)
@@ -55,6 +55,14 @@ void __iomem *imx_otg_base;
 #define MXC_NUMBER_USB_TRANSCEIVER 6
 struct fsl_xcvr_ops *g_xc_ops[MXC_NUMBER_USB_TRANSCEIVER] = { NULL };
 
+bool usb_icbug_swfix_need(void)
+{
+       if (cpu_is_mx6sl())
+               return false;
+       else
+               return true;
+}
+
 enum fsl_usb2_modes get_usb_mode(struct fsl_usb2_platform_data *pdata)
 {
        enum fsl_usb2_modes mode;