From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Nov 2016 17:11:30 +0100 (CET) Received: from mailapp01.imgtec.com ([195.59.15.196]:47453 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23992110AbcKBQLXplqOB (ORCPT ); Wed, 2 Nov 2016 17:11:23 +0100 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 1E87271251C9B; Wed, 2 Nov 2016 16:11:13 +0000 (GMT) Received: from mredfearn-linux.le.imgtec.org (10.150.130.83) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 2 Nov 2016 16:11:16 +0000 From: Matt Redfearn To: Ralf Baechle , Bjorn Andersson , Ohad Ben-Cohen , Thomas Gleixner CC: , , , , Matt Redfearn , Qais Yousef , Masahiro Yamada , Lisa Parratt , Paul Gortmaker , Jason Cooper , James Hogan , Marc Zyngier , Paul Burton Subject: [PATCH v4 0/4] MIPS: Remote processor driver Date: Wed, 2 Nov 2016 16:10:59 +0000 Message-ID: <1478103063-17653-1-git-send-email-matt.redfearn@imgtec.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.150.130.83] Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 55652 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: matt.redfearn@imgtec.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips The MIPS remote processor driver allows non-Linux firmware to take control of and execute on one of the systems VPEs. The CPU must be offlined from Linux first. A sysfs interface is created which allows firmware to be loaded and changed at runtime. A full description is available at [1]. An example firmware that can be used with this driver is available at [2]. This is useful to allow running bare metal code, or an RTOS, on one or more CPUs while allowing Linux to continue running on those remaining. The remote processor framework allows for firmwares to provide any virtio device for communication between the firmware running on the remote VP and Linux. For example [1] demonstrates a simple firmware which provides a virtual serial port. Any string sent to the port is case inverted and returned. This is conceptually similar to the VPE loader functionality, but is more standard as it fits into the remoteproc subsystem. The first patches in this series lay the groundwork for the driver before it is added. The last series deprecates the VPE loader. This functionality is supported on: - MIPS32r2 devices implementing the MIPS MT ASE for multithreading, such as interAptiv. - MIPS32r6 devices implementing VPs, such as I6400. Limitations: - The remoteproc core supports only 32bit ELFs. Therefore it is only possible to run 32bit firmware on the remote processor. Also, for virtio communication, pointers are passed from the kernel to firmware. There can be no mismatch in pointer sizes between the kernel and firmware, so this limits the host kernel to 32bit as well. The functionality has been tested on the Ci40 board which has a 2 core 2 thread interAptiv. This series is based on v4.9-rc3 [1] http://wiki.prplfoundation.org/w/images/d/df/MIPS_OS_Remote_Processor_Driver_Whitepaper_1.0.9.pdf [2] https://github.com/MIPS/mips-rproc-example Changes in v4: Fix inconistency of Linux CPU number and VP ID Have a single mips-rproc device to be parent to each CPU's rproc device. Support per-device coherence introduced in v4.9 Add a sysfs interface to control the mask of cpus available to rproc Changes in v3: Update GIC context saving to use CPU hotplug state machine Update MIPS remoteproc driver to use CPU hotplug state machine Remove sysfs interface from MIPS rproc driver, now provided by the core. Drop patches that Ralf has already merged to mips-next Changes in v2: Add dependence on additional patches to mips-gic in commit log Incorporate changes from Marc Zynger's review: - Remove CONTEXT_SAVING define. - Make saved local state a per-cpu variable - Make gic_save_* static functions when enabled, and do { } while(0) otherwise Lisa Parratt (1): MIPS: CPS: Add VP(E) stealing Matt Redfearn (3): irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC remoteproc/MIPS: Add a remoteproc driver for MIPS MIPS: Deprecate VPE Loader Documentation/ABI/testing/sysfs-devices-mips-rproc | 13 + arch/mips/Kconfig | 12 +- arch/mips/include/asm/smp-cps.h | 8 + arch/mips/kernel/smp-cps.c | 162 +++++- arch/mips/kernel/smp.c | 12 + drivers/irqchip/irq-mips-gic.c | 207 ++++++- drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/mips_remoteproc.c | 592 +++++++++++++++++++++ 9 files changed, 1003 insertions(+), 15 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-devices-mips-rproc create mode 100644 drivers/remoteproc/mips_remoteproc.c -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailapp01.imgtec.com ([195.59.15.196]:47453 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23992110AbcKBQLXplqOB (ORCPT ); Wed, 2 Nov 2016 17:11:23 +0100 From: Matt Redfearn Subject: [PATCH v4 0/4] MIPS: Remote processor driver Date: Wed, 2 Nov 2016 16:10:59 +0000 Message-ID: <1478103063-17653-1-git-send-email-matt.redfearn@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Ralf Baechle , Bjorn Andersson , Ohad Ben-Cohen , Thomas Gleixner Cc: linux-mips@linux-mips.org, linux-remoteproc@vger.kernel.org, lisa.parratt@imgtec.com, linux-kernel@vger.kernel.org, Matt Redfearn , Qais Yousef , Masahiro Yamada , Lisa Parratt , Paul Gortmaker , Jason Cooper , James Hogan , Marc Zyngier , Paul Burton Message-ID: <20161102161059.PrTHTBuvuwfslRyljPPWohv8PxYn_xmVCy5aCeLhOog@z> The MIPS remote processor driver allows non-Linux firmware to take control of and execute on one of the systems VPEs. The CPU must be offlined from Linux first. A sysfs interface is created which allows firmware to be loaded and changed at runtime. A full description is available at [1]. An example firmware that can be used with this driver is available at [2]. This is useful to allow running bare metal code, or an RTOS, on one or more CPUs while allowing Linux to continue running on those remaining. The remote processor framework allows for firmwares to provide any virtio device for communication between the firmware running on the remote VP and Linux. For example [1] demonstrates a simple firmware which provides a virtual serial port. Any string sent to the port is case inverted and returned. This is conceptually similar to the VPE loader functionality, but is more standard as it fits into the remoteproc subsystem. The first patches in this series lay the groundwork for the driver before it is added. The last series deprecates the VPE loader. This functionality is supported on: - MIPS32r2 devices implementing the MIPS MT ASE for multithreading, such as interAptiv. - MIPS32r6 devices implementing VPs, such as I6400. Limitations: - The remoteproc core supports only 32bit ELFs. Therefore it is only possible to run 32bit firmware on the remote processor. Also, for virtio communication, pointers are passed from the kernel to firmware. There can be no mismatch in pointer sizes between the kernel and firmware, so this limits the host kernel to 32bit as well. The functionality has been tested on the Ci40 board which has a 2 core 2 thread interAptiv. This series is based on v4.9-rc3 [1] http://wiki.prplfoundation.org/w/images/d/df/MIPS_OS_Remote_Processor_Driver_Whitepaper_1.0.9.pdf [2] https://github.com/MIPS/mips-rproc-example Changes in v4: Fix inconistency of Linux CPU number and VP ID Have a single mips-rproc device to be parent to each CPU's rproc device. Support per-device coherence introduced in v4.9 Add a sysfs interface to control the mask of cpus available to rproc Changes in v3: Update GIC context saving to use CPU hotplug state machine Update MIPS remoteproc driver to use CPU hotplug state machine Remove sysfs interface from MIPS rproc driver, now provided by the core. Drop patches that Ralf has already merged to mips-next Changes in v2: Add dependence on additional patches to mips-gic in commit log Incorporate changes from Marc Zynger's review: - Remove CONTEXT_SAVING define. - Make saved local state a per-cpu variable - Make gic_save_* static functions when enabled, and do { } while(0) otherwise Lisa Parratt (1): MIPS: CPS: Add VP(E) stealing Matt Redfearn (3): irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC remoteproc/MIPS: Add a remoteproc driver for MIPS MIPS: Deprecate VPE Loader Documentation/ABI/testing/sysfs-devices-mips-rproc | 13 + arch/mips/Kconfig | 12 +- arch/mips/include/asm/smp-cps.h | 8 + arch/mips/kernel/smp-cps.c | 162 +++++- arch/mips/kernel/smp.c | 12 + drivers/irqchip/irq-mips-gic.c | 207 ++++++- drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/mips_remoteproc.c | 592 +++++++++++++++++++++ 9 files changed, 1003 insertions(+), 15 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-devices-mips-rproc create mode 100644 drivers/remoteproc/mips_remoteproc.c -- 2.7.4