diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2011-08-04 06:57:04 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2012-03-13 09:29:58 -0400 |
commit | 7c380f273cf09b202e4bc9cbe137aef1870b8a20 (patch) | |
tree | 1731276247100c90a24462f08bf1c722e1573c39 /arch/arm/mach-realview/realview_pb11mp.c | |
parent | a45c983f85328be9d0540a6b8250609dbf16872c (diff) |
ARM: plat-versatile: convert to twd_local_timer_register() interface
Add support for the new smp_twd runtime registration interface
to the RealView/VE platforms, and remove the old compile-time support.
Tested on EB11MP.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/mach-realview/realview_pb11mp.c')
-rw-r--r-- | arch/arm/mach-realview/realview_pb11mp.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 2147335f66f5..3bea5bd0221d 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
37 | #include <asm/hardware/gic.h> | 37 | #include <asm/hardware/gic.h> |
38 | #include <asm/hardware/cache-l2x0.h> | 38 | #include <asm/hardware/cache-l2x0.h> |
39 | #include <asm/localtimer.h> | 39 | #include <asm/smp_twd.h> |
40 | 40 | ||
41 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
42 | #include <asm/mach/flash.h> | 42 | #include <asm/mach/flash.h> |
@@ -290,6 +290,21 @@ static void __init gic_init_irq(void) | |||
290 | gic_cascade_irq(1, IRQ_TC11MP_PB_IRQ1); | 290 | gic_cascade_irq(1, IRQ_TC11MP_PB_IRQ1); |
291 | } | 291 | } |
292 | 292 | ||
293 | #ifdef CONFIG_HAVE_ARM_TWD | ||
294 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, | ||
295 | REALVIEW_TC11MP_TWD_BASE, | ||
296 | IRQ_LOCALTIMER); | ||
297 | |||
298 | static void __init realview_pb11mp_twd_init(void) | ||
299 | { | ||
300 | int err = twd_local_timer_register(&twd_local_timer); | ||
301 | if (err) | ||
302 | pr_err("twd_local_timer_register failed %d\n", err); | ||
303 | } | ||
304 | #else | ||
305 | #define realview_pb11mp_twd_init() do {} while(0) | ||
306 | #endif | ||
307 | |||
293 | static void __init realview_pb11mp_timer_init(void) | 308 | static void __init realview_pb11mp_timer_init(void) |
294 | { | 309 | { |
295 | timer0_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE); | 310 | timer0_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE); |
@@ -297,10 +312,8 @@ static void __init realview_pb11mp_timer_init(void) | |||
297 | timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); | 312 | timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); |
298 | timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; | 313 | timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; |
299 | 314 | ||
300 | #ifdef CONFIG_LOCAL_TIMERS | ||
301 | twd_base = __io_address(REALVIEW_TC11MP_TWD_BASE); | ||
302 | #endif | ||
303 | realview_timer_init(IRQ_TC11MP_TIMER0_1); | 315 | realview_timer_init(IRQ_TC11MP_TIMER0_1); |
316 | realview_pb11mp_twd_init(); | ||
304 | } | 317 | } |
305 | 318 | ||
306 | static struct sys_timer realview_pb11mp_timer = { | 319 | static struct sys_timer realview_pb11mp_timer = { |