diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-01-10 14:44:19 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2012-03-13 09:27:52 -0400 |
commit | a45c983f85328be9d0540a6b8250609dbf16872c (patch) | |
tree | 5738d5204272f50f3a7899c35b887e2b2f529842 | |
parent | d8e0364364d333feb4564bb7d7d983182b34427e (diff) |
ARM: OMAP4: convert to twd_local_timer_register() interface
Add support for the new smp_twd runtime registration interface
to the OMAP4 platforms, and remove the old compile-time support.
Tested on Panda.
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/timer-mpu.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-omap2/timer.c | 22 |
3 files changed, 17 insertions, 45 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index bd76394ccaf8..05c2ffc1030a 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -23,7 +23,6 @@ obj-$(CONFIG_TWL4030_CORE) += omap_twl.o | |||
23 | 23 | ||
24 | # SMP support ONLY available for OMAP4 | 24 | # SMP support ONLY available for OMAP4 |
25 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o | 25 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o |
26 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o | ||
27 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o | 26 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o |
28 | obj-$(CONFIG_ARCH_OMAP4) += omap4-common.o omap-wakeupgen.o \ | 27 | obj-$(CONFIG_ARCH_OMAP4) += omap4-common.o omap-wakeupgen.o \ |
29 | sleep44xx.o | 28 | sleep44xx.o |
diff --git a/arch/arm/mach-omap2/timer-mpu.c b/arch/arm/mach-omap2/timer-mpu.c deleted file mode 100644 index 31c0ac4cd66a..000000000000 --- a/arch/arm/mach-omap2/timer-mpu.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * The MPU local timer source file. In OMAP4, both cortex-a9 cores have | ||
3 | * own timer in it's MPU domain. These timers will be driving the | ||
4 | * linux kernel SMP tick framework when active. These timers are not | ||
5 | * part of the wake up domain. | ||
6 | * | ||
7 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
8 | * | ||
9 | * Author: | ||
10 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
11 | * | ||
12 | * This file is based on arm realview smp platform file. | ||
13 | * Copyright (C) 2002 ARM Ltd. | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License version 2 as | ||
17 | * published by the Free Software Foundation. | ||
18 | */ | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/smp.h> | ||
21 | #include <linux/clockchips.h> | ||
22 | #include <asm/irq.h> | ||
23 | #include <asm/smp_twd.h> | ||
24 | #include <asm/localtimer.h> | ||
25 | |||
26 | /* | ||
27 | * Setup the local clock events for a CPU. | ||
28 | */ | ||
29 | int __cpuinit local_timer_setup(struct clock_event_device *evt) | ||
30 | { | ||
31 | /* Local timers are not supprted on OMAP4430 ES1.0 */ | ||
32 | if (omap_rev() == OMAP4430_REV_ES1_0) | ||
33 | return -ENXIO; | ||
34 | |||
35 | evt->irq = OMAP44XX_IRQ_LOCALTIMER; | ||
36 | twd_timer_setup(evt); | ||
37 | return 0; | ||
38 | } | ||
39 | |||
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 5c9acea95761..c512bac69ec5 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -39,7 +39,7 @@ | |||
39 | 39 | ||
40 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
41 | #include <plat/dmtimer.h> | 41 | #include <plat/dmtimer.h> |
42 | #include <asm/localtimer.h> | 42 | #include <asm/smp_twd.h> |
43 | #include <asm/sched_clock.h> | 43 | #include <asm/sched_clock.h> |
44 | #include "common.h" | 44 | #include "common.h" |
45 | #include <plat/omap_hwmod.h> | 45 | #include <plat/omap_hwmod.h> |
@@ -324,14 +324,26 @@ OMAP_SYS_TIMER(3_secure) | |||
324 | #endif | 324 | #endif |
325 | 325 | ||
326 | #ifdef CONFIG_ARCH_OMAP4 | 326 | #ifdef CONFIG_ARCH_OMAP4 |
327 | static void __init omap4_timer_init(void) | ||
328 | { | ||
329 | #ifdef CONFIG_LOCAL_TIMERS | 327 | #ifdef CONFIG_LOCAL_TIMERS |
330 | twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); | 328 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, |
331 | BUG_ON(!twd_base); | 329 | OMAP44XX_LOCAL_TWD_BASE, |
330 | OMAP44XX_IRQ_LOCALTIMER); | ||
332 | #endif | 331 | #endif |
332 | |||
333 | static void __init omap4_timer_init(void) | ||
334 | { | ||
333 | omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); | 335 | omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); |
334 | omap2_gp_clocksource_init(2, OMAP4_MPU_SOURCE); | 336 | omap2_gp_clocksource_init(2, OMAP4_MPU_SOURCE); |
337 | #ifdef CONFIG_LOCAL_TIMERS | ||
338 | /* Local timers are not supprted on OMAP4430 ES1.0 */ | ||
339 | if (omap_rev() != OMAP4430_REV_ES1_0) { | ||
340 | int err; | ||
341 | |||
342 | err = twd_local_timer_register(&twd_local_timer); | ||
343 | if (err) | ||
344 | pr_err("twd_local_timer_register failed %d\n", err); | ||
345 | } | ||
346 | #endif | ||
335 | } | 347 | } |
336 | OMAP_SYS_TIMER(4) | 348 | OMAP_SYS_TIMER(4) |
337 | #endif | 349 | #endif |