aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorLoic Pallardy <loic.pallardy@st.com>2017-11-06 18:09:56 +0100
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-11-06 21:57:27 -0800
commitb89188394164a5df4bd649380f75ec74e6b8a4d3 (patch)
tree57098eca7f712e3680e1efed0cab939b197137f4 /drivers/remoteproc
parentremoteproc: debug: add resource table dump feature (diff)
downloadlinux-dev-b89188394164a5df4bd649380f75ec74e6b8a4d3.tar.xz
linux-dev-b89188394164a5df4bd649380f75ec74e6b8a4d3.zip
remoteproc: debug: add carveouts list dump feature
This patch offers the capability to dump memory carveouts associated to one remoteprocessor. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc_debugfs.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
index dc5e25943df7..a20488336aa0 100644
--- a/drivers/remoteproc/remoteproc_debugfs.c
+++ b/drivers/remoteproc/remoteproc_debugfs.c
@@ -252,6 +252,35 @@ static const struct file_operations rproc_rsc_table_ops = {
.release = single_release,
};
+/* Expose carveout content via debugfs */
+static int rproc_carveouts_show(struct seq_file *seq, void *p)
+{
+ struct rproc *rproc = seq->private;
+ struct rproc_mem_entry *carveout;
+
+ list_for_each_entry(carveout, &rproc->carveouts, node) {
+ seq_puts(seq, "Carveout memory entry:\n");
+ seq_printf(seq, "\tVirtual address: %p\n", carveout->va);
+ seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma);
+ seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da);
+ seq_printf(seq, "\tLength: 0x%x Bytes\n\n", carveout->len);
+ }
+
+ return 0;
+}
+
+static int rproc_carveouts_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, rproc_carveouts_show, inode->i_private);
+}
+
+static const struct file_operations rproc_carveouts_ops = {
+ .open = rproc_carveouts_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
void rproc_remove_trace_file(struct dentry *tfile)
{
debugfs_remove(tfile);
@@ -297,6 +326,8 @@ void rproc_create_debug_dir(struct rproc *rproc)
rproc, &rproc_recovery_ops);
debugfs_create_file("resource_table", 0400, rproc->dbg_dir,
rproc, &rproc_rsc_table_ops);
+ debugfs_create_file("carveout_memories", 0400, rproc->dbg_dir,
+ rproc, &rproc_carveouts_ops);
}
void __init rproc_init_debugfs(void)