summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/remoteproc_internal.h
diff options
context:
space:
mode:
authorClement Leger2019-06-17 14:57:30 +0200
committerBjorn Andersson2019-06-29 21:02:17 +0200
commitb1a17513a2d60f9e933016bed04d0eeb8651a915 (patch)
tree3cdda74ef3de7317259b3651d03a6a542a9bee38 /drivers/remoteproc/remoteproc_internal.h
parentremoteproc: imx: Fix typo in "failed" (diff)
downloadkernel-qcow2-linux-b1a17513a2d60f9e933016bed04d0eeb8651a915.tar.gz
kernel-qcow2-linux-b1a17513a2d60f9e933016bed04d0eeb8651a915.tar.xz
kernel-qcow2-linux-b1a17513a2d60f9e933016bed04d0eeb8651a915.zip
remoteproc: add vendor resources handling
In order to allow rproc backend to handle vendor resources such as in OpenAMP, add a handle_rsc hook. This hook allow the rproc backends to handle vendor resources as they like. The hook will be called only for vendor resources and should return RSC_HANDLED on successful resource handling, RSC_IGNORED if resource was ignored, or a negative value on error. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/remoteproc_internal.h')
-rw-r--r--drivers/remoteproc/remoteproc_internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
index 45ff76a06c72..4c77bdd517b9 100644
--- a/drivers/remoteproc/remoteproc_internal.h
+++ b/drivers/remoteproc/remoteproc_internal.h
@@ -107,6 +107,17 @@ static inline int rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
}
static inline
+int rproc_handle_rsc(struct rproc *rproc, u32 rsc_type, void *rsc, int offset,
+ int avail)
+{
+ if (rproc->ops->handle_rsc)
+ return rproc->ops->handle_rsc(rproc, rsc_type, rsc, offset,
+ avail);
+
+ return RSC_IGNORED;
+}
+
+static inline
struct resource_table *rproc_find_loaded_rsc_table(struct rproc *rproc,
const struct firmware *fw)
{