OSDN Git Service

CLK: TI: omap5: Initialize USB_DPLL at boot
authorRoger Quadros <rogerq@ti.com>
Wed, 24 Jul 2013 13:30:55 +0000 (16:30 +0300)
committerMike Turquette <mturquette@linaro.org>
Fri, 17 Jan 2014 20:35:27 +0000 (12:35 -0800)
USB_DPLL must be initialized and locked at boot so that
USB modules can work.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/ti/clk-54xx.c

index c876e6e..0ef9f58 100644 (file)
 
 #define OMAP5_DPLL_ABE_DEFFREQ                         98304000
 
+/*
+ * OMAP543x TRM, section "3.6.3.9.5 DPLL_USB Preferred Settings"
+ * states it must be at 960MHz
+ */
+#define OMAP5_DPLL_USB_DEFFREQ                         960000000
+
 static struct ti_dt_clk omap54xx_clks[] = {
        DT_CLK(NULL, "pad_clks_src_ck", "pad_clks_src_ck"),
        DT_CLK(NULL, "pad_clks_ck", "pad_clks_ck"),
@@ -220,7 +226,7 @@ static struct ti_dt_clk omap54xx_clks[] = {
 int __init omap5xxx_dt_clk_init(void)
 {
        int rc;
-       struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck;
+       struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll;
 
        ti_dt_clocks_register(omap54xx_clks);
 
@@ -235,5 +241,15 @@ int __init omap5xxx_dt_clk_init(void)
        if (rc)
                pr_err("%s: failed to configure ABE DPLL!\n", __func__);
 
+       usb_dpll = clk_get_sys(NULL, "dpll_usb_ck");
+       rc = clk_set_rate(usb_dpll, OMAP5_DPLL_USB_DEFFREQ);
+       if (rc)
+               pr_err("%s: failed to configure USB DPLL!\n", __func__);
+
+       usb_dpll = clk_get_sys(NULL, "dpll_usb_m2_ck");
+       rc = clk_set_rate(usb_dpll, OMAP5_DPLL_USB_DEFFREQ/2);
+       if (rc)
+               pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
+
        return 0;
 }