aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s5p
diff options
context:
space:
mode:
authorThomas Abraham <thomas.ab@samsung.com>2010-05-14 03:27:28 -0400
committerBen Dooks <ben-linux@fluff.org>2010-05-19 05:22:47 -0400
commita443a6373d8527657cfde3d3c515d4a64532c585 (patch)
treed4c64220ba399d4dc98f9e8921385787968e3dc0 /arch/arm/plat-s5p
parenta0f735812e9ffb65fa4c8a16975f5b63909fb447 (diff)
ARM: S5PC100: Pre-requisite clock patch for plat-s5pc1xx to plat-s5p move
This is a pre-requisite clock patch for the plat-s5pc1xx to plat-s5p movement. The patches that perform the movement of the code from plat-s5pc1xx to plat-s5p (and mach-s5pc100) should also enable the build for the mach-s5pc100/clock.c code. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r--arch/arm/plat-s5p/clock.c2
-rw-r--r--arch/arm/plat-s5p/include/plat/pll.h22
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p-clock.h2
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
41static struct clk s5p_clk_27m = { 41struct 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
92static 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
25extern struct clk clk_ext_xtal_mux; 26extern struct clk clk_ext_xtal_mux;
26extern struct clk clk_xusbxti; 27extern struct clk clk_xusbxti;
27extern struct clk clk_48m; 28extern struct clk clk_48m;
29extern struct clk s5p_clk_27m;
28extern struct clk clk_fout_apll; 30extern struct clk clk_fout_apll;
29extern struct clk clk_fout_mpll; 31extern struct clk clk_fout_mpll;
30extern struct clk clk_fout_epll; 32extern struct clk clk_fout_epll;