remoteproc: Add new detach() remoteproc operation
authorMathieu Poirier <mathieu.poirier@linaro.org>
Fri, 12 Mar 2021 16:24:44 +0000 (09:24 -0700)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 18 Mar 2021 12:55:46 +0000 (07:55 -0500)
Add an new detach() operation in order to support scenarios where
the remoteproc core is going away but the remote processor is
kept operating.  This could be the case when the system is
rebooted or when the platform driver is removed.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20210312162453.1234145-9-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
include/linux/remoteproc.h

index eee338177a3d933b8080dc2bc899a52584d56527..2f1f0fbc39944634795dc196989611054301c4cc 100644 (file)
@@ -363,6 +363,7 @@ enum rsc_handling_status {
  * @start:     power on the device and boot it
  * @stop:      power off the device
  * @attach:    attach to a device that his already powered up
+ * @detach:    detach from a device, leaving it powered up
  * @kick:      kick a virtqueue (virtqueue id given as a parameter)
  * @da_to_va:  optional platform hook to perform address translations
  * @parse_fw:  parse firmware to extract information (e.g. resource table)
@@ -387,6 +388,7 @@ struct rproc_ops {
        int (*start)(struct rproc *rproc);
        int (*stop)(struct rproc *rproc);
        int (*attach)(struct rproc *rproc);
+       int (*detach)(struct rproc *rproc);
        void (*kick)(struct rproc *rproc, int vqid);
        void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len, bool *is_iomem);
        int (*parse_fw)(struct rproc *rproc, const struct firmware *fw);