]> git.sur5r.net Git - u-boot/commitdiff
S5PC2XX: clock: support pwm clock for evt1 (cpu revision 1)
authorMinkyu Kang <mk7.kang@samsung.com>
Wed, 18 May 2011 07:57:55 +0000 (16:57 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Thu, 26 May 2011 10:33:25 +0000 (19:33 +0900)
The source of pwm clock is fixed at evt1.
And some registers for pwm clock are removed.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
arch/arm/cpu/armv7/s5pc2xx/clock.c

index 624de6257c268d753156353f8a60d9b8b63939e0..5ecd475964c80b34ccab0c01f8a360bb4a4de9ad 100644 (file)
@@ -124,29 +124,35 @@ static unsigned long s5pc210_get_pwm_clk(void)
        unsigned int sel;
        unsigned int ratio;
 
-       /*
-        * CLK_SRC_PERIL0
-        * PWM_SEL [27:24]
-        */
-       sel = readl(&clk->src_peril0);
-       sel = (sel >> 24) & 0xf;
-
-       if (sel == 0x6)
+       if (s5p_get_cpu_rev() == 0) {
+               /*
+                * CLK_SRC_PERIL0
+                * PWM_SEL [27:24]
+                */
+               sel = readl(&clk->src_peril0);
+               sel = (sel >> 24) & 0xf;
+
+               if (sel == 0x6)
+                       sclk = get_pll_clk(MPLL);
+               else if (sel == 0x7)
+                       sclk = get_pll_clk(EPLL);
+               else if (sel == 0x8)
+                       sclk = get_pll_clk(VPLL);
+               else
+                       return 0;
+
+               /*
+                * CLK_DIV_PERIL3
+                * PWM_RATIO [3:0]
+                */
+               ratio = readl(&clk->div_peril3);
+               ratio = ratio & 0xf;
+       } else if (s5p_get_cpu_rev() == 1) {
                sclk = get_pll_clk(MPLL);
-       else if (sel == 0x7)
-               sclk = get_pll_clk(EPLL);
-       else if (sel == 0x8)
-               sclk = get_pll_clk(VPLL);
-       else
+               ratio = 8;
+       } else
                return 0;
 
-       /*
-        * CLK_DIV_PERIL3
-        * PWM_RATIO [3:0]
-        */
-       ratio = readl(&clk->div_peril3);
-       ratio = ratio & 0xf;
-
        pclk = sclk / (ratio + 1);
 
        return pclk;