remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs
authorSuman Anna <s-anna@ti.com>
Sun, 13 Feb 2022 20:12:44 +0000 (14:12 -0600)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 11 Mar 2022 20:31:55 +0000 (14:31 -0600)
commit1168af40b1ad8cb2e78f4a70869fa4a076320e4f
treea227f4c569cbd6c281e8ba317a7fe88ca96ca388
parente3865c85385aa0c882702039a66f8e1c973bd55c
remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs

Add support to the K3 R5F remoteproc driver to configure all the R5F
cores to be either in IPC-only mode or the traditional remoteproc mode.
The IPC-only mode expects that the remote processors are already booted
by the bootloader, and only performs the minimum steps required to
initialize and deinitialize the virtio IPC transports. The remoteproc
mode allows the kernel remoteproc driver to do the regular load and
boot and other device management operations for a R5F core.

The IPC-only mode for a R5F core is detected and configured at driver
probe time by querying the System Firmware for the R5F power and reset
state and/or status and making sure that the R5F core is indeed started
by the bootloaders, otherwise the device is configured for remoteproc
mode.

Support for IPC-only mode is achieved through .attach(), .detach() and
.get_loaded_rsc_table() callback ops and zeroing out the regular rproc
ops .prepare(), .unprepare(), .start() and .stop(). The resource table
follows a design-by-contract approach and is expected to be at the base
of the DDR firmware region reserved for each remoteproc, it is mostly
expected to contain only the virtio device and trace resource entries.

NOTE:
The driver cannot configure a R5F core for remoteproc mode by any
means without rebooting the kernel if that R5F core has been started
by a bootloader. This is the current desired behavior and can be
enhanced in the future if the feature is needed.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220213201246.25952-4-s-anna@ti.com
drivers/remoteproc/ti_k3_r5_remoteproc.c