From a2b950ac7b1e6442919ee9e79c4963e134698869 Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen Date: Sun, 7 Apr 2013 14:06:07 +0300 Subject: remoteproc: perserve resource table data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copy resource table from first to second firmware loading. After firmware is loaded to memory, update the vdevs resource pointer to the resource table kept in device memory. Signed-off-by: Sjur Brændeland Acked-by: Ido Yariv [rebase, terminology and style changes] Signed-off-by: Ohad Ben-Cohen --- include/linux/remoteproc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux') diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index faf33324c78f..b4cef16460f8 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -401,6 +401,9 @@ enum rproc_crash_type { * @crash_comp: completion used to sync crash handler and the rproc reload * @recovery_disabled: flag that state if recovery was disabled * @max_notifyid: largest allocated notify id. + * @table_ptr: pointer to the resource table in effect + * @cached_table: copy of the resource table + * @table_csum: checksum of the resource table */ struct rproc { struct klist_node node; @@ -429,9 +432,13 @@ struct rproc { struct completion crash_comp; bool recovery_disabled; int max_notifyid; + struct resource_table *table_ptr; + struct resource_table *cached_table; + u32 table_csum; }; /* we currently support only two vrings per rvdev */ + #define RVDEV_NUM_VRINGS 2 /** @@ -464,6 +471,7 @@ struct rproc_vring { * @vring: the vrings for this vdev * @dfeatures: virtio device features * @gfeatures: virtio guest features + * @rsc_offset: offset of the vdev's resource entry */ struct rproc_vdev { struct list_head node; @@ -472,6 +480,7 @@ struct rproc_vdev { struct rproc_vring vring[RVDEV_NUM_VRINGS]; unsigned long dfeatures; unsigned long gfeatures; + u32 rsc_offset; }; struct rproc *rproc_alloc(struct device *dev, const char *name, -- cgit v1.2.3 From 92b38f851470f8d8ea7ed638d546f83b5268bc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sjur=20Br=C3=A6ndeland?= Date: Thu, 21 Feb 2013 18:15:39 +0100 Subject: remoteproc: support virtio config space. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support virtio configuration space and device status. The virtio device can now access the resource table in shared memory. Signed-off-by: Sjur Brændeland Acked-by: Ido Yariv [rebase and style changes] Signed-off-by: Ohad Ben-Cohen --- include/linux/remoteproc.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/linux') diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index b4cef16460f8..9e7e745dac55 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -469,8 +469,6 @@ struct rproc_vring { * @rproc: the rproc handle * @vdev: the virio device * @vring: the vrings for this vdev - * @dfeatures: virtio device features - * @gfeatures: virtio guest features * @rsc_offset: offset of the vdev's resource entry */ struct rproc_vdev { @@ -478,8 +476,6 @@ struct rproc_vdev { struct rproc *rproc; struct virtio_device vdev; struct rproc_vring vring[RVDEV_NUM_VRINGS]; - unsigned long dfeatures; - unsigned long gfeatures; u32 rsc_offset; }; -- cgit v1.2.3