diff options
Diffstat (limited to 'arch/mips/sgi-ip27/ip27-timer.c')
-rw-r--r-- | arch/mips/sgi-ip27/ip27-timer.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index 9cebc9e7da63..8b4e854af925 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c | |||
@@ -160,10 +160,13 @@ static void rt_set_mode(enum clock_event_mode mode, | |||
160 | 160 | ||
161 | int rt_timer_irq; | 161 | int rt_timer_irq; |
162 | 162 | ||
163 | static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent); | ||
164 | static DEFINE_PER_CPU(char [11], hub_rt_name); | ||
165 | |||
163 | static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id) | 166 | static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id) |
164 | { | 167 | { |
165 | struct clock_event_device *cd = dev_id; | ||
166 | unsigned int cpu = smp_processor_id(); | 168 | unsigned int cpu = smp_processor_id(); |
169 | struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); | ||
167 | int slice = cputoslice(cpu); | 170 | int slice = cputoslice(cpu); |
168 | 171 | ||
169 | /* | 172 | /* |
@@ -192,10 +195,7 @@ struct irqaction hub_rt_irqaction = { | |||
192 | #define NSEC_PER_CYCLE 800 | 195 | #define NSEC_PER_CYCLE 800 |
193 | #define CYCLES_PER_SEC (NSEC_PER_SEC / NSEC_PER_CYCLE) | 196 | #define CYCLES_PER_SEC (NSEC_PER_SEC / NSEC_PER_CYCLE) |
194 | 197 | ||
195 | static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent); | 198 | void __cpuinit hub_rt_clock_event_init(void) |
196 | static DEFINE_PER_CPU(char [11], hub_rt_name); | ||
197 | |||
198 | static void __cpuinit hub_rt_clock_event_init(void) | ||
199 | { | 199 | { |
200 | unsigned int cpu = smp_processor_id(); | 200 | unsigned int cpu = smp_processor_id(); |
201 | struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); | 201 | struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); |
@@ -203,17 +203,16 @@ static void __cpuinit hub_rt_clock_event_init(void) | |||
203 | int irq = rt_timer_irq; | 203 | int irq = rt_timer_irq; |
204 | 204 | ||
205 | sprintf(name, "hub-rt %d", cpu); | 205 | sprintf(name, "hub-rt %d", cpu); |
206 | cd->name = "HUB-RT", | 206 | cd->name = name; |
207 | cd->features = CLOCK_EVT_FEAT_ONESHOT, | 207 | cd->features = CLOCK_EVT_FEAT_ONESHOT; |
208 | clockevent_set_clock(cd, CYCLES_PER_SEC); | 208 | clockevent_set_clock(cd, CYCLES_PER_SEC); |
209 | cd->max_delta_ns = clockevent_delta2ns(0xfffffffffffff, cd); | 209 | cd->max_delta_ns = clockevent_delta2ns(0xfffffffffffff, cd); |
210 | cd->min_delta_ns = clockevent_delta2ns(0x300, cd); | 210 | cd->min_delta_ns = clockevent_delta2ns(0x300, cd); |
211 | cd->rating = 200, | 211 | cd->rating = 200; |
212 | cd->irq = irq, | 212 | cd->irq = irq; |
213 | cd->cpumask = cpumask_of_cpu(cpu), | 213 | cd->cpumask = cpumask_of_cpu(cpu); |
214 | cd->rating = 300, | 214 | cd->set_next_event = rt_next_event; |
215 | cd->set_next_event = rt_next_event, | 215 | cd->set_mode = rt_set_mode; |
216 | cd->set_mode = rt_set_mode, | ||
217 | clockevents_register_device(cd); | 216 | clockevents_register_device(cd); |
218 | } | 217 | } |
219 | 218 | ||
@@ -261,6 +260,7 @@ void __init plat_time_init(void) | |||
261 | { | 260 | { |
262 | hub_rt_clocksource_init(); | 261 | hub_rt_clocksource_init(); |
263 | hub_rt_clock_event_global_init(); | 262 | hub_rt_clock_event_global_init(); |
263 | hub_rt_clock_event_init(); | ||
264 | } | 264 | } |
265 | 265 | ||
266 | void __cpuinit cpu_time_init(void) | 266 | void __cpuinit cpu_time_init(void) |
@@ -281,7 +281,6 @@ void __cpuinit cpu_time_init(void) | |||
281 | 281 | ||
282 | printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed); | 282 | printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed); |
283 | 283 | ||
284 | hub_rt_clock_event_init(); | ||
285 | set_c0_status(SRB_TIMOCLK); | 284 | set_c0_status(SRB_TIMOCLK); |
286 | } | 285 | } |
287 | 286 | ||