diff options
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r-- | arch/arm/plat-s5p/clock.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/pll.h | 22 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/s5p-clock.h | 2 |
3 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c index a8bfabf4b6bc..24a931fd8d3b 100644 --- a/arch/arm/plat-s5p/clock.c +++ b/arch/arm/plat-s5p/clock.c | |||
@@ -38,7 +38,7 @@ struct clk clk_xusbxti = { | |||
38 | .id = -1, | 38 | .id = -1, |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static struct clk s5p_clk_27m = { | 41 | struct clk s5p_clk_27m = { |
42 | .name = "clk_27m", | 42 | .name = "clk_27m", |
43 | .id = -1, | 43 | .id = -1, |
44 | .rate = 27000000, | 44 | .rate = 27000000, |
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-s5p/include/plat/pll.h index d48325bb29e2..7db322726bc2 100644 --- a/arch/arm/plat-s5p/include/plat/pll.h +++ b/arch/arm/plat-s5p/include/plat/pll.h | |||
@@ -81,3 +81,25 @@ static inline unsigned long s5p_get_pll90xx(unsigned long baseclk, | |||
81 | 81 | ||
82 | return result; | 82 | return result; |
83 | } | 83 | } |
84 | |||
85 | #define PLL65XX_MDIV_MASK (0x3FF) | ||
86 | #define PLL65XX_PDIV_MASK (0x3F) | ||
87 | #define PLL65XX_SDIV_MASK (0x7) | ||
88 | #define PLL65XX_MDIV_SHIFT (16) | ||
89 | #define PLL65XX_PDIV_SHIFT (8) | ||
90 | #define PLL65XX_SDIV_SHIFT (0) | ||
91 | |||
92 | static inline unsigned long s5p_get_pll65xx(unsigned long baseclk, u32 pll_con) | ||
93 | { | ||
94 | u32 mdiv, pdiv, sdiv; | ||
95 | u64 fvco = baseclk; | ||
96 | |||
97 | mdiv = (pll_con >> PLL65XX_MDIV_SHIFT) & PLL65XX_MDIV_MASK; | ||
98 | pdiv = (pll_con >> PLL65XX_PDIV_SHIFT) & PLL65XX_PDIV_MASK; | ||
99 | sdiv = (pll_con >> PLL65XX_SDIV_SHIFT) & PLL65XX_SDIV_MASK; | ||
100 | |||
101 | fvco *= mdiv; | ||
102 | do_div(fvco, (pdiv << sdiv)); | ||
103 | |||
104 | return (unsigned long)fvco; | ||
105 | } | ||
diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-s5p/include/plat/s5p-clock.h index aa0447a18903..09418b1101fe 100644 --- a/arch/arm/plat-s5p/include/plat/s5p-clock.h +++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h | |||
@@ -21,10 +21,12 @@ | |||
21 | #define clk_fin_mpll clk_ext_xtal_mux | 21 | #define clk_fin_mpll clk_ext_xtal_mux |
22 | #define clk_fin_epll clk_ext_xtal_mux | 22 | #define clk_fin_epll clk_ext_xtal_mux |
23 | #define clk_fin_vpll clk_ext_xtal_mux | 23 | #define clk_fin_vpll clk_ext_xtal_mux |
24 | #define clk_fin_hpll clk_ext_xtal_mux | ||
24 | 25 | ||
25 | extern struct clk clk_ext_xtal_mux; | 26 | extern struct clk clk_ext_xtal_mux; |
26 | extern struct clk clk_xusbxti; | 27 | extern struct clk clk_xusbxti; |
27 | extern struct clk clk_48m; | 28 | extern struct clk clk_48m; |
29 | extern struct clk s5p_clk_27m; | ||
28 | extern struct clk clk_fout_apll; | 30 | extern struct clk clk_fout_apll; |
29 | extern struct clk clk_fout_mpll; | 31 | extern struct clk clk_fout_mpll; |
30 | extern struct clk clk_fout_epll; | 32 | extern struct clk clk_fout_epll; |