aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear6xx/spear6xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-spear6xx/spear6xx.c')
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index f2fe14e8471d..9cd3a688f6dc 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -155,3 +155,34 @@ void __init spear6xx_map_io(void)
155 /* This will initialize clock framework */ 155 /* This will initialize clock framework */
156 clk_init(); 156 clk_init();
157} 157}
158
159static void __init spear6xx_timer_init(void)
160{
161 char pclk_name[] = "pll3_48m_clk";
162 struct clk *gpt_clk, *pclk;
163
164 /* get the system timer clock */
165 gpt_clk = clk_get_sys("gpt0", NULL);
166 if (IS_ERR(gpt_clk)) {
167 pr_err("%s:couldn't get clk for gpt\n", __func__);
168 BUG();
169 }
170
171 /* get the suitable parent clock for timer*/
172 pclk = clk_get(NULL, pclk_name);
173 if (IS_ERR(pclk)) {
174 pr_err("%s:couldn't get %s as parent for gpt\n",
175 __func__, pclk_name);
176 BUG();
177 }
178
179 clk_set_parent(gpt_clk, pclk);
180 clk_put(gpt_clk);
181 clk_put(pclk);
182
183 spear_setup_timer();
184}
185
186struct sys_timer spear6xx_timer = {
187 .init = spear6xx_timer_init,
188};