All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2 PATCH 5/6] MIPS: APRP: Add support for Malta CMP platform.
@ 2013-10-17 17:21 Steven J. Hill
  2013-10-17 17:37 ` David Daney
  0 siblings, 1 reply; 4+ messages in thread
From: Steven J. Hill @ 2013-10-17 17:21 UTC (permalink / raw)
  To: linux-mips; +Cc: Deng-Cheng Zhu, ralf, Steven J. Hill

From: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>

Malta with multi-core CM platforms can now use APRP functionality.

Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Reviewed-by: Qais Yousef <Qais.Yousef@imgtec.com>
---
 arch/mips/include/asm/amon.h     |    4 ++--
 arch/mips/mti-malta/malta-amon.c |   24 +++++++++++++++++++++---
 arch/mips/mti-malta/malta-int.c  |   12 ++++++++++++
 3 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/amon.h b/arch/mips/include/asm/amon.h
index c3dc1a6..3bd6e76 100644
--- a/arch/mips/include/asm/amon.h
+++ b/arch/mips/include/asm/amon.h
@@ -3,5 +3,5 @@
  */
 
 int amon_cpu_avail(int);
-void amon_cpu_start(int, unsigned long, unsigned long,
-		    unsigned long, unsigned long);
+int amon_cpu_start(int, unsigned long, unsigned long,
+		   unsigned long, unsigned long);
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c
index 1e47844..917df6d 100644
--- a/arch/mips/mti-malta/malta-amon.c
+++ b/arch/mips/mti-malta/malta-amon.c
@@ -25,6 +25,7 @@
 #include <asm/addrspace.h>
 #include <asm/mips-boards/launch.h>
 #include <asm/mipsmtregs.h>
+#include <asm/vpe.h>
 
 int amon_cpu_avail(int cpu)
 {
@@ -48,7 +49,7 @@ int amon_cpu_avail(int cpu)
 	return 1;
 }
 
-void amon_cpu_start(int cpu,
+int amon_cpu_start(int cpu,
 		    unsigned long pc, unsigned long sp,
 		    unsigned long gp, unsigned long a0)
 {
@@ -56,10 +57,10 @@ void amon_cpu_start(int cpu,
 		(struct cpulaunch  *)CKSEG0ADDR(CPULAUNCH);
 
 	if (!amon_cpu_avail(cpu))
-		return;
+		return -1;
 	if (cpu == smp_processor_id()) {
 		pr_debug("launch: I am cpu%d!\n", cpu);
-		return;
+		return -1;
 	}
 	launch += cpu;
 
@@ -78,4 +79,21 @@ void amon_cpu_start(int cpu,
 		;
 	smp_rmb();	/* Target will be updating flags soon */
 	pr_debug("launch: cpu%d gone!\n", cpu);
+
+	return 0;
+}
+
+#ifdef CONFIG_MIPS_VPE_LOADER
+int vpe_run(struct vpe *v)
+{
+	struct vpe_notifications *n;
+
+	if (amon_cpu_start(aprp_cpu_index(), v->__start, 0, 0, 0) < 0)
+		return -1;
+
+	list_for_each_entry(n, &v->notify, list)
+		n->start(VPE_MODULE_MINOR);
+
+	return 0;
 }
+#endif
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index be4a1092..ea9338d 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -2,6 +2,7 @@
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.
  * Copyright (C) 2001 Ralf Baechle
+ * Copyright (C) 2013 Imagination Technologies Ltd.
  *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
@@ -44,6 +45,7 @@
 #include <asm/gic.h>
 #include <asm/gcmpregs.h>
 #include <asm/setup.h>
+#include <asm/rtlx.h>
 
 int gcmp_present = -1;
 static unsigned long _msc01_biu_base;
@@ -126,6 +128,11 @@ static void malta_hw0_irqdispatch(void)
 	}
 
 	do_IRQ(MALTA_INT_BASE + irq);
+
+#ifdef MIPS_VPE_APSP_API
+	if (aprp_hook)
+		aprp_hook();
+#endif
 }
 
 static void malta_ipi_irqdispatch(void)
@@ -313,6 +320,11 @@ static void ipi_call_dispatch(void)
 
 static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
 {
+#ifdef MIPS_VPE_APSP_API
+	if (aprp_hook)
+		aprp_hook();
+#endif
+
 	scheduler_ipi();
 
 	return IRQ_HANDLED;
-- 
1.7.9.5

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

* Re: [v2 PATCH 5/6] MIPS: APRP: Add support for Malta CMP platform.
  2013-10-17 17:21 [v2 PATCH 5/6] MIPS: APRP: Add support for Malta CMP platform Steven J. Hill
@ 2013-10-17 17:37 ` David Daney
  2013-10-17 17:43     ` Steven J. Hill
  0 siblings, 1 reply; 4+ messages in thread
From: David Daney @ 2013-10-17 17:37 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: linux-mips, Deng-Cheng Zhu, ralf

What changed from V1?


On 10/17/2013 10:21 AM, Steven J. Hill wrote:
> From: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
>
> Malta with multi-core CM platforms can now use APRP functionality.
>
> Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
> Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
> Reviewed-by: Qais Yousef <Qais.Yousef@imgtec.com>
> ---
>   arch/mips/include/asm/amon.h     |    4 ++--
>   arch/mips/mti-malta/malta-amon.c |   24 +++++++++++++++++++++---
>   arch/mips/mti-malta/malta-int.c  |   12 ++++++++++++
>   3 files changed, 35 insertions(+), 5 deletions(-)
>
[...]

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

* Re: [v2 PATCH 5/6] MIPS: APRP: Add support for Malta CMP platform.
@ 2013-10-17 17:43     ` Steven J. Hill
  0 siblings, 0 replies; 4+ messages in thread
From: Steven J. Hill @ 2013-10-17 17:43 UTC (permalink / raw)
  To: David Daney; +Cc: linux-mips, Deng-Cheng Zhu, ralf

On 10/17/2013 12:37 PM, David Daney wrote:
> What changed from V1?
>
Just the title of the patch. Sorry I forgot that. :/

Steve

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

* Re: [v2 PATCH 5/6] MIPS: APRP: Add support for Malta CMP platform.
@ 2013-10-17 17:43     ` Steven J. Hill
  0 siblings, 0 replies; 4+ messages in thread
From: Steven J. Hill @ 2013-10-17 17:43 UTC (permalink / raw)
  To: David Daney; +Cc: linux-mips, Deng-Cheng Zhu, ralf

On 10/17/2013 12:37 PM, David Daney wrote:
> What changed from V1?
>
Just the title of the patch. Sorry I forgot that. :/

Steve

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

end of thread, other threads:[~2013-10-17 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-17 17:21 [v2 PATCH 5/6] MIPS: APRP: Add support for Malta CMP platform Steven J. Hill
2013-10-17 17:37 ` David Daney
2013-10-17 17:43   ` Steven J. Hill
2013-10-17 17:43     ` Steven J. Hill

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.