All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] set up MSP VPE1 timer.
@ 2011-01-25  8:19 Anoop P.A
  2011-01-25 18:08 ` [PATCH v1 " Anoop P A
  0 siblings, 1 reply; 4+ messages in thread
From: Anoop P.A @ 2011-01-25  8:19 UTC (permalink / raw)
  To: ralf, linux-mips, linux-kernel; +Cc: Anoop P A

From: Anoop P A <anoop.pa@gmail.com>

VPE1 timer will be required for MIPS_MT modes ( VSMP / SMTC ).
This patch will setup will setup VPE1 timer irq.This has been
tested with both SMTC and VSMP

Signed-off-by: Anoop P A <anoop.pa@gmail.com>
---
 arch/mips/pmc-sierra/msp71xx/msp_time.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/mips/pmc-sierra/msp71xx/msp_time.c b/arch/mips/pmc-sierra/msp71xx/msp_time.c
index 01df84c..b6c2d33 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_time.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_time.c
@@ -36,6 +36,13 @@
 #include <msp_int.h>
 #include <msp_regs.h>
 
+#define get_current_vpe()   \
+	((read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE)
+
+extern struct irqaction c0_compare_irqaction;
+static struct irqaction timer_vpe1;
+static int tim_installed;
+
 void __init plat_time_init(void)
 {
 	char    *endp, *s;
@@ -83,5 +90,11 @@ void __init plat_time_init(void)
 
 unsigned int __cpuinit get_c0_compare_int(void)
 {
-	return MSP_INT_VPE0_TIMER;
+	/* MIPS_MT modes may want timer for second VPE */
+	if ((get_current_vpe()) && !tim_installed) {
+		memcpy(&timer_vpe1, &c0_compare_irqaction, sizeof(timer_vpe1));
+		setup_irq(MSP_INT_VPE1_TIMER, &timer_vpe1);
+		tim_installed++;
+	}
+	return (get_current_vpe() ? MSP_INT_VPE1_TIMER : MSP_INT_VPE0_TIMER);
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/6] set up MSP VPE1 timer.
  2011-01-25 18:08 ` [PATCH v1 " Anoop P A
@ 2011-01-25 17:58   ` Sergei Shtylyov
  2011-02-11 14:54   ` Ralf Baechle
  1 sibling, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2011-01-25 17:58 UTC (permalink / raw)
  To: Anoop P A; +Cc: ralf, linux-mips, linux-kernel

Hello.

Anoop P A wrote:

> Changes since original:
> Corrected repeated word in comment

    These comments should *follow* the --- tear line, or Ralf will have to 
hand-edit them out of your patch. I think I've already written to you about this...

> ---
> VPE1 timer will be required for MIPS_MT modes ( VSMP / SMTC ).
> This patch will setup VPE1 timer irq.This has been tested with
> both SMTC and VSMP

> Signed-off-by: Anoop P A <anoop.pa@gmail.com>

WBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/6] set up MSP VPE1 timer.
  2011-01-25  8:19 [PATCH 1/6] set up MSP VPE1 timer Anoop P.A
@ 2011-01-25 18:08 ` Anoop P A
  2011-01-25 17:58   ` Sergei Shtylyov
  2011-02-11 14:54   ` Ralf Baechle
  0 siblings, 2 replies; 4+ messages in thread
From: Anoop P A @ 2011-01-25 18:08 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips, linux-kernel

Changes since original:
Corrected repeated word in comment
---
VPE1 timer will be required for MIPS_MT modes ( VSMP / SMTC ).
This patch will setup VPE1 timer irq.This has been tested with
both SMTC and VSMP

Signed-off-by: Anoop P A <anoop.pa@gmail.com>
---
 arch/mips/pmc-sierra/msp71xx/msp_time.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/mips/pmc-sierra/msp71xx/msp_time.c
b/arch/mips/pmc-sierra/msp71xx/msp_time.c
index 01df84c..b6c2d33 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_time.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_time.c
@@ -36,6 +36,13 @@
 #include <msp_int.h>
 #include <msp_regs.h>
 
+#define get_current_vpe()   \
+	((read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE)
+
+extern struct irqaction c0_compare_irqaction;
+static struct irqaction timer_vpe1;
+static int tim_installed;
+
 void __init plat_time_init(void)
 {
 	char    *endp, *s;
@@ -83,5 +90,11 @@ void __init plat_time_init(void)
 
 unsigned int __cpuinit get_c0_compare_int(void)
 {
-	return MSP_INT_VPE0_TIMER;
+	/* MIPS_MT modes may want timer for second VPE */
+	if ((get_current_vpe()) && !tim_installed) {
+		memcpy(&timer_vpe1, &c0_compare_irqaction, sizeof(timer_vpe1));
+		setup_irq(MSP_INT_VPE1_TIMER, &timer_vpe1);
+		tim_installed++;
+	}
+	return (get_current_vpe() ? MSP_INT_VPE1_TIMER : MSP_INT_VPE0_TIMER);
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/6] set up MSP VPE1 timer.
  2011-01-25 18:08 ` [PATCH v1 " Anoop P A
  2011-01-25 17:58   ` Sergei Shtylyov
@ 2011-02-11 14:54   ` Ralf Baechle
  1 sibling, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2011-02-11 14:54 UTC (permalink / raw)
  To: Anoop P A; +Cc: linux-mips, linux-kernel

On Tue, Jan 25, 2011 at 11:38:16PM +0530, Anoop P A wrote:

Queued for 2.6.39 - but you really should run your patches through
checkpatch.pl before posting them.

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-11 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25  8:19 [PATCH 1/6] set up MSP VPE1 timer Anoop P.A
2011-01-25 18:08 ` [PATCH v1 " Anoop P A
2011-01-25 17:58   ` Sergei Shtylyov
2011-02-11 14:54   ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.