summaryrefslogtreecommitdiff
path: root/include/linux/remoteproc.h
diff options
context:
space:
mode:
authorSarangdhar Joshi <spjoshi@codeaurora.org>2018-01-06 03:04:17 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-02-12 22:05:29 +0300
commit2666ca9197e3d352f43b02d7dfb7c6dd72e7c614 (patch)
treeb9c60aed35f13ff5c2fb519bf31eec2ed5d9c644 /include/linux/remoteproc.h
parent2d02d158047643060b7d6e0829fcc81518ce663d (diff)
downloadlinux-2666ca9197e3d352f43b02d7dfb7c6dd72e7c614.tar.xz
remoteproc: Add remote processor coredump support
As the remoteproc framework restarts the remote processor after a fatal event, it's useful to be able to acquire a coredump of the remote processor's state, for post mortem debugging. This patch introduces a mechanism for extracting the memory contents after the remote has stopped and before the restart sequence has begun in the recovery path. The remoteproc framework builds the core dump in memory and use devcoredump to expose this to user space. Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org> [bjorn: Use vmalloc instead of composing the ELF on the fly] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'include/linux/remoteproc.h')
-rw-r--r--include/linux/remoteproc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 728d421fffe9..b60c3a31b75d 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -395,6 +395,21 @@ enum rproc_crash_type {
};
/**
+ * struct rproc_dump_segment - segment info from ELF header
+ * @node: list node related to the rproc segment list
+ * @da: device address of the segment
+ * @size: size of the segment
+ */
+struct rproc_dump_segment {
+ struct list_head node;
+
+ dma_addr_t da;
+ size_t size;
+
+ loff_t offset;
+};
+
+/**
* struct rproc - represents a physical remote processor device
* @node: list node of this rproc object
* @domain: iommu domain
@@ -424,6 +439,7 @@ enum rproc_crash_type {
* @cached_table: copy of the resource table
* @table_sz: size of @cached_table
* @has_iommu: flag to indicate if remote processor is behind an MMU
+ * @dump_segments: list of segments in the firmware
*/
struct rproc {
struct list_head node;
@@ -455,6 +471,7 @@ struct rproc {
size_t table_sz;
bool has_iommu;
bool auto_boot;
+ struct list_head dump_segments;
};
/**
@@ -534,6 +551,7 @@ void rproc_free(struct rproc *rproc);
int rproc_boot(struct rproc *rproc);
void rproc_shutdown(struct rproc *rproc);
void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
+int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size);
static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
{