remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs
authorSuman Anna <s-anna@ti.com>
Sun, 13 Feb 2022 20:12:46 +0000 (14:12 -0600)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 11 Mar 2022 20:31:56 +0000 (14:31 -0600)
commitb8431920391d36c273f63a29eab0dfc7e884dd17
tree4d1133f4d77d50851c1519b17e681c00f4ffbb1a
parent2eab5efeb4d644d9c94e29c3cbb35a47f715bffd
remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs

Add support to the K3 DSP remoteproc driver to configure all the C66x
and C71x cores on J721E SoCs 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 perform 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 DSP.

The IPC-only mode for a DSP is detected and configured at driver probe
time by querying the System Firmware for the DSP power and reset state
and/or status and making sure that the DSP 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 DSP core for remoteproc mode by any
means without rebooting the kernel if that DSP 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-6-s-anna@ti.com
drivers/remoteproc/ti_k3_dsp_remoteproc.c