diff options
author | Steven J. Hill <Steven.Hill@imgtec.com> | 2013-10-09 11:47:23 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-01-22 14:18:57 -0500 |
commit | 5cf8b2409c8c08f7505925d2ba78f71b362d902e (patch) | |
tree | 600cc2e0e05cbc9fd9756d33bfdfece835fd8dbf /arch/mips/kernel | |
parent | c2c2a644935dcdb287a87bf4f3cccd13bd8d3468 (diff) |
MIPS: GIC: Send IPIs using the GIC
If GIC is present, then use it to send IPIs between the cores.
Using GIC for IPIs is simpler and is usable for multicore
systems compared to the existing way of doing IPIs where all VPEs
had to be disabled for another VPE to access the Cause register
in one of the TCs and enable all the VPEs back.
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6040/
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/smp-mt.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c index 35f8d22d56a9..0fb8cefc9114 100644 --- a/arch/mips/kernel/smp-mt.c +++ b/arch/mips/kernel/smp-mt.c | |||
@@ -113,12 +113,39 @@ static void __init smvp_tc_init(unsigned int tc, unsigned int mvpconf0) | |||
113 | write_tc_c0_tchalt(TCHALT_H); | 113 | write_tc_c0_tchalt(TCHALT_H); |
114 | } | 114 | } |
115 | 115 | ||
116 | #ifdef CONFIG_IRQ_GIC | ||
117 | static void mp_send_ipi_single(int cpu, unsigned int action) | ||
118 | { | ||
119 | unsigned long flags; | ||
120 | |||
121 | local_irq_save(flags); | ||
122 | |||
123 | switch (action) { | ||
124 | case SMP_CALL_FUNCTION: | ||
125 | gic_send_ipi(plat_ipi_call_int_xlate(cpu)); | ||
126 | break; | ||
127 | |||
128 | case SMP_RESCHEDULE_YOURSELF: | ||
129 | gic_send_ipi(plat_ipi_resched_int_xlate(cpu)); | ||
130 | break; | ||
131 | } | ||
132 | |||
133 | local_irq_restore(flags); | ||
134 | } | ||
135 | #endif | ||
136 | |||
116 | static void vsmp_send_ipi_single(int cpu, unsigned int action) | 137 | static void vsmp_send_ipi_single(int cpu, unsigned int action) |
117 | { | 138 | { |
118 | int i; | 139 | int i; |
119 | unsigned long flags; | 140 | unsigned long flags; |
120 | int vpflags; | 141 | int vpflags; |
121 | 142 | ||
143 | #ifdef CONFIG_IRQ_GIC | ||
144 | if (gic_present) { | ||
145 | mp_send_ipi_single(cpu, action); | ||
146 | return; | ||
147 | } | ||
148 | #endif | ||
122 | local_irq_save(flags); | 149 | local_irq_save(flags); |
123 | 150 | ||
124 | vpflags = dvpe(); /* can't access the other CPU's registers whilst MVPE enabled */ | 151 | vpflags = dvpe(); /* can't access the other CPU's registers whilst MVPE enabled */ |