USB: set usbphy_480m clk rate 480MHz.
authorwlf <wulf@rock-chips.com>
Thu, 17 Apr 2014 09:58:59 +0000 (17:58 +0800)
committerwlf <wulf@rock-chips.com>
Thu, 17 Apr 2014 09:58:59 +0000 (17:58 +0800)
arch/arm/boot/dts/rk3288.dtsi
drivers/usb/dwc_otg_310/dwc_otg_driver.c
drivers/usb/dwc_otg_310/usbdev_rk.h
drivers/usb/dwc_otg_310/usbdev_rk32.c

index 680af0815de1218a3ec0893776b5d48d712b5720..dfd935e35df0271c1a5542712315b073802797f4 100755 (executable)
                compatible = "rockchip,rk3288_usb20_host";
                reg = <0xff540000 0x40000>;
                interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&clk_gates13 6>, <&clk_gates7 7>;
-               clock-names = "clk_usbphy1", "hclk_usb1";
+               clocks = <&clk_gates13 6>, <&clk_gates7 7>,
+                        <&usbphy_480m>;
+               clock-names = "clk_usbphy1", "hclk_usb1",
+                             "usbphy_480m";
        };
 
        usb2: usb@ff500000 {
index 47c2f48cfc62d037f48c3a405f8f98316cb13ee3..93d1d2ea401b366391ce5e6d9bd034af757402e3 100755 (executable)
@@ -1141,6 +1141,7 @@ static int host20_driver_probe(struct platform_device *_dev)
                goto fail;
        }
 
+       clk_set_rate(pldata->phyclk_480m, 480000000);
        /*
         * Enable the global interrupt after all the interrupt
         * handlers are installed if there is no ADP support else 
index 8f49ced01bd7f3d78861712757c674a2a2ab3744..16d447be9305562b25dfee21b4e9907c1b74f93a 100755 (executable)
@@ -57,6 +57,7 @@ struct dwc_otg_platform_data {
     struct clk* phyclk;
     struct clk* ahbclk;
     struct clk* busclk;
+    struct clk* phyclk_480m;
     int phy_status;
     void (*hw_init)(void);
     void (*phy_suspend)(void* pdata, int suspend);
index 278d1c49c2d55806afa6915fb0dabe71f9c62840..3298a478f5e155af89b8ef2874b19d2cdd8ec66f 100755 (executable)
@@ -215,7 +215,7 @@ static void usb20host_soft_reset(void)
 static void usb20host_clock_init(void* pdata)
 {
        struct dwc_otg_platform_data *usbpdata=pdata;
-       struct clk* ahbclk,*phyclk;
+       struct clk* ahbclk, *phyclk, *phyclk_480m;
 
        ahbclk = devm_clk_get(usbpdata->dev, "hclk_usb1");
        if (IS_ERR(ahbclk)) {
@@ -229,8 +229,15 @@ static void usb20host_clock_init(void* pdata)
                return;
        }
 
+       phyclk_480m = devm_clk_get(usbpdata->dev, "usbphy_480m");
+       if (IS_ERR(phyclk_480m)) {
+               dev_err(usbpdata->dev, "Failed to get usbphy_480m\n");
+               return;
+       }
+
        usbpdata->phyclk = phyclk;
        usbpdata->ahbclk = ahbclk;
+       usbpdata->phyclk_480m = phyclk_480m;
 }
 
 static void usb20host_clock_enable(void* pdata, int enable)