aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Abraham <thomas.ab@samsung.com>2010-05-16 20:38:48 -0400
committerBen Dooks <ben-linux@fluff.org>2010-05-16 21:37:36 -0400
commit58772cd34479ca50e90eea25288d2021dd2e6ff6 (patch)
tree267ac28dc8ba6f6936dc0dbe2acee1ada0be0cdd
parent664f5b2065da188821fe5aa998c6351e8c042d98 (diff)
ARM: S5PV210: Remove usage of clk_p83 and add clk_pclk_dsys clock\
The clk_p83 clock, which is the PCLK clock for DSYS domain, is of type 'struct clk' whereas on S5PV210, this clock is suitable to be of type clksrc_clk clock (since it has a clock divider). So this patch replaces the 'struct clk' type clock to 'struct clksrc_clk' type clock for the PCLK DSYS clock. This patch modifies the following. 1. Remove definitions and usage of 'clk_p83' clock. 2. Adds 'clk_pclk_dsys' clock which is of type 'struct clksrc_clk'. 3. Replace all usage of clk_p83 with clk_pclk_dsys clock. 4. Adds clk_pclk_dsys into list of clocks to be registered. 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>
-rw-r--r--arch/arm/mach-s5pv210/clock.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index 527c9c4262f1..b46d9ec69eb8 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -125,6 +125,15 @@ static struct clksrc_clk clk_hclk_dsys = {
125 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 16, .size = 4 }, 125 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 16, .size = 4 },
126}; 126};
127 127
128static struct clksrc_clk clk_pclk_dsys = {
129 .clk = {
130 .name = "pclk_dsys",
131 .id = -1,
132 .parent = &clk_hclk_dsys.clk,
133 },
134 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 20, .size = 3 },
135};
136
128static struct clksrc_clk clk_hclk_psys = { 137static struct clksrc_clk clk_hclk_psys = {
129 .clk = { 138 .clk = {
130 .name = "hclk_psys", 139 .name = "hclk_psys",
@@ -155,18 +164,12 @@ static int s5pv210_clk_ip3_ctrl(struct clk *clk, int enable)
155 return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable); 164 return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable);
156} 165}
157 166
158static struct clk clk_p83 = {
159 .name = "pclk83",
160 .id = -1,
161};
162
163static struct clk clk_p66 = { 167static struct clk clk_p66 = {
164 .name = "pclk66", 168 .name = "pclk66",
165 .id = -1, 169 .id = -1,
166}; 170};
167 171
168static struct clk *sys_clks[] = { 172static struct clk *sys_clks[] = {
169 &clk_p83,
170 &clk_p66 173 &clk_p66
171}; 174};
172 175
@@ -397,6 +400,7 @@ static struct clksrc_clk *sysclks[] = {
397 &clk_hclk_dsys, 400 &clk_hclk_dsys,
398 &clk_hclk_psys, 401 &clk_hclk_psys,
399 &clk_pclk_msys, 402 &clk_pclk_msys,
403 &clk_pclk_dsys,
400}; 404};
401 405
402#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 406#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
@@ -410,7 +414,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
410 unsigned long hclk_dsys; 414 unsigned long hclk_dsys;
411 unsigned long hclk_psys; 415 unsigned long hclk_psys;
412 unsigned long pclk_msys; 416 unsigned long pclk_msys;
413 unsigned long pclk83; 417 unsigned long pclk_dsys;
414 unsigned long pclk66; 418 unsigned long pclk66;
415 unsigned long apll; 419 unsigned long apll;
416 unsigned long mpll; 420 unsigned long mpll;
@@ -450,19 +454,18 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
450 hclk_dsys = clk_get_rate(&clk_hclk_dsys.clk); 454 hclk_dsys = clk_get_rate(&clk_hclk_dsys.clk);
451 hclk_psys = clk_get_rate(&clk_hclk_psys.clk); 455 hclk_psys = clk_get_rate(&clk_hclk_psys.clk);
452 pclk_msys = clk_get_rate(&clk_pclk_msys.clk); 456 pclk_msys = clk_get_rate(&clk_pclk_msys.clk);
453 pclk83 = hclk_dsys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK83); 457 pclk_dsys = clk_get_rate(&clk_pclk_dsys.clk);
454 pclk66 = hclk_psys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK66); 458 pclk66 = hclk_psys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK66);
455 459
456 printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld\n" 460 printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld\n"
457 "HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n", 461 "HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n",
458 armclk, hclk_msys, hclk_dsys, hclk_psys, 462 armclk, hclk_msys, hclk_dsys, hclk_psys,
459 pclk_msys, pclk83, pclk66); 463 pclk_msys, pclk_dsys, pclk66);
460 464
461 clk_f.rate = armclk; 465 clk_f.rate = armclk;
462 clk_h.rate = hclk_psys; 466 clk_h.rate = hclk_psys;
463 clk_p.rate = pclk66; 467 clk_p.rate = pclk66;
464 clk_p66.rate = pclk66; 468 clk_p66.rate = pclk66;
465 clk_p83.rate = pclk83;
466 469
467 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) 470 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
468 s3c_set_clksrc(&clksrcs[ptr], true); 471 s3c_set_clksrc(&clksrcs[ptr], true);