aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorThomas Abraham <thomas.ab@samsung.com>2010-05-16 20:38:31 -0400
committerBen Dooks <ben-linux@fluff.org>2010-05-16 21:37:34 -0400
commit374e0bf5f9e3b6055a943a838605e411b50c2838 (patch)
treea3628962e9405e1c085521437271355930c54826 /arch/arm
parentc62ec6a9aaabd5d0512e9d091d82940efefa4fa6 (diff)
ARM: S5PV210: Add armclk of clksrc_clk clock type
This patch modifies the following. 1. Adds arm clock 'clk_armclk' of type clksrc_clk clock type. 2. Adds arm clock to the list of system clocks 'sysclks' for registering it along with other system clocks. 3. Modifies the armclk clock rate calculation procedure to be based on the new clk_armclk clock. 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')
-rw-r--r--arch/arm/mach-s5pv210/clock.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index d782fed0c76e..f57fa1ee6ff0 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -58,6 +58,26 @@ static struct clksrc_clk clk_mout_mpll = {
58 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 4, .size = 1 }, 58 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 4, .size = 1 },
59}; 59};
60 60
61static struct clk *clkset_armclk_list[] = {
62 [0] = &clk_mout_apll.clk,
63 [1] = &clk_mout_mpll.clk,
64};
65
66static struct clksrc_sources clkset_armclk = {
67 .sources = clkset_armclk_list,
68 .nr_sources = ARRAY_SIZE(clkset_armclk_list),
69};
70
71static struct clksrc_clk clk_armclk = {
72 .clk = {
73 .name = "armclk",
74 .id = -1,
75 },
76 .sources = &clkset_armclk,
77 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 16, .size = 1 },
78 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 0, .size = 3 },
79};
80
61static int s5pv210_clk_ip0_ctrl(struct clk *clk, int enable) 81static int s5pv210_clk_ip0_ctrl(struct clk *clk, int enable)
62{ 82{
63 return s5p_gatectrl(S5P_CLKGATE_IP0, clk, enable); 83 return s5p_gatectrl(S5P_CLKGATE_IP0, clk, enable);
@@ -328,6 +348,7 @@ static struct clksrc_clk *sysclks[] = {
328 &clk_mout_apll, 348 &clk_mout_apll,
329 &clk_mout_epll, 349 &clk_mout_epll,
330 &clk_mout_mpll, 350 &clk_mout_mpll,
351 &clk_armclk,
331}; 352};
332 353
333#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 354#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
@@ -376,7 +397,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
376 printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld", 397 printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld",
377 apll, mpll, epll); 398 apll, mpll, epll);
378 399
379 armclk = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_APLL); 400 armclk = clk_get_rate(&clk_armclk.clk);
380 if (__raw_readl(S5P_CLK_SRC0) & S5P_CLKSRC0_MUX200_MASK) 401 if (__raw_readl(S5P_CLK_SRC0) & S5P_CLKSRC0_MUX200_MASK)
381 hclk200 = mpll / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK200); 402 hclk200 = mpll / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK200);
382 else 403 else