summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorLoic Pallardy <loic.pallardy@st.com>2017-11-06 12:09:56 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-11-07 00:57:27 -0500
commitb89188394164a5df4bd649380f75ec74e6b8a4d3 (patch)
tree57098eca7f712e3680e1efed0cab939b197137f4 /drivers/remoteproc
parentbdd8edb9b0cd552f09a81c32d699af041155a390 (diff)
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 = {
252 .release = single_release, 252 .release = single_release,
253}; 253};
254 254
255/* Expose carveout content via debugfs */
256static int rproc_carveouts_show(struct seq_file *seq, void *p)
257{
258 struct rproc *rproc = seq->private;
259 struct rproc_mem_entry *carveout;
260
261 list_for_each_entry(carveout, &rproc->carveouts, node) {
262 seq_puts(seq, "Carveout memory entry:\n");
263 seq_printf(seq, "\tVirtual address: %p\n", carveout->va);
264 seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma);
265 seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da);
266 seq_printf(seq, "\tLength: 0x%x Bytes\n\n", carveout->len);
267 }
268
269 return 0;
270}
271
272static int rproc_carveouts_open(struct inode *inode, struct file *file)
273{
274 return single_open(file, rproc_carveouts_show, inode->i_private);
275}
276
277static const struct file_operations rproc_carveouts_ops = {
278 .open = rproc_carveouts_open,
279 .read = seq_read,
280 .llseek = seq_lseek,
281 .release = single_release,
282};
283
255void rproc_remove_trace_file(struct dentry *tfile) 284void rproc_remove_trace_file(struct dentry *tfile)
256{ 285{
257 debugfs_remove(tfile); 286 debugfs_remove(tfile);
@@ -297,6 +326,8 @@ void rproc_create_debug_dir(struct rproc *rproc)
297 rproc, &rproc_recovery_ops); 326 rproc, &rproc_recovery_ops);
298 debugfs_create_file("resource_table", 0400, rproc->dbg_dir, 327 debugfs_create_file("resource_table", 0400, rproc->dbg_dir,
299 rproc, &rproc_rsc_table_ops); 328 rproc, &rproc_rsc_table_ops);
329 debugfs_create_file("carveout_memories", 0400, rproc->dbg_dir,
330 rproc, &rproc_carveouts_ops);
300} 331}
301 332
302void __init rproc_init_debugfs(void) 333void __init rproc_init_debugfs(void)