diff options
author | Paul Burton <paul.burton@imgtec.com> | 2014-03-05 12:35:53 +0100 |
---|---|---|
committer | Paul Burton <paul.burton@imgtec.com> | 2014-05-02 17:39:11 +0200 |
commit | 414408d0eedd782a397ba89fd8f732ffbd3acde8 (patch) | |
tree | a747abf36d79d04d5a916a4e6fc230ccdf1776e7 /arch/mips/kernel/irq-gic.c | |
parent | MIPS: mark GIC clockevent device with CLOCK_EVT_FEAT_C3STOP (diff) | |
download | linux-414408d0eedd782a397ba89fd8f732ffbd3acde8.tar.xz linux-414408d0eedd782a397ba89fd8f732ffbd3acde8.zip |
MIPS: allow GIC clockevent device config from other CPUs
This patch allows the GIC clockevent device for a CPU to be configured
by another CPU. This makes GIC clockevent devices suitable for use as
the tick broadcast device, where formerly the GIC timer local to the
configuring CPU would have been configured incorrectly.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Diffstat (limited to 'arch/mips/kernel/irq-gic.c')
-rw-r--r-- | arch/mips/kernel/irq-gic.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c index 8520dad6d4e3..88e4c323382c 100644 --- a/arch/mips/kernel/irq-gic.c +++ b/arch/mips/kernel/irq-gic.c @@ -54,6 +54,21 @@ void gic_write_compare(cycle_t cnt) (int)(cnt & 0xffffffff)); } +void gic_write_cpu_compare(cycle_t cnt, int cpu) +{ + unsigned long flags; + + local_irq_save(flags); + + GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), cpu); + GICWRITE(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_HI), + (int)(cnt >> 32)); + GICWRITE(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_LO), + (int)(cnt & 0xffffffff)); + + local_irq_restore(flags); +} + cycle_t gic_read_compare(void) { unsigned int hi, lo; |