diff options
-rw-r--r-- | drivers/remoteproc/remoteproc_debugfs.c | 31 |
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 */ | ||
256 | static 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 | |||
272 | static int rproc_carveouts_open(struct inode *inode, struct file *file) | ||
273 | { | ||
274 | return single_open(file, rproc_carveouts_show, inode->i_private); | ||
275 | } | ||
276 | |||
277 | static 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 | |||
255 | void rproc_remove_trace_file(struct dentry *tfile) | 284 | void 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 | ||
302 | void __init rproc_init_debugfs(void) | 333 | void __init rproc_init_debugfs(void) |