summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/remoteproc_core.c
diff options
context:
space:
mode:
authorClement Leger <cleger@kalray.eu>2019-06-17 14:57:30 +0200
committerBjorn Andersson <bjorn.andersson@linaro.org>2019-06-29 12:02:17 -0700
commitb1a17513a2d60f9e933016bed04d0eeb8651a915 (patch)
tree3cdda74ef3de7317259b3651d03a6a542a9bee38 /drivers/remoteproc/remoteproc_core.c
parent16a3c637f0742ec41bb69978e0d7b606a22a9c54 (diff)
downloadblackbird-op-linux-b1a17513a2d60f9e933016bed04d0eeb8651a915.tar.gz
blackbird-op-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_core.c')
-rw-r--r--drivers/remoteproc/remoteproc_core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 48feebd6d0a2..263e9c9614a8 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1066,6 +1066,20 @@ static int rproc_handle_resources(struct rproc *rproc,
dev_dbg(dev, "rsc: type %d\n", hdr->type);
+ if (hdr->type >= RSC_VENDOR_START &&
+ hdr->type <= RSC_VENDOR_END) {
+ ret = rproc_handle_rsc(rproc, hdr->type, rsc,
+ offset + sizeof(*hdr), avail);
+ if (ret == RSC_HANDLED)
+ continue;
+ else if (ret < 0)
+ break;
+
+ dev_warn(dev, "unsupported vendor resource %d\n",
+ hdr->type);
+ continue;
+ }
+
if (hdr->type >= RSC_LAST) {
dev_warn(dev, "unsupported resource %d\n", hdr->type);
continue;
OpenPOWER on IntegriCloud