diff options
Diffstat (limited to 'drivers/clocksource/timer-marco.c')
-rw-r--r-- | drivers/clocksource/timer-marco.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c index 09a17d9a6594..b52e1c078b99 100644 --- a/drivers/clocksource/timer-marco.c +++ b/drivers/clocksource/timer-marco.c | |||
@@ -19,7 +19,8 @@ | |||
19 | #include <linux/of_irq.h> | 19 | #include <linux/of_irq.h> |
20 | #include <linux/of_address.h> | 20 | #include <linux/of_address.h> |
21 | #include <linux/sched_clock.h> | 21 | #include <linux/sched_clock.h> |
22 | #include <asm/mach/time.h> | 22 | |
23 | #define MARCO_CLOCK_FREQ 1000000 | ||
23 | 24 | ||
24 | #define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 | 25 | #define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 |
25 | #define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 | 26 | #define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 |
@@ -191,7 +192,7 @@ static int sirfsoc_local_timer_setup(struct clock_event_device *ce) | |||
191 | ce->rating = 200; | 192 | ce->rating = 200; |
192 | ce->set_mode = sirfsoc_timer_set_mode; | 193 | ce->set_mode = sirfsoc_timer_set_mode; |
193 | ce->set_next_event = sirfsoc_timer_set_next_event; | 194 | ce->set_next_event = sirfsoc_timer_set_next_event; |
194 | clockevents_calc_mult_shift(ce, CLOCK_TICK_RATE, 60); | 195 | clockevents_calc_mult_shift(ce, MARCO_CLOCK_FREQ, 60); |
195 | ce->max_delta_ns = clockevent_delta2ns(-2, ce); | 196 | ce->max_delta_ns = clockevent_delta2ns(-2, ce); |
196 | ce->min_delta_ns = clockevent_delta2ns(2, ce); | 197 | ce->min_delta_ns = clockevent_delta2ns(2, ce); |
197 | ce->cpumask = cpumask_of(cpu); | 198 | ce->cpumask = cpumask_of(cpu); |
@@ -263,11 +264,11 @@ static void __init sirfsoc_marco_timer_init(void) | |||
263 | BUG_ON(IS_ERR(clk)); | 264 | BUG_ON(IS_ERR(clk)); |
264 | rate = clk_get_rate(clk); | 265 | rate = clk_get_rate(clk); |
265 | 266 | ||
266 | BUG_ON(rate < CLOCK_TICK_RATE); | 267 | BUG_ON(rate < MARCO_CLOCK_FREQ); |
267 | BUG_ON(rate % CLOCK_TICK_RATE); | 268 | BUG_ON(rate % MARCO_CLOCK_FREQ); |
268 | 269 | ||
269 | /* Initialize the timer dividers */ | 270 | /* Initialize the timer dividers */ |
270 | timer_div = rate / CLOCK_TICK_RATE - 1; | 271 | timer_div = rate / MARCO_CLOCK_FREQ - 1; |
271 | writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); | 272 | writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); |
272 | writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); | 273 | writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); |
273 | writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); | 274 | writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); |
@@ -283,7 +284,7 @@ static void __init sirfsoc_marco_timer_init(void) | |||
283 | /* Clear all interrupts */ | 284 | /* Clear all interrupts */ |
284 | writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); | 285 | writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); |
285 | 286 | ||
286 | BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); | 287 | BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, MARCO_CLOCK_FREQ)); |
287 | 288 | ||
288 | sirfsoc_clockevent_init(); | 289 | sirfsoc_clockevent_init(); |
289 | } | 290 | } |