diff options
author | Anoop P A <anoop.pa@gmail.com> | 2011-01-25 13:08:16 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-03-25 13:45:13 -0400 |
commit | 3b042d0830463056a669a12362c940a94f7e3cd7 (patch) | |
tree | 0a08c428c8bfe6f7530d676b7240c692ff3b7418 /arch/mips/pmc-sierra | |
parent | 1685f3b158a244d4f6e205e67c84483fffcb2d9f (diff) |
MIPS: MSP71xx: Set up MSP VPE1 timer.
VPE1 timer will be required for VSMP / SMTC.
[Ralf: Fixed a bunch of issues raised by checkpatch.]
Signed-off-by: Anoop P A <anoop.pa@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2049/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/pmc-sierra')
-rw-r--r-- | arch/mips/pmc-sierra/msp71xx/msp_time.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_time.c b/arch/mips/pmc-sierra/msp71xx/msp_time.c index 01df84ce31e2..8b42f307a7a7 100644 --- a/arch/mips/pmc-sierra/msp71xx/msp_time.c +++ b/arch/mips/pmc-sierra/msp71xx/msp_time.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/ptrace.h> | 30 | #include <linux/ptrace.h> |
31 | 31 | ||
32 | #include <asm/cevt-r4k.h> | ||
32 | #include <asm/mipsregs.h> | 33 | #include <asm/mipsregs.h> |
33 | #include <asm/time.h> | 34 | #include <asm/time.h> |
34 | 35 | ||
@@ -36,6 +37,12 @@ | |||
36 | #include <msp_int.h> | 37 | #include <msp_int.h> |
37 | #include <msp_regs.h> | 38 | #include <msp_regs.h> |
38 | 39 | ||
40 | #define get_current_vpe() \ | ||
41 | ((read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE) | ||
42 | |||
43 | static struct irqaction timer_vpe1; | ||
44 | static int tim_installed; | ||
45 | |||
39 | void __init plat_time_init(void) | 46 | void __init plat_time_init(void) |
40 | { | 47 | { |
41 | char *endp, *s; | 48 | char *endp, *s; |
@@ -83,5 +90,12 @@ void __init plat_time_init(void) | |||
83 | 90 | ||
84 | unsigned int __cpuinit get_c0_compare_int(void) | 91 | unsigned int __cpuinit get_c0_compare_int(void) |
85 | { | 92 | { |
86 | return MSP_INT_VPE0_TIMER; | 93 | /* MIPS_MT modes may want timer for second VPE */ |
94 | if ((get_current_vpe()) && !tim_installed) { | ||
95 | memcpy(&timer_vpe1, &c0_compare_irqaction, sizeof(timer_vpe1)); | ||
96 | setup_irq(MSP_INT_VPE1_TIMER, &timer_vpe1); | ||
97 | tim_installed++; | ||
98 | } | ||
99 | |||
100 | return get_current_vpe() ? MSP_INT_VPE1_TIMER : MSP_INT_VPE0_TIMER; | ||
87 | } | 101 | } |