Commit af90f10d authored by Santosh Shilimkar's avatar Santosh Shilimkar Committed by Russell King

ARM: 6759/1: smp: Select local timers vs broadcast timer support runtime

The current code support of dummy timers in absence of local
timer is compile time. This is an attempt to convert it to runtime
so that on few SOC version if the local timers aren't supported
kernel can switch to dummy timers. OMAP4430 ES1.0 does suffer from
this limitation.

This patch should not have any functional impact on affected
files.

Cc: Daniel Walker <dwalker@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarDavid Brown <davidb@codeaurora.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d77e270c
...@@ -44,8 +44,14 @@ int local_timer_ack(void); ...@@ -44,8 +44,14 @@ int local_timer_ack(void);
/* /*
* Setup a local timer interrupt for a CPU. * Setup a local timer interrupt for a CPU.
*/ */
void local_timer_setup(struct clock_event_device *); int local_timer_setup(struct clock_event_device *);
#else
static inline int local_timer_setup(struct clock_event_device *evt)
{
return -ENXIO;
}
#endif #endif
#endif #endif
...@@ -474,13 +474,12 @@ static void smp_timer_broadcast(const struct cpumask *mask) ...@@ -474,13 +474,12 @@ static void smp_timer_broadcast(const struct cpumask *mask)
#define smp_timer_broadcast NULL #define smp_timer_broadcast NULL
#endif #endif
#ifndef CONFIG_LOCAL_TIMERS
static void broadcast_timer_set_mode(enum clock_event_mode mode, static void broadcast_timer_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt) struct clock_event_device *evt)
{ {
} }
static void local_timer_setup(struct clock_event_device *evt) static void broadcast_timer_setup(struct clock_event_device *evt)
{ {
evt->name = "dummy_timer"; evt->name = "dummy_timer";
evt->features = CLOCK_EVT_FEAT_ONESHOT | evt->features = CLOCK_EVT_FEAT_ONESHOT |
...@@ -492,7 +491,6 @@ static void local_timer_setup(struct clock_event_device *evt) ...@@ -492,7 +491,6 @@ static void local_timer_setup(struct clock_event_device *evt)
clockevents_register_device(evt); clockevents_register_device(evt);
} }
#endif
void __cpuinit percpu_timer_setup(void) void __cpuinit percpu_timer_setup(void)
{ {
...@@ -502,7 +500,8 @@ void __cpuinit percpu_timer_setup(void) ...@@ -502,7 +500,8 @@ void __cpuinit percpu_timer_setup(void)
evt->cpumask = cpumask_of(cpu); evt->cpumask = cpumask_of(cpu);
evt->broadcast = smp_timer_broadcast; evt->broadcast = smp_timer_broadcast;
local_timer_setup(evt); if (local_timer_setup(evt))
broadcast_timer_setup(evt);
} }
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
......
...@@ -255,7 +255,7 @@ static void __init msm_timer_init(void) ...@@ -255,7 +255,7 @@ static void __init msm_timer_init(void)
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER]; struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
...@@ -287,6 +287,7 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt) ...@@ -287,6 +287,7 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt)
gic_enable_ppi(clock->irq.irq); gic_enable_ppi(clock->irq.irq);
clockevents_register_device(evt); clockevents_register_device(evt);
return 0;
} }
inline int local_timer_ack(void) inline int local_timer_ack(void)
......
...@@ -26,9 +26,10 @@ ...@@ -26,9 +26,10 @@
/* /*
* Setup the local clock events for a CPU. * Setup the local clock events for a CPU.
*/ */
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
evt->irq = OMAP44XX_IRQ_LOCALTIMER; evt->irq = OMAP44XX_IRQ_LOCALTIMER;
twd_timer_setup(evt); twd_timer_setup(evt);
return 0;
} }
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
/* /*
* Setup the local clock events for a CPU. * Setup the local clock events for a CPU.
*/ */
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
evt->irq = IRQ_LOCALTIMER; evt->irq = IRQ_LOCALTIMER;
twd_timer_setup(evt); twd_timer_setup(evt);
return 0;
} }
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
/* /*
* Setup the local clock events for a CPU. * Setup the local clock events for a CPU.
*/ */
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
evt->irq = 29; evt->irq = 29;
twd_timer_setup(evt); twd_timer_setup(evt);
return 0;
} }
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
/* /*
* Setup the local clock events for a CPU. * Setup the local clock events for a CPU.
*/ */
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
evt->irq = IRQ_LOCALTIMER; evt->irq = IRQ_LOCALTIMER;
twd_timer_setup(evt); twd_timer_setup(evt);
return 0;
} }
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
/* /*
* Setup the local clock events for a CPU. * Setup the local clock events for a CPU.
*/ */
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
evt->irq = IRQ_LOCALTIMER; evt->irq = IRQ_LOCALTIMER;
twd_timer_setup(evt); twd_timer_setup(evt);
return 0;
} }
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
/* /*
* Setup the local clock events for a CPU. * Setup the local clock events for a CPU.
*/ */
void __cpuinit local_timer_setup(struct clock_event_device *evt) int __cpuinit local_timer_setup(struct clock_event_device *evt)
{ {
evt->irq = IRQ_LOCALTIMER; evt->irq = IRQ_LOCALTIMER;
twd_timer_setup(evt); twd_timer_setup(evt);
return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment