diff options
author | Mark Salter <msalter@redhat.com> | 2010-10-27 12:28:57 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2010-10-27 12:28:57 -0400 |
commit | 730c1fad0ee22a170d2ee76a904709ee304931c0 (patch) | |
tree | 365289c84b02c5c54d43238f2bc9b14b143cafbc /arch/mn10300/kernel/smp.c | |
parent | 2502c64eeb125c5d57e3e7dc38320b500d69e088 (diff) |
MN10300: Generic time support
Implement generic time support for MN10300.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300/kernel/smp.c')
-rw-r--r-- | arch/mn10300/kernel/smp.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c index b80234c28e0d..0dcd1c686ba8 100644 --- a/arch/mn10300/kernel/smp.c +++ b/arch/mn10300/kernel/smp.c | |||
@@ -126,7 +126,6 @@ static struct irq_chip mn10300_ipi_type = { | |||
126 | 126 | ||
127 | static irqreturn_t smp_reschedule_interrupt(int irq, void *dev_id); | 127 | static irqreturn_t smp_reschedule_interrupt(int irq, void *dev_id); |
128 | static irqreturn_t smp_call_function_interrupt(int irq, void *dev_id); | 128 | static irqreturn_t smp_call_function_interrupt(int irq, void *dev_id); |
129 | static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id); | ||
130 | 129 | ||
131 | static struct irqaction reschedule_ipi = { | 130 | static struct irqaction reschedule_ipi = { |
132 | .handler = smp_reschedule_interrupt, | 131 | .handler = smp_reschedule_interrupt, |
@@ -136,11 +135,15 @@ static struct irqaction call_function_ipi = { | |||
136 | .handler = smp_call_function_interrupt, | 135 | .handler = smp_call_function_interrupt, |
137 | .name = "smp call function IPI" | 136 | .name = "smp call function IPI" |
138 | }; | 137 | }; |
138 | |||
139 | #if !defined(CONFIG_GENERIC_CLOCKEVENTS) || defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) | ||
140 | static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id); | ||
139 | static struct irqaction local_timer_ipi = { | 141 | static struct irqaction local_timer_ipi = { |
140 | .handler = smp_ipi_timer_interrupt, | 142 | .handler = smp_ipi_timer_interrupt, |
141 | .flags = IRQF_DISABLED, | 143 | .flags = IRQF_DISABLED, |
142 | .name = "smp local timer IPI" | 144 | .name = "smp local timer IPI" |
143 | }; | 145 | }; |
146 | #endif | ||
144 | 147 | ||
145 | /** | 148 | /** |
146 | * init_ipi - Initialise the IPI mechanism | 149 | * init_ipi - Initialise the IPI mechanism |
@@ -165,11 +168,14 @@ static void init_ipi(void) | |||
165 | mn10300_ipi_enable(CALL_FUNC_SINGLE_IPI); | 168 | mn10300_ipi_enable(CALL_FUNC_SINGLE_IPI); |
166 | 169 | ||
167 | /* set up the local timer IPI */ | 170 | /* set up the local timer IPI */ |
171 | #if !defined(CONFIG_GENERIC_CLOCKEVENTS) || \ | ||
172 | defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) | ||
168 | set_irq_chip_and_handler(LOCAL_TIMER_IPI, | 173 | set_irq_chip_and_handler(LOCAL_TIMER_IPI, |
169 | &mn10300_ipi_type, handle_percpu_irq); | 174 | &mn10300_ipi_type, handle_percpu_irq); |
170 | setup_irq(LOCAL_TIMER_IPI, &local_timer_ipi); | 175 | setup_irq(LOCAL_TIMER_IPI, &local_timer_ipi); |
171 | set_intr_level(LOCAL_TIMER_IPI, LOCAL_TIMER_GxICR_LV); | 176 | set_intr_level(LOCAL_TIMER_IPI, LOCAL_TIMER_GxICR_LV); |
172 | mn10300_ipi_enable(LOCAL_TIMER_IPI); | 177 | mn10300_ipi_enable(LOCAL_TIMER_IPI); |
178 | #endif | ||
173 | 179 | ||
174 | #ifdef CONFIG_MN10300_CACHE_ENABLED | 180 | #ifdef CONFIG_MN10300_CACHE_ENABLED |
175 | /* set up the cache flush IPI */ | 181 | /* set up the cache flush IPI */ |
@@ -505,6 +511,8 @@ void smp_nmi_call_function_interrupt(void) | |||
505 | } | 511 | } |
506 | } | 512 | } |
507 | 513 | ||
514 | #if !defined(CONFIG_GENERIC_CLOCKEVENTS) || \ | ||
515 | defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) | ||
508 | /** | 516 | /** |
509 | * smp_ipi_timer_interrupt - Local timer IPI handler | 517 | * smp_ipi_timer_interrupt - Local timer IPI handler |
510 | * @irq: The interrupt number. | 518 | * @irq: The interrupt number. |
@@ -516,6 +524,7 @@ static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id) | |||
516 | { | 524 | { |
517 | return local_timer_interrupt(); | 525 | return local_timer_interrupt(); |
518 | } | 526 | } |
527 | #endif | ||
519 | 528 | ||
520 | void __init smp_init_cpus(void) | 529 | void __init smp_init_cpus(void) |
521 | { | 530 | { |
@@ -620,7 +629,6 @@ void smp_prepare_cpu_init(void) | |||
620 | int __init start_secondary(void *unused) | 629 | int __init start_secondary(void *unused) |
621 | { | 630 | { |
622 | smp_cpu_init(); | 631 | smp_cpu_init(); |
623 | |||
624 | smp_callin(); | 632 | smp_callin(); |
625 | while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) | 633 | while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) |
626 | cpu_relax(); | 634 | cpu_relax(); |
@@ -629,6 +637,9 @@ int __init start_secondary(void *unused) | |||
629 | preempt_disable(); | 637 | preempt_disable(); |
630 | smp_online(); | 638 | smp_online(); |
631 | 639 | ||
640 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
641 | init_clockevents(); | ||
642 | #endif | ||
632 | cpu_idle(); | 643 | cpu_idle(); |
633 | return 0; | 644 | return 0; |
634 | } | 645 | } |