All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Redfearn <matt.redfearn@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org, linux-remoteproc@vger.kernel.org,
	lisa.parratt@imgtec.com, linux-kernel@vger.kernel.org,
	Matt Redfearn <matt.redfearn@imgtec.com>,
	Marcin Nowakowski <marcin.nowakowski@imgtec.com>,
	Qais Yousef <qsyousef@gmail.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Lisa Parratt <Lisa.Parratt@imgtec.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Jason Cooper <jason@lakedaemon.net>,
	James Hogan <james.hogan@imgtec.com>,
	Ingo Molnar <mingo@kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Paul Burton <paul.burton@imgtec.com>
Subject: [PATCH v6 0/4] MIPS: Remote processor driver
Date: Thu, 23 Mar 2017 16:37:13 +0000	[thread overview]
Message-ID: <1490287037-31885-1-git-send-email-matt.redfearn@imgtec.com> (raw)


The MIPS remote processor driver allows non-Linux firmware to take
control of and execute on one of the systems VPEs, turning the system
into a hybrid of SMP Linux and AMP.

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.

This functionality is conceptually similar to the VPE loader, an arch
specific mechanism which has been in the MIPS Linux kernel since 2005.
This driver is an attempt to make that functionality more standard by
moving it into the remoteproc subsystem.

A system CPU must be offlined from Linux and the driver enabled for that
CPU via the drivers sysfs interface. The remoteproc subsystem then takes
control of the CPU and loads a separate firmware image to it. A full
description is available at [1]. Example firmware images for the driver
and host programs to test them are available at [2].

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.11-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 v6:
Rebase on Linux 4.11-rc3
Change to set_current_state() as set_task_state has been removed.

Changes in v5:
Depend on !64bit since this driver only works with 32bit kernels
Set mproc->tsk state to TASK_DEAD before freeing it to avoid warning
Flush icache of each carveout so that icache sees latest data written

Changes in v4:
Fix inconsistency 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               | 599 +++++++++++++++++++++
 9 files changed, 1010 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-mips-rproc
 create mode 100644 drivers/remoteproc/mips_remoteproc.c

-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Matt Redfearn <matt.redfearn@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: <linux-mips@linux-mips.org>, <linux-remoteproc@vger.kernel.org>,
	<lisa.parratt@imgtec.com>, <linux-kernel@vger.kernel.org>,
	Matt Redfearn <matt.redfearn@imgtec.com>,
	Marcin Nowakowski <marcin.nowakowski@imgtec.com>,
	Qais Yousef <qsyousef@gmail.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Lisa Parratt <Lisa.Parratt@imgtec.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Jason Cooper <jason@lakedaemon.net>,
	James Hogan <james.hogan@imgtec.com>,
	Ingo Molnar <mingo@kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Paul Burton <paul.burton@imgtec.com>
Subject: [PATCH v6 0/4] MIPS: Remote processor driver
Date: Thu, 23 Mar 2017 16:37:13 +0000	[thread overview]
Message-ID: <1490287037-31885-1-git-send-email-matt.redfearn@imgtec.com> (raw)


The MIPS remote processor driver allows non-Linux firmware to take
control of and execute on one of the systems VPEs, turning the system
into a hybrid of SMP Linux and AMP.

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.

This functionality is conceptually similar to the VPE loader, an arch
specific mechanism which has been in the MIPS Linux kernel since 2005.
This driver is an attempt to make that functionality more standard by
moving it into the remoteproc subsystem.

A system CPU must be offlined from Linux and the driver enabled for that
CPU via the drivers sysfs interface. The remoteproc subsystem then takes
control of the CPU and loads a separate firmware image to it. A full
description is available at [1]. Example firmware images for the driver
and host programs to test them are available at [2].

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.11-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 v6:
Rebase on Linux 4.11-rc3
Change to set_current_state() as set_task_state has been removed.

Changes in v5:
Depend on !64bit since this driver only works with 32bit kernels
Set mproc->tsk state to TASK_DEAD before freeing it to avoid warning
Flush icache of each carveout so that icache sees latest data written

Changes in v4:
Fix inconsistency 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               | 599 +++++++++++++++++++++
 9 files changed, 1010 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-mips-rproc
 create mode 100644 drivers/remoteproc/mips_remoteproc.c

-- 
2.7.4

             reply	other threads:[~2017-03-23 16:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 16:37 Matt Redfearn [this message]
2017-03-23 16:37 ` [PATCH v6 0/4] MIPS: Remote processor driver Matt Redfearn
2017-03-23 16:37 ` [PATCH v6 1/4] irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC Matt Redfearn
2017-03-23 16:37   ` Matt Redfearn
2017-03-23 16:37 ` [PATCH v6 2/4] MIPS: CPS: Add VP(E) stealing Matt Redfearn
2017-03-23 16:37   ` Matt Redfearn
2017-03-23 16:37 ` [PATCH v6 3/4] remoteproc/MIPS: Add a remoteproc driver for MIPS Matt Redfearn
2017-03-23 16:37   ` Matt Redfearn
2017-04-03 10:11   ` Matt Redfearn
2017-04-03 10:11     ` Matt Redfearn
2017-06-14 11:26     ` Ralf Baechle
2017-03-23 16:37 ` [PATCH v6 4/4] MIPS: Deprecate VPE Loader Matt Redfearn
2017-03-23 16:37   ` Matt Redfearn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490287037-31885-1-git-send-email-matt.redfearn@imgtec.com \
    --to=matt.redfearn@imgtec.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=james.hogan@imgtec.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=lisa.parratt@imgtec.com \
    --cc=marc.zyngier@arm.com \
    --cc=marcin.nowakowski@imgtec.com \
    --cc=mingo@kernel.org \
    --cc=ohad@wizery.com \
    --cc=paul.burton@imgtec.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=qsyousef@gmail.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.