All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] K3 R5F & DSP IPC-only mode support
@ 2021-05-22  0:03 ` Suman Anna
  0 siblings, 0 replies; 46+ messages in thread
From: Suman Anna @ 2021-05-22  0:03 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier
  Cc: Lokesh Vutla, Tero Kristo, linux-remoteproc, linux-arm-kernel,
	linux-kernel, Suman Anna

Hi All,

The following series adds the IPC-only mode support for the TI K3 R5F
and DSP (C66x and C71x) remoteprocs covering AM65x, J721E, J7200 and
AM64x SoCs. Patches are on top of 5.13-rc1 + Minor remoteproc cleanup
series [1] + TI K3 R5F remoteproc support on AM64x series [2].

The 'IPC-only' mode terminology essentially means establishing only the
IPC rpmsg stack for remoteprocs that are booted early by bootloaders and
supporting only 'attach' and 'detach' of the remoteprocs. The existing
remoteproc infrastructure does support 'stop' of an early-booted remote
processor, and the TI K3 remoteprocs are intentionally being limited to
'detach', and are designed to only establish and tear apart IPC (the 
virtio devices that provide the IPC transport) without ever shutting
down the core. This is done by introducing a new flag in remoteproc core
in Patch 2. Support for the regular 'stop' can be enhanced in the future
easily by adding a new sysfs or configfs file that changes this flag,
but IPC-only is the expected usage model for now on K3 SoCs.

Following is a summary of some of the design details:
 - The TI K3 SoCs use a dedicated system processor for Power and Clocks
   and the IPC-only mode is detected by communicating with this central
   processor and checking on the power status of remoteprocs.
 - The driver support is provided through the recently added .attach(),
  .detach() and .get_loaded_rsc_table() rproc ops, and new RPROC_ATTACHED
   and RPROC_DETACHED state flags.
 - The default kernel dts cluster modes and TCM configuration for R5Fs
   are ignored and overridden by querying this config from the system
   processor in IPC-only mode. Any core not booted earlier will fall back
   to using the kernel dts (eg: R5F Core0 can be booted by bootloader, and
   R5F Core1 will be booted using kernel).
 - The remoteproc firmwares are not loaded again in kernel to retrieve
   the resource table. This allows early-boot to be done from different
   boot media such as OSPI or eMMC, and be completely independent of the
   rootfs in SDCard or NFS.
 - The IPC-only mode support follows a design-by-contract (DBC) approach
   to achieve the above. The resource tables are always expected to be at
   the base on the DDR memory region reserved for firmwares (base of the
   second memory-region property in the remoteproc dts node). This also
   eliminates the need for dts properties being dynamically updated to
   provide the resource table address (there are no dedicated h/w
   registers either like with the ST SoCs). This scales to designs where
   either U-Boot is not involved or a different processor is used to
   load the various remoteprocs.
 - The "stop" command results in a failure when the remoteproc is in
   IPC-only mode, and "detach" serves as the corresponding replacement.
   Note that there is no equivalent "attach" command, and "start" command
   also serves as "attach" for remoteprocs that are in detached state.
 - The remoteproc sysfs 'state' file shows the mode as "detached"
   when the early-booted remoteproc is detached. "offline" continues
   to be shown when the remoteproc is powered off.

Following is the summary of patches:
 - Patch 1 is a minor cleanup patch in remoteproc core to make the 
   helper functions look symmetric.
 - Patch 2 introduces a new flag 'detach_on_shutdown' and enhances
   the remoteproc core to restrict stop on early-booted remoteprocs.
   This patch provides the required behavior for K3 IPC-only mode (no
   stopping of early-booted rprocs). The default behavior continues
   to support stopping of remoteproc like with the existing code.
 - Patches 3 and 5 refactor the mailbox request code out of start
   for reuse in the new attach callbacks.
 - Patch 4 adds the IPC-only mode support for R5F.
 - Patch 6 adds the IPC-only mode support for both K3 C66x and C71x
   DSPs.

Patches 1, 3 and 5 can be considered cleanup, so I suggest these be
picked up if there are any major comments on the others.

I have verified the different combinations on J721E, J7200 and AM65x
SoCs. AM64x currently lacks early-boot support, but the logic is ready
for Single-CPU and Split modes that are specific to AM64x SoCs. 

regards
Suman

[1] https://patchwork.kernel.org/project/linux-remoteproc/list/?series=485235
[2] https://patchwork.kernel.org/project/linux-remoteproc/list/?series=456755 

Suman Anna (6):
  remoteproc: Introduce rproc_detach_device() wrapper
  remoteproc: Add support for detach-only during shutdown
  remoteproc: k3-r5: Refactor mbox request code in start
  remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs
  remoteproc: k3-dsp: Refactor mbox request code in start
  remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs

 drivers/remoteproc/remoteproc_cdev.c      |   7 +
 drivers/remoteproc/remoteproc_core.c      |   7 +-
 drivers/remoteproc/remoteproc_internal.h  |   8 +
 drivers/remoteproc/remoteproc_sysfs.c     |   6 +
 drivers/remoteproc/ti_k3_dsp_remoteproc.c | 214 ++++++++++++++---
 drivers/remoteproc/ti_k3_r5_remoteproc.c  | 279 ++++++++++++++++++++--
 include/linux/remoteproc.h                |   3 +
 7 files changed, 459 insertions(+), 65 deletions(-)

-- 
2.30.1


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

end of thread, other threads:[~2021-06-22 22:52 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22  0:03 [PATCH 0/6] K3 R5F & DSP IPC-only mode support Suman Anna
2021-05-22  0:03 ` Suman Anna
2021-05-22  0:03 ` [PATCH 1/6] remoteproc: Introduce rproc_detach_device() wrapper Suman Anna
2021-05-22  0:03   ` Suman Anna
2021-05-28  4:17   ` Bjorn Andersson
2021-05-28  4:17     ` Bjorn Andersson
2021-05-28 16:17     ` Suman Anna
2021-05-28 16:17       ` Suman Anna
2021-05-22  0:03 ` [PATCH 2/6] remoteproc: Add support for detach-only during shutdown Suman Anna
2021-05-22  0:03   ` Suman Anna
2021-05-28  4:11   ` Bjorn Andersson
2021-05-28  4:11     ` Bjorn Andersson
2021-05-28 16:40     ` Suman Anna
2021-05-28 16:40       ` Suman Anna
2021-06-01 17:15       ` Mathieu Poirier
2021-06-01 17:15         ` Mathieu Poirier
2021-05-22  0:03 ` [PATCH 3/6] remoteproc: k3-r5: Refactor mbox request code in start Suman Anna
2021-05-22  0:03   ` Suman Anna
2021-06-01 17:22   ` Mathieu Poirier
2021-06-01 17:22     ` Mathieu Poirier
2021-05-22  0:03 ` [PATCH 4/6] remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs Suman Anna
2021-05-22  0:03   ` Suman Anna
2021-06-01 17:51   ` Mathieu Poirier
2021-06-01 17:51     ` Mathieu Poirier
2021-06-02 15:53   ` Mathieu Poirier
2021-06-02 15:53     ` Mathieu Poirier
2021-05-22  0:03 ` [PATCH 5/6] remoteproc: k3-dsp: Refactor mbox request code in start Suman Anna
2021-05-22  0:03   ` Suman Anna
2021-06-02 16:04   ` Mathieu Poirier
2021-06-02 16:04     ` Mathieu Poirier
2021-05-22  0:03 ` [PATCH 6/6] remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs Suman Anna
2021-05-22  0:03   ` Suman Anna
2021-05-28  4:36   ` Bjorn Andersson
2021-05-28  4:36     ` Bjorn Andersson
2021-05-28 17:04     ` Suman Anna
2021-05-28 17:04       ` Suman Anna
2021-06-02 16:07   ` Mathieu Poirier
2021-06-02 16:07     ` Mathieu Poirier
2021-06-03 14:57     ` Suman Anna
2021-06-03 14:57       ` Suman Anna
2021-06-07 16:33       ` Mathieu Poirier
2021-06-07 16:33         ` Mathieu Poirier
2021-06-16 15:00         ` Suman Anna
2021-06-16 15:00           ` Suman Anna
2021-06-22 22:51           ` Mathieu Poirier
2021-06-22 22:51             ` Mathieu Poirier

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.