aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKisoo Yu <ksoo.yu@samsung.com>2012-04-24 17:54:15 -0400
committerKukjin Kim <kgene.kim@samsung.com>2012-05-15 18:03:41 -0400
commit57b317f912b3f4b05c834818c73d7c8ea22642f7 (patch)
tree9963b419762b3bbe9a30544c9543edb199df5cde
parentf10590c9836c9fc595d1dafff965b280029d4f16 (diff)
ARM: EXYNOS: Add pre-divider and fout mux clocks for bpll and mpll
The fout clock of BPLL and MPLL have a selectable source on EXYNOS5250. The clock options are a fixed divided by 2 clock and the output of the PLL itself. Add support for these new clock instances. Signed-off-by: Kisoo Yu <ksoo.yu@samsung.com> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> [kgene.kim@samsung.com: moved common pll stuff into s5p-clock.c] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c46
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-clock.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s5p-clock.h4
-rw-r--r--arch/arm/plat-samsung/s5p-clock.c30
4 files changed, 80 insertions, 2 deletions
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 84ef35aceba2..5aa460b01fdf 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -165,11 +165,29 @@ static struct clksrc_clk exynos5_clk_sclk_apll = {
165 .reg_div = { .reg = EXYNOS5_CLKDIV_CPU0, .shift = 24, .size = 3 }, 165 .reg_div = { .reg = EXYNOS5_CLKDIV_CPU0, .shift = 24, .size = 3 },
166}; 166};
167 167
168static struct clksrc_clk exynos5_clk_mout_bpll_fout = {
169 .clk = {
170 .name = "mout_bpll_fout",
171 },
172 .sources = &clk_src_bpll_fout,
173 .reg_src = { .reg = EXYNOS5_PLL_DIV2_SEL, .shift = 0, .size = 1 },
174};
175
176static struct clk *exynos5_clk_src_bpll_list[] = {
177 [0] = &clk_fin_bpll,
178 [1] = &exynos5_clk_mout_bpll_fout.clk,
179};
180
181static struct clksrc_sources exynos5_clk_src_bpll = {
182 .sources = exynos5_clk_src_bpll_list,
183 .nr_sources = ARRAY_SIZE(exynos5_clk_src_bpll_list),
184};
185
168static struct clksrc_clk exynos5_clk_mout_bpll = { 186static struct clksrc_clk exynos5_clk_mout_bpll = {
169 .clk = { 187 .clk = {
170 .name = "mout_bpll", 188 .name = "mout_bpll",
171 }, 189 },
172 .sources = &clk_src_bpll, 190 .sources = &exynos5_clk_src_bpll,
173 .reg_src = { .reg = EXYNOS5_CLKSRC_CDREX, .shift = 0, .size = 1 }, 191 .reg_src = { .reg = EXYNOS5_CLKSRC_CDREX, .shift = 0, .size = 1 },
174}; 192};
175 193
@@ -207,11 +225,29 @@ static struct clksrc_clk exynos5_clk_mout_epll = {
207 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP2, .shift = 12, .size = 1 }, 225 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP2, .shift = 12, .size = 1 },
208}; 226};
209 227
228static struct clksrc_clk exynos5_clk_mout_mpll_fout = {
229 .clk = {
230 .name = "mout_mpll_fout",
231 },
232 .sources = &clk_src_mpll_fout,
233 .reg_src = { .reg = EXYNOS5_PLL_DIV2_SEL, .shift = 4, .size = 1 },
234};
235
236static struct clk *exynos5_clk_src_mpll_list[] = {
237 [0] = &clk_fin_mpll,
238 [1] = &exynos5_clk_mout_mpll_fout.clk,
239};
240
241static struct clksrc_sources exynos5_clk_src_mpll = {
242 .sources = exynos5_clk_src_mpll_list,
243 .nr_sources = ARRAY_SIZE(exynos5_clk_src_mpll_list),
244};
245
210struct clksrc_clk exynos5_clk_mout_mpll = { 246struct clksrc_clk exynos5_clk_mout_mpll = {
211 .clk = { 247 .clk = {
212 .name = "mout_mpll", 248 .name = "mout_mpll",
213 }, 249 },
214 .sources = &clk_src_mpll, 250 .sources = &exynos5_clk_src_mpll,
215 .reg_src = { .reg = EXYNOS5_CLKSRC_CORE1, .shift = 8, .size = 1 }, 251 .reg_src = { .reg = EXYNOS5_CLKSRC_CORE1, .shift = 8, .size = 1 },
216}; 252};
217 253
@@ -1036,10 +1072,12 @@ static struct clksrc_clk *exynos5_sysclks[] = {
1036 &exynos5_clk_mout_apll, 1072 &exynos5_clk_mout_apll,
1037 &exynos5_clk_sclk_apll, 1073 &exynos5_clk_sclk_apll,
1038 &exynos5_clk_mout_bpll, 1074 &exynos5_clk_mout_bpll,
1075 &exynos5_clk_mout_bpll_fout,
1039 &exynos5_clk_mout_bpll_user, 1076 &exynos5_clk_mout_bpll_user,
1040 &exynos5_clk_mout_cpll, 1077 &exynos5_clk_mout_cpll,
1041 &exynos5_clk_mout_epll, 1078 &exynos5_clk_mout_epll,
1042 &exynos5_clk_mout_mpll, 1079 &exynos5_clk_mout_mpll,
1080 &exynos5_clk_mout_mpll_fout,
1043 &exynos5_clk_mout_mpll_user, 1081 &exynos5_clk_mout_mpll_user,
1044 &exynos5_clk_vpllsrc, 1082 &exynos5_clk_vpllsrc,
1045 &exynos5_clk_sclk_vpll, 1083 &exynos5_clk_sclk_vpll,
@@ -1103,7 +1141,9 @@ static struct clk *exynos5_clks[] __initdata = {
1103 &exynos5_clk_sclk_hdmi27m, 1141 &exynos5_clk_sclk_hdmi27m,
1104 &exynos5_clk_sclk_hdmiphy, 1142 &exynos5_clk_sclk_hdmiphy,
1105 &clk_fout_bpll, 1143 &clk_fout_bpll,
1144 &clk_fout_bpll_div2,
1106 &clk_fout_cpll, 1145 &clk_fout_cpll,
1146 &clk_fout_mpll_div2,
1107 &exynos5_clk_armclk, 1147 &exynos5_clk_armclk,
1108}; 1148};
1109 1149
@@ -1268,8 +1308,10 @@ void __init_or_cpufreq exynos5_setup_clocks(void)
1268 1308
1269 clk_fout_apll.ops = &exynos5_fout_apll_ops; 1309 clk_fout_apll.ops = &exynos5_fout_apll_ops;
1270 clk_fout_bpll.rate = bpll; 1310 clk_fout_bpll.rate = bpll;
1311 clk_fout_bpll_div2.rate = bpll >> 1;
1271 clk_fout_cpll.rate = cpll; 1312 clk_fout_cpll.rate = cpll;
1272 clk_fout_mpll.rate = mpll; 1313 clk_fout_mpll.rate = mpll;
1314 clk_fout_mpll_div2.rate = mpll >> 1;
1273 clk_fout_epll.rate = epll; 1315 clk_fout_epll.rate = epll;
1274 clk_fout_vpll.rate = vpll; 1316 clk_fout_vpll.rate = vpll;
1275 1317
diff --git a/arch/arm/mach-exynos/include/mach/regs-clock.h b/arch/arm/mach-exynos/include/mach/regs-clock.h
index dba83e91f0fd..b78b5f3ad9c0 100644
--- a/arch/arm/mach-exynos/include/mach/regs-clock.h
+++ b/arch/arm/mach-exynos/include/mach/regs-clock.h
@@ -322,6 +322,8 @@
322#define EXYNOS5_CLKSRC_CDREX EXYNOS_CLKREG(0x20200) 322#define EXYNOS5_CLKSRC_CDREX EXYNOS_CLKREG(0x20200)
323#define EXYNOS5_CLKDIV_CDREX EXYNOS_CLKREG(0x20500) 323#define EXYNOS5_CLKDIV_CDREX EXYNOS_CLKREG(0x20500)
324 324
325#define EXYNOS5_PLL_DIV2_SEL EXYNOS_CLKREG(0x20A24)
326
325#define EXYNOS5_EPLL_LOCK EXYNOS_CLKREG(0x10030) 327#define EXYNOS5_EPLL_LOCK EXYNOS_CLKREG(0x10030)
326 328
327#define EXYNOS5_EPLLCON0_LOCKED_SHIFT (29) 329#define EXYNOS5_EPLLCON0_LOCKED_SHIFT (29)
diff --git a/arch/arm/plat-samsung/include/plat/s5p-clock.h b/arch/arm/plat-samsung/include/plat/s5p-clock.h
index 1de4b32f98e9..8364b4bea8b8 100644
--- a/arch/arm/plat-samsung/include/plat/s5p-clock.h
+++ b/arch/arm/plat-samsung/include/plat/s5p-clock.h
@@ -32,8 +32,10 @@ extern struct clk clk_48m;
32extern struct clk s5p_clk_27m; 32extern struct clk s5p_clk_27m;
33extern struct clk clk_fout_apll; 33extern struct clk clk_fout_apll;
34extern struct clk clk_fout_bpll; 34extern struct clk clk_fout_bpll;
35extern struct clk clk_fout_bpll_div2;
35extern struct clk clk_fout_cpll; 36extern struct clk clk_fout_cpll;
36extern struct clk clk_fout_mpll; 37extern struct clk clk_fout_mpll;
38extern struct clk clk_fout_mpll_div2;
37extern struct clk clk_fout_epll; 39extern struct clk clk_fout_epll;
38extern struct clk clk_fout_dpll; 40extern struct clk clk_fout_dpll;
39extern struct clk clk_fout_vpll; 41extern struct clk clk_fout_vpll;
@@ -42,8 +44,10 @@ extern struct clk clk_vpll;
42 44
43extern struct clksrc_sources clk_src_apll; 45extern struct clksrc_sources clk_src_apll;
44extern struct clksrc_sources clk_src_bpll; 46extern struct clksrc_sources clk_src_bpll;
47extern struct clksrc_sources clk_src_bpll_fout;
45extern struct clksrc_sources clk_src_cpll; 48extern struct clksrc_sources clk_src_cpll;
46extern struct clksrc_sources clk_src_mpll; 49extern struct clksrc_sources clk_src_mpll;
50extern struct clksrc_sources clk_src_mpll_fout;
47extern struct clksrc_sources clk_src_epll; 51extern struct clksrc_sources clk_src_epll;
48extern struct clksrc_sources clk_src_dpll; 52extern struct clksrc_sources clk_src_dpll;
49 53
diff --git a/arch/arm/plat-samsung/s5p-clock.c b/arch/arm/plat-samsung/s5p-clock.c
index 41d3dfd5dddb..031a61899bef 100644
--- a/arch/arm/plat-samsung/s5p-clock.c
+++ b/arch/arm/plat-samsung/s5p-clock.c
@@ -67,6 +67,11 @@ struct clk clk_fout_bpll = {
67 .id = -1, 67 .id = -1,
68}; 68};
69 69
70struct clk clk_fout_bpll_div2 = {
71 .name = "fout_bpll_div2",
72 .id = -1,
73};
74
70/* CPLL clock output */ 75/* CPLL clock output */
71 76
72struct clk clk_fout_cpll = { 77struct clk clk_fout_cpll = {
@@ -82,6 +87,11 @@ struct clk clk_fout_mpll = {
82 .id = -1, 87 .id = -1,
83}; 88};
84 89
90struct clk clk_fout_mpll_div2 = {
91 .name = "fout_mpll_div2",
92 .id = -1,
93};
94
85/* EPLL clock output */ 95/* EPLL clock output */
86struct clk clk_fout_epll = { 96struct clk clk_fout_epll = {
87 .name = "fout_epll", 97 .name = "fout_epll",
@@ -125,6 +135,16 @@ struct clksrc_sources clk_src_bpll = {
125 .nr_sources = ARRAY_SIZE(clk_src_bpll_list), 135 .nr_sources = ARRAY_SIZE(clk_src_bpll_list),
126}; 136};
127 137
138static struct clk *clk_src_bpll_fout_list[] = {
139 [0] = &clk_fout_bpll_div2,
140 [1] = &clk_fout_bpll,
141};
142
143struct clksrc_sources clk_src_bpll_fout = {
144 .sources = clk_src_bpll_fout_list,
145 .nr_sources = ARRAY_SIZE(clk_src_bpll_fout_list),
146};
147
128/* Possible clock sources for CPLL Mux */ 148/* Possible clock sources for CPLL Mux */
129static struct clk *clk_src_cpll_list[] = { 149static struct clk *clk_src_cpll_list[] = {
130 [0] = &clk_fin_cpll, 150 [0] = &clk_fin_cpll,
@@ -147,6 +167,16 @@ struct clksrc_sources clk_src_mpll = {
147 .nr_sources = ARRAY_SIZE(clk_src_mpll_list), 167 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
148}; 168};
149 169
170static struct clk *clk_src_mpll_fout_list[] = {
171 [0] = &clk_fout_mpll_div2,
172 [1] = &clk_fout_mpll,
173};
174
175struct clksrc_sources clk_src_mpll_fout = {
176 .sources = clk_src_mpll_fout_list,
177 .nr_sources = ARRAY_SIZE(clk_src_mpll_fout_list),
178};
179
150/* Possible clock sources for EPLL Mux */ 180/* Possible clock sources for EPLL Mux */
151static struct clk *clk_src_epll_list[] = { 181static struct clk *clk_src_epll_list[] = {
152 [0] = &clk_fin_epll, 182 [0] = &clk_fin_epll,