diff options
author | Zhangfei Gao <zhangfei.gao@linaro.org> | 2013-08-16 16:14:41 +0800 |
---|---|---|
committer | Zhangfei Gao <zhangfei.gao@linaro.org> | 2013-08-16 17:09:57 +0800 |
commit | f3fed1a2022b1d028a44fe88cc5f93774bbe67d0 (patch) | |
tree | c4a35033fee5b6205ce67e0267f1149d442e529a | |
parent | 48a560acb8fae301d7f4519848d7a17dd2aa3dd4 (diff) |
ARM: hs: port hi3xxx_timer_init from linux-nexttracking-hilt-common-clock-v3.9
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
-rw-r--r-- | arch/arm/mach-hs/hs-dt.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/arch/arm/mach-hs/hs-dt.c b/arch/arm/mach-hs/hs-dt.c index dbec66c3f4d7..c3e0636a513e 100644 --- a/arch/arm/mach-hs/hs-dt.c +++ b/arch/arm/mach-hs/hs-dt.c @@ -25,55 +25,24 @@ #include <asm/mach/map.h> #include <asm/mach/time.h> +#include <linux/clocksource.h> #include "core.h" -static struct of_device_id hs_timer_match[] __initdata = { - { .compatible = "arm,sp804", }, - {} -}; - -static struct clk_lookup sp804_lookup = { - .dev_id = "sp804", - .clk = NULL, -}; - static struct of_device_id hs_l2cache_match[] __initdata = { { .compatible = "arm,pl310-cache", }, {} }; -extern void __init hs_init_clocks(void); -static void __init hs_timer_init(void) +static void __init hi3xxx_timer_init(void) { struct device_node *node = NULL; - void __iomem *base; - int irq; int ret; u32 data[2]; hs_map_io(); hs_hotplug_init(); of_clk_init(NULL); - - node = of_find_matching_node(NULL, hs_timer_match); - WARN_ON(!node); - if (!node) { - pr_err("Failed to find sp804 timer\n"); - return; - } - base = of_iomap(node, 0); - WARN_ON(!base); - - /* timer0 is used as clock event, and timer1 is clock source. */ - irq = irq_of_parse_and_map(node, 0); - WARN_ON(!irq); - - sp804_lookup.clk = of_clk_get(node, 0); - clkdev_add(&sp804_lookup); - - __sp804_clocksource_and_sched_clock_init(base + TIMER_2_BASE, "timer1", - sp804_lookup.clk, 1); - __sp804_clockevents_init(base, irq, sp804_lookup.clk, "timer0"); + clocksource_of_init(); node = of_find_matching_node(NULL, hs_l2cache_match); WARN_ON(!node); @@ -104,7 +73,7 @@ DT_MACHINE_START(HS_DT, "Hisilicon Hi36xx/Hi37xx (Flattened Device Tree)") /* Maintainer: Haojian Zhuang <haojian.zhuang@linaro.org> */ .map_io = debug_ll_io_init, .init_irq = irqchip_init, - .init_time = hs_timer_init, + .init_time = hi3xxx_timer_init, .init_machine = hs_init, .dt_compat = hs_compat, .smp = smp_ops(hs_smp_ops), |