MIPS: APRP: Enable APRP for platforms with a CM.
PATCH v2 2/6 MIPS: APRP: Add VPE loader support for CMP platforms.
In reply to Steven J. HillFrom: Deng-Cheng Zhu <[email protected]>
This patch adds VPE loader support for platforms having a CMP.
--- arch/mips/Kconfig | 5 ++ arch/mips/kernel/Makefile | 1 + arch/mips/kernel/vpe-cmp.c | 180 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 arch/mips/kernel/vpe-cmp.c
arch/mips/Kconfig +5 -0
@@ -1919,6 +1919,11 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. +config MIPS_VPE_LOADER_CMP + bool + default "y" + depends on MIPS_VPE_LOADER && MIPS_CMP + config MIPS_VPE_LOADER_MT bool default "y"
arch/mips/kernel/Makefile +1 -0
@@ -55,6 +55,7 @@ obj-$(CONFIG_MIPS_CMP) += smp-cmp.o obj-$(CONFIG_CPU_MIPSR2) += spram.o obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o +obj-$(CONFIG_MIPS_VPE_LOADER_CMP) += vpe-cmp.o obj-$(CONFIG_MIPS_VPE_LOADER_MT) += vpe-mt.o obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
arch/mips/kernel/vpe-cmp.c new file +180 -0
180 lines not on this page · raw message
Signature · 1 line
1.7.9.5
v2 cover MIPS: APRP: Enable APRP for platforms with a CM.
From: "Steven J. Hill" <[email protected]>
The APRP model makes it possible that one or more CPUs to run the Linux kernel and a dedicated CPU runs a special real-time or signal processing program.
This patchset adds the following to the current APRP support:
1. Add CM and multicore APRP support.
2. Several bug fixes.
3. Running floating point heavy jobs on the RP side.
4. Waking up the RP side read by interrupt.
V1 -> v2:
Add new config options MIPS_VPE_LOADER_CMP, MIPS_VPE_LOADER_MT, MIPS_VPE_APSP_API_CMP and MIPS_VPE_APSP_API_MT so that the Makefile is cleaner and get rid of #ifdef's in CMP and MT versions of both vpe and rtlx.
Deng-Cheng Zhu (5):
MIPS: APRP: Split VPE loader into separate files.
MIPS: APRP: Add VPE loader support for CMP platforms.
MIPS: APRP: Split RTLX support into separate files.
MIPS: APRP: Add RTLX API support for CMP platforms.
MIPS: APRP: Add support for Malta CMP platform.
Steven J. Hill (1):
MIPS: APRP: Code formatting clean-ups.
arch/mips/Kconfig | 21 +- arch/mips/include/asm/amon.h | 15 +- arch/mips/include/asm/rtlx.h | 49 ++- arch/mips/include/asm/vpe.h | 136 +++++- arch/mips/kernel/Makefile | 4 + arch/mips/kernel/rtlx-cmp.c | 116 +++++ arch/mips/kernel/rtlx-mt.c | 148 +++++++ arch/mips/kernel/rtlx.c | 275 +++--------- arch/mips/kernel/vpe-cmp.c | 180 ++++++++ arch/mips/kernel/vpe-mt.c | 523 ++++++++++++++++++++++ arch/mips/kernel/vpe.c | 893 ++++++-------------------------------- arch/mips/mti-malta/malta-amon.c | 48 +- arch/mips/mti-malta/malta-int.c | 127 +++--- 13 files changed, 1441 insertions(+), 1094 deletions(-) create mode 100644 arch/mips/kernel/rtlx-cmp.c create mode 100644 arch/mips/kernel/rtlx-mt.c create mode 100644 arch/mips/kernel/vpe-cmp.c create mode 100644 arch/mips/kernel/vpe-mt.c
Signature · 1 line
1.7.9.5
PATCH v2 3/6 MIPS: APRP: Split RTLX support into separate files.
From: Deng-Cheng Zhu <[email protected]>
Split the RTLX functionality in preparation for adding support for CMP platforms. Common functions remain in the original file and a new file contains code specific to platforms that do not have a CMP.
--- arch/mips/Kconfig | 5 ++ arch/mips/include/asm/rtlx.h | 43 ++++++++---- arch/mips/kernel/Makefile | 1 + arch/mips/kernel/rtlx-mt.c | 148 ++++++++++++++++++++++++++++++++++++++++++ arch/mips/kernel/rtlx.c | 143 ++++------------------------------------ 5 files changed, 196 insertions(+), 144 deletions(-) create mode 100644 arch/mips/kernel/rtlx-mt.c
arch/mips/Kconfig +5 -0
@@ -1968,6 +1968,11 @@ config MIPS_VPE_APSP_API depends on MIPS_VPE_LOADER help +config MIPS_VPE_APSP_API_MT + bool + default "y" + depends on MIPS_VPE_APSP_API && !MIPS_CMP + config MIPS_CMP bool "MIPS CMP framework support" depends on SYS_SUPPORTS_MIPS_CMP
arch/mips/include/asm/rtlx.h +31 -12
82 lines not on this page · raw message
arch/mips/kernel/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o obj-$(CONFIG_MIPS_VPE_LOADER_CMP) += vpe-cmp.o obj-$(CONFIG_MIPS_VPE_LOADER_MT) += vpe-mt.o obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o +obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx-mt.o obj-$(CONFIG_I8259) += i8259.o obj-$(CONFIG_IRQ_CPU) += irq_cpu.o
arch/mips/kernel/rtlx-mt.c new file +148 -0
148 lines not on this page · raw message
arch/mips/kernel/rtlx.c +11 -132
183 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 1/6 MIPS: APRP: Split VPE loader into separate files.
In reply to Steven J. HillFrom: Deng-Cheng Zhu <[email protected]>
Split the VPE functionality in preparation for adding support for CMP platforms. Common functions remain in the original file and a new file contains code specific to platforms that do not have a CMP present.
--- arch/mips/Kconfig | 5 + arch/mips/include/asm/vpe.h | 117 +++++++- arch/mips/kernel/Makefile | 1 + arch/mips/kernel/vpe-mt.c | 523 ++++++++++++++++++++++++++++++++++ arch/mips/kernel/vpe.c | 647 ++----------------------------------------- 5 files changed, 660 insertions(+), 633 deletions(-) create mode 100644 arch/mips/kernel/vpe-mt.c
arch/mips/Kconfig +5 -0
@@ -1919,6 +1919,11 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. +config MIPS_VPE_LOADER_MT + bool + default "y" + depends on MIPS_VPE_LOADER && !MIPS_CMP + config MIPS_MT_SMTC_IM_BACKSTOP bool "Use per-TC register bits as backstop for inhibited IM bits" depends on MIPS_MT_SMTC
arch/mips/include/asm/vpe.h +112 -5
135 lines not on this page · raw message
arch/mips/kernel/Makefile +1 -0
@@ -55,6 +55,7 @@ obj-$(CONFIG_MIPS_CMP) += smp-cmp.o obj-$(CONFIG_CPU_MIPSR2) += spram.o obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o +obj-$(CONFIG_MIPS_VPE_LOADER_MT) += vpe-mt.o obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o obj-$(CONFIG_I8259) += i8259.o
arch/mips/kernel/vpe-mt.c new file +523 -0
523 lines not on this page · raw message
arch/mips/kernel/vpe.c +19 -628
784 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 4/6 MIPS: APRP: Add RTLX API support for CMP platforms.
In reply to Steven J. HillFrom: Deng-Cheng Zhu <[email protected]>
This patch adds RTLX API support for platforms having a CMP.
--- arch/mips/Kconfig | 5 ++ arch/mips/include/asm/rtlx.h | 1 + arch/mips/kernel/Makefile | 1 + arch/mips/kernel/rtlx-cmp.c | 116 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 arch/mips/kernel/rtlx-cmp.c
arch/mips/Kconfig +5 -0
@@ -1968,6 +1968,11 @@ config MIPS_VPE_APSP_API depends on MIPS_VPE_LOADER help +config MIPS_VPE_APSP_API_CMP + bool + default "y" + depends on MIPS_VPE_APSP_API && MIPS_CMP + config MIPS_VPE_APSP_API_MT bool default "y"
arch/mips/include/asm/rtlx.h +1 -0
@@ -78,6 +78,7 @@ struct rtlx_channel {extern struct rtlx_info {unsigned long id;enum rtlx_state state; +int ap_int_pending;/* Status of 0 or 1 for CONFIG_MIPS_CMP only */ struct rtlx_channel channel[RTLX_CHANNELS ]; } *rtlx;
arch/mips/kernel/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o obj-$(CONFIG_MIPS_VPE_LOADER_CMP) += vpe-cmp.o obj-$(CONFIG_MIPS_VPE_LOADER_MT) += vpe-mt.o obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o +obj-$(CONFIG_MIPS_VPE_APSP_API_CMP) += rtlx-cmp.o obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx-mt.o obj-$(CONFIG_I8259) += i8259.o
arch/mips/kernel/rtlx-cmp.c new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 5/6 MIPS: APRP: Add support for Malta CMP platform.
In reply to Steven J. HillFrom: Deng-Cheng Zhu <[email protected]>
Malta with multi-core CM platforms can now use APRP functionality.
--- 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(-)
arch/mips/include/asm/amon.h +2 -2
@@ -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 );
arch/mips/mti-malta/malta-amon.c +21 -3
@@ -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
arch/mips/mti-malta/malta-int.c +12 -0
@@ -2,6 +2,7 @@* Carsten Langgaard, [email protected] * 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 ;
Signature · 1 line
1.7.9.5
PATCH v2 6/6 MIPS: APRP: Code formatting clean-ups.
In reply to Steven J. HillFrom: "Steven J. Hill" <[email protected]>
Clean-up code according to the 'checkpatch.pl' script.
--- arch/mips/Kconfig | 1 - arch/mips/include/asm/amon.h | 15 ++- arch/mips/include/asm/rtlx.h | 5 +- arch/mips/include/asm/vpe.h | 19 +-- arch/mips/kernel/rtlx.c | 134 ++++++++------------ arch/mips/kernel/vpe-mt.c | 6 +- arch/mips/kernel/vpe.c | 252 +++++++++++++++++--------------------- arch/mips/mti-malta/malta-amon.c | 24 ++-- arch/mips/mti-malta/malta-int.c | 115 +++++++++-------- 9 files changed, 250 insertions(+), 321 deletions(-)
arch/mips/Kconfig +0 -1
@@ -1962,7 +1962,6 @@ config MIPS_VPE_LOADER_TOM you to ensure the amount you put in the option and the space your program requires is less or equal to the amount physically present. -# this should possibly be in drivers/char, but it is rather cpu related. Hmmm config MIPS_VPE_APSP_API bool "Enable support for AP/SP API (RTLX)" depends on MIPS_VPE_LOADER
arch/mips/include/asm/amon.h +10 -5
@@ -1,7 +1,12 @@/* -* Amon support +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 2013 Imagination Technologies Ltd. +* +* Arbitrary Monitor Support (AMON) */ - -int amon_cpu_avail (int ); -int amon_cpu_start (int ,unsigned long ,unsigned long , -unsigned long ,unsigned long ); +int amon_cpu_avail (int cpu); +int amon_cpu_start (int cpu,unsigned long pc,unsigned long sp, +unsigned long gp,unsigned long a0);
arch/mips/include/asm/rtlx.h +4 -1
@@ -1,8 +1,11 @@/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. * Copyright (C) 2013 Imagination Technologies Ltd. */ -#ifndef __ASM_RTLX_H_#define __ASM_RTLX_H_
arch/mips/include/asm/vpe.h +4 -15
@@ -1,22 +1,11 @@/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. * 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 -* published by the Free Software Foundation. -* -* This program is distributed in the hope it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License along -* with this program; if not, write to the Free Software Foundation, Inc., -* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. -* */ -#ifndef _ASM_VPE_H#define _ASM_VPE_H
arch/mips/kernel/rtlx.c +54 -80
258 lines not on this page · raw message
arch/mips/kernel/vpe-mt.c +3 -3
@@ -26,7 +26,7 @@ static int hw_tcs, hw_vpes;int vpe_run (struct vpe *v) {unsigned long flags, val, dmt_flag; -struct vpe_notifications *n; +struct vpe_notifications *notifier;unsigned int vpeflags;struct tc *t;
@@ -139,8 +139,8 @@ int vpe_run(struct vpe *v)emt (dmt_flag);local_irq_restore (flags); -list_for_each_entry (n, &v->notify, list) - n->start (VPE_MODULE_MINOR ); +list_for_each_entry (notifier, &v->notify, list) + notifier->start (VPE_MODULE_MINOR );return 0 ; }
arch/mips/kernel/vpe.c +112 -140
598 lines not on this page · raw message
arch/mips/mti-malta/malta-amon.c +7 -17
@@ -1,30 +1,20 @@/* -* Copyright (C) 2007 MIPS Technologies, Inc. -* All rights reserved. - -* 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 -* published by the Free Software Foundation. -* -* This program is distributed in the hope it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -* for more details. +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. * -* You should have received a copy of the GNU General Public License along -* with this program; if not, write to the Free Software Foundation, Inc., -* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +* Copyright (C) 2007 MIPS Technologies, Inc. All rights reserved. +* Copyright (C) 2013 Imagination Technologies Ltd. * -* Arbitrary Monitor interface +* Arbitrary Monitor Interface */ -#include <linux/kernel.h> #include <linux/init.h> #include <linux/smp.h> #include <asm/addrspace.h> -#include <asm/mips-boards/launch.h> #include <asm/mipsmtregs.h> +#include <asm/mips-boards/launch.h> #include <asm/vpe.h> int amon_cpu_avail (int cpu)
arch/mips/mti-malta/malta-int.c +56 -59
228 lines not on this page · raw message
Signature · 1 line
1.7.9.5