aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear3xx/spear3xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-spear3xx/spear3xx.c')
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index faf87097767d..e12a06c3b85b 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -523,5 +523,35 @@ struct pmx_dev pmx_plgpio_45_46_49_50 = {
523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), 523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
524 .enb_on_reset = 1, 524 .enb_on_reset = 1,
525}; 525};
526#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
526 527
527#endif 528static void __init spear3xx_timer_init(void)
529{
530 char pclk_name[] = "pll3_48m_clk";
531 struct clk *gpt_clk, *pclk;
532
533 /* get the system timer clock */
534 gpt_clk = clk_get_sys("gpt0", NULL);
535 if (IS_ERR(gpt_clk)) {
536 pr_err("%s:couldn't get clk for gpt\n", __func__);
537 BUG();
538 }
539
540 /* get the suitable parent clock for timer*/
541 pclk = clk_get(NULL, pclk_name);
542 if (IS_ERR(pclk)) {
543 pr_err("%s:couldn't get %s as parent for gpt\n",
544 __func__, pclk_name);
545 BUG();
546 }
547
548 clk_set_parent(gpt_clk, pclk);
549 clk_put(gpt_clk);
550 clk_put(pclk);
551
552 spear_setup_timer();
553}
554
555struct sys_timer spear3xx_timer = {
556 .init = spear3xx_timer_init,
557};