aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-01-20 05:47:00 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2012-04-27 08:35:34 -0400
commit273d16adbccdfe3e4a9d02d286b8f1d76dc9e63f (patch)
treeba71c8bef1f9887acbd977e7cc2ee66fdb6d2d25
parent0075242b3a2f78901172aaadf73beed762a1f02f (diff)
ARM: architected timers: add support for UP timer
If CONFIG_LOCAL_TIMERS is not defined, let the architected timer driver register a single clock_event_device that is used as a global timer. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--arch/arm/kernel/arch_timer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c
index 1a34eeebc26e..154f0a1756b1 100644
--- a/arch/arm/kernel/arch_timer.c
+++ b/arch/arm/kernel/arch_timer.c
@@ -246,6 +246,8 @@ static struct local_timer_ops arch_timer_ops __cpuinitdata = {
246 .stop = arch_timer_stop, 246 .stop = arch_timer_stop,
247}; 247};
248 248
249static struct clock_event_device arch_timer_global_evt;
250
249static int __init arch_timer_common_register(void) 251static int __init arch_timer_common_register(void)
250{ 252{
251 int err; 253 int err;
@@ -280,6 +282,17 @@ static int __init arch_timer_common_register(void)
280 } 282 }
281 283
282 err = local_timer_register(&arch_timer_ops); 284 err = local_timer_register(&arch_timer_ops);
285 if (err) {
286 /*
287 * We couldn't register as a local timer (could be
288 * because we're on a UP platform, or because some
289 * other local timer is already present...). Try as a
290 * global timer instead.
291 */
292 arch_timer_global_evt.cpumask = cpumask_of(0);
293 err = arch_timer_setup(&arch_timer_global_evt);
294 }
295
283 if (err) 296 if (err)
284 goto out_free_irq; 297 goto out_free_irq;
285 298