All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] MIPS: Remote processor driver
@ 2016-09-20  8:47 ` Matt Redfearn
  0 siblings, 0 replies; 29+ messages in thread
From: Matt Redfearn @ 2016-09-20  8:47 UTC (permalink / raw)
  To: Ralf Baechle, Bjorn Andersson, Ohad Ben-Cohen, Thomas Gleixner
  Cc: linux-mips, linux-remoteproc, lisa.parratt, linux-kernel,
	Matt Redfearn, Hugh Dickins, Qais Yousef, Masahiro Yamada,
	Huacai Chen, Jason Cooper, Lisa Parratt, James Hogan,
	Andrew Morton, Qais Yousef, Marc Zyngier, David S. Miller,
	Paul Burton


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.8-rc6

Depends on James Hogan's ebase series:
MIPS: traps: 64bit kernels should read CP0_EBase 64bit
MIPS: traps: Convert ebase to KSeg0
MIPS: traps: Ensure full EBase is written

Without these patches, if firmware modifies ebase to allow handling
exceptions / interrupts, then when the VPE is returned to Linux the
kernel exception handlers won't be reinstated properly.

[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 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 (5):
  irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC
  MIPS: tlb-r4k: If there are wired entries, don't use TLBINVF
  MIPS: smp.c: Introduce mechanism for freeing and allocating IPIs
  remoteproc/MIPS: Add a remoteproc driver for MIPS
  MIPS: Deprecate VPE Loader

 Documentation/ABI/testing/sysfs-class-mips-rproc |  24 +
 arch/mips/Kconfig                                |  12 +-
 arch/mips/include/asm/smp-cps.h                  |   8 +
 arch/mips/include/asm/smp.h                      |  15 +
 arch/mips/kernel/smp-cps.c                       | 162 +++++-
 arch/mips/kernel/smp.c                           |  73 ++-
 arch/mips/mm/tlb-r4k.c                           |   7 +-
 drivers/irqchip/irq-mips-gic.c                   | 217 +++++++-
 drivers/remoteproc/Kconfig                       |  11 +
 drivers/remoteproc/Makefile                      |   1 +
 drivers/remoteproc/mips_remoteproc.c             | 651 +++++++++++++++++++++++
 11 files changed, 1156 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-mips-rproc
 create mode 100644 drivers/remoteproc/mips_remoteproc.c

-- 
2.7.4

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

end of thread, other threads:[~2016-10-05 16:22 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-20  8:47 [PATCH v2 0/6] MIPS: Remote processor driver Matt Redfearn
2016-09-20  8:47 ` Matt Redfearn
2016-09-20  8:47 ` [PATCH v2 1/6] irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC Matt Redfearn
2016-09-20  8:47   ` Matt Redfearn
2016-09-20  9:40   ` Thomas Gleixner
2016-09-20  8:47 ` [PATCH v2 2/6] MIPS: tlb-r4k: If there are wired entries, don't use TLBINVF Matt Redfearn
2016-09-20  8:47   ` Matt Redfearn
2016-09-22 12:11   ` Ralf Baechle
2016-09-20  8:47 ` [PATCH v2 3/6] MIPS: smp.c: Introduce mechanism for freeing and allocating IPIs Matt Redfearn
2016-09-20  8:47   ` Matt Redfearn
2016-09-20  8:47 ` [PATCH v2 4/6] MIPS: CPS: Add VP(E) stealing Matt Redfearn
2016-09-20  8:47   ` Matt Redfearn
2016-09-20  8:47 ` [PATCH v2 5/6] remoteproc/MIPS: Add a remoteproc driver for MIPS Matt Redfearn
2016-09-20  8:47   ` Matt Redfearn
2016-09-20  9:47   ` Thomas Gleixner
2016-09-20 15:31     ` Matt Redfearn
2016-09-20 15:31       ` Matt Redfearn
2016-10-03  8:35   ` Matt Redfearn
2016-10-03  8:35     ` Matt Redfearn
2016-10-03  8:35     ` Matt Redfearn
2016-10-03 22:16   ` Bjorn Andersson
2016-10-05 16:22     ` Matt Redfearn
2016-10-05 16:22       ` Matt Redfearn
2016-09-20  8:47 ` [PATCH v2 6/6] MIPS: Deprecate VPE Loader Matt Redfearn
2016-09-20  8:47   ` Matt Redfearn
2016-09-20 10:25   ` Sergei Shtylyov
2016-09-20 13:19   ` Ralf Baechle
2016-09-20 13:53     ` Matt Redfearn
2016-09-20 13:53       ` Matt Redfearn

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.