aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoic PALLARDY <loic.pallardy@st.com>2016-09-06 03:39:43 -0400
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-09-06 14:06:40 -0400
commit21b6657ef4458f90d64b696105e3898257dea221 (patch)
tree011d5ed9cada8e7733eb73349f5aa53d872f2347
parentcd5830512044d301d397d1499738ee00a8836247 (diff)
remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa
In current implementation, struct fw_rsc_vdev_vring which describes vring resource in firmware resource table owns only device address, because it assumes that host is responsible of vring allocation and only device address is needed by coprocessor. But if vrings need to be fixed in system memory map for any reasons (security, SoC charactieristics...), physical address is needed exatly identified the memory chunck by host. For that let's transform reserved field of struct fw_rsc_vdev_vring to pa (physical address). Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r--drivers/remoteproc/remoteproc_core.c6
-rw-r--r--include/linux/remoteproc.h4
2 files changed, 2 insertions, 8 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 18f428618cf6..0d3c191b6bc3 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -266,12 +266,6 @@ rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i)
266 dev_dbg(dev, "vdev rsc: vring%d: da 0x%x, qsz %d, align %d\n", 266 dev_dbg(dev, "vdev rsc: vring%d: da 0x%x, qsz %d, align %d\n",
267 i, vring->da, vring->num, vring->align); 267 i, vring->da, vring->num, vring->align);
268 268
269 /* make sure reserved bytes are zeroes */
270 if (vring->reserved) {
271 dev_err(dev, "vring rsc has non zero reserved bytes\n");
272 return -EINVAL;
273 }
274
275 /* verify queue size and vring alignment are sane */ 269 /* verify queue size and vring alignment are sane */
276 if (!vring->num || !vring->align) { 270 if (!vring->num || !vring->align) {
277 dev_err(dev, "invalid qsz (%d) or alignment (%d)\n", 271 dev_err(dev, "invalid qsz (%d) or alignment (%d)\n",
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 80e1cba78a04..c321eab5054e 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -241,7 +241,7 @@ struct fw_rsc_trace {
241 * @notifyid is a unique rproc-wide notify index for this vring. This notify 241 * @notifyid is a unique rproc-wide notify index for this vring. This notify
242 * index is used when kicking a remote processor, to let it know that this 242 * index is used when kicking a remote processor, to let it know that this
243 * vring is triggered. 243 * vring is triggered.
244 * @reserved: reserved (must be zero) 244 * @pa: physical address
245 * 245 *
246 * This descriptor is not a resource entry by itself; it is part of the 246 * This descriptor is not a resource entry by itself; it is part of the
247 * vdev resource type (see below). 247 * vdev resource type (see below).
@@ -255,7 +255,7 @@ struct fw_rsc_vdev_vring {
255 u32 align; 255 u32 align;
256 u32 num; 256 u32 num;
257 u32 notifyid; 257 u32 notifyid;
258 u32 reserved; 258 u32 pa;
259} __packed; 259} __packed;
260 260
261/** 261/**