aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-u300/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-u300/timer.c')
-rw-r--r--arch/arm/mach-u300/timer.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 3ec58bd2d6e..891cf44591e 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -333,20 +333,6 @@ static struct irqaction u300_timer_irq = {
333 .handler = u300_timer_interrupt, 333 .handler = u300_timer_interrupt,
334}; 334};
335 335
336/* Use general purpose timer 2 as clock source */
337static cycle_t u300_get_cycles(struct clocksource *cs)
338{
339 return (cycles_t) readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
340}
341
342static struct clocksource clocksource_u300_1mhz = {
343 .name = "GPT2",
344 .rating = 300, /* Reasonably fast and accurate clock source */
345 .read = u300_get_cycles,
346 .mask = CLOCKSOURCE_MASK(32), /* 32 bits */
347 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
348};
349
350/* 336/*
351 * Override the global weak sched_clock symbol with this 337 * Override the global weak sched_clock symbol with this
352 * local implementation which uses the clocksource to get some 338 * local implementation which uses the clocksource to get some
@@ -422,7 +408,9 @@ static void __init u300_timer_init(void)
422 writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE, 408 writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE,
423 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2); 409 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2);
424 410
425 if (clocksource_register_hz(&clocksource_u300_1mhz, rate)) 411 /* Use general purpose timer 2 as clock source */
412 if (clocksource_mmio_init(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC,
413 "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
426 printk(KERN_ERR "timer: failed to initialize clock " 414 printk(KERN_ERR "timer: failed to initialize clock "
427 "source %s\n", clocksource_u300_1mhz.name); 415 "source %s\n", clocksource_u300_1mhz.name);
428 416