Re: [PATCH v3 0/4] MIPS: Remote processor driver

From: Hauke Mehrtens
Date: Mon Oct 17 2016 - 17:13:21 EST


On 10/11/2016 03:42 PM, Matt Redfearn wrote:
>
> 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.
>

Does this also work with big firmware binaries, like 2 MB firmware size?
It looks like dma_alloc_coherent() is used in rproc_handle_carveout() to
allocate the memory which will probably not work after full boot.

Is it possible to configure the cache line in a way that it will not be
removed from the cache to avoid high latency loads from main memory?
This is only needed for small firmware binaries, but allows even shorter
reaction times and better real time behavior.

In general I am in favor of having this as a standard Linux interface.

Hauke