rk292x: usb: totally reset inno usb phy
authorlyz <lyz@rock-chips.com>
Mon, 1 Apr 2013 03:31:31 +0000 (11:31 +0800)
committerlyz <lyz@rock-chips.com>
Mon, 1 Apr 2013 03:31:31 +0000 (11:31 +0800)
drivers/usb/dwc_otg/usbdev_rk2928.c

index 22666c4226653e46bba61344bc9c89d3698cae59..17c3dbafb02bc2d8171308ba1fa882bde2808f84 100755 (executable)
@@ -131,15 +131,41 @@ void usb20otg_phy_suspend(void* pdata, int suspend)
 void usb20otg_soft_reset(void)\r
 {\r
 #if 1\r
-    cru_set_soft_reset(SOFT_RST_USBOTG0, true);\r
-    cru_set_soft_reset(SOFT_RST_USBPHY0, true);\r
+    printk("~~~~~~~~~~usb20otg_soft_reset\n");\r
+    //phy reset\r
+    *(unsigned int*)(USBGRF_UOC0_CON5) = 0x00030001;\r
+    *(unsigned int*)(USBGRF_UOC1_CON5) = 0x00030001;\r
+\r
+\r
+    cru_set_soft_reset(SOFT_RST_USBPOR, true);\r
+\r
+    cru_set_soft_reset(SOFT_RST_UTMI0, true);\r
+    cru_set_soft_reset(SOFT_RST_UTMI1, true);\r
+\r
+    udelay(15);\r
+    \r
+    *(unsigned int*)(USBGRF_UOC0_CON5) = 0x00030002; \r
+    *(unsigned int*)(USBGRF_UOC1_CON5) = 0x00030002;\r
+\r
+    udelay(1500);\r
+    cru_set_soft_reset(SOFT_RST_USBPOR, false);\r
+    udelay(2);\r
+    cru_set_soft_reset(SOFT_RST_UTMI0, false);\r
+    cru_set_soft_reset(SOFT_RST_UTMI1, false);\r
+\r
+    //ctrler reset\r
     cru_set_soft_reset(SOFT_RST_OTGC0, true);\r
-    udelay(1);\r
+    cru_set_soft_reset(SOFT_RST_OTGC1, true);\r
+    udelay(2);\r
 \r
-    cru_set_soft_reset(SOFT_RST_USBOTG0, false);\r
-    cru_set_soft_reset(SOFT_RST_USBPHY0, false);\r
-    cru_set_soft_reset(SOFT_RST_OTGC0, false);\r
-    mdelay(1);\r
+    cru_set_soft_reset(SOFT_RST_USBOTG0, true);\r
+    cru_set_soft_reset(SOFT_RST_USBOTG1, true);\r
+    udelay(2);\r
+    \r
+    cru_set_soft_reset(SOFT_RST_OTGC0,false);\r
+    cru_set_soft_reset(SOFT_RST_OTGC1,false);\r
+    cru_set_soft_reset(SOFT_RST_USBOTG0,false);\r
+    cru_set_soft_reset(SOFT_RST_USBOTG1,false);\r
 #endif\r
 }\r
 void usb20otg_clock_init(void* pdata)\r
@@ -287,14 +313,15 @@ void usb20host_phy_suspend(void* pdata, int suspend)
 }\r
 void usb20host_soft_reset(void)\r
 {\r
-#if 1\r
+#if 0\r
     cru_set_soft_reset(SOFT_RST_USBOTG1, true);\r
-    cru_set_soft_reset(SOFT_RST_USBPHY1, true);\r
+    //cru_set_soft_reset(SOFT_RST_USBPHY1, true);\r
     cru_set_soft_reset(SOFT_RST_OTGC1, true);\r
+    \r
     udelay(1);\r
 \r
     cru_set_soft_reset(SOFT_RST_USBOTG1, false);\r
-    cru_set_soft_reset(SOFT_RST_USBPHY1, false);\r
+    //cru_set_soft_reset(SOFT_RST_USBPHY1, false);\r
     cru_set_soft_reset(SOFT_RST_OTGC1, false);\r
     mdelay(1);\r
 #endif\r