Lines Matching refs:bpmp

80 static const char *get_filename(struct tegra_bpmp *bpmp,  in get_filename()  argument
88 root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf, in get_filename()
108 static int mrq_debugfs_read(struct tegra_bpmp *bpmp, in mrq_debugfs_read() argument
136 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debugfs_read()
145 static int mrq_debugfs_write(struct tegra_bpmp *bpmp, in mrq_debugfs_write() argument
166 return tegra_bpmp_transfer(bpmp, &msg); in mrq_debugfs_write()
169 static int mrq_debugfs_dumpdir(struct tegra_bpmp *bpmp, dma_addr_t addr, in mrq_debugfs_dumpdir() argument
193 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debugfs_dumpdir()
206 struct tegra_bpmp *bpmp = inode->i_private; in debugfs_show() local
216 filename = get_filename(bpmp, file, buf, sizeof(buf)); in debugfs_show()
220 namevirt = dma_alloc_coherent(bpmp->dev, namesize, &namephys, in debugfs_show()
225 datavirt = dma_alloc_coherent(bpmp->dev, datasize, &dataphys, in debugfs_show()
235 ret = mrq_debugfs_read(bpmp, namephys, len, dataphys, datasize, in debugfs_show()
241 dma_free_coherent(bpmp->dev, datasize, datavirt, dataphys); in debugfs_show()
243 dma_free_coherent(bpmp->dev, namesize, namevirt, namephys); in debugfs_show()
257 struct tegra_bpmp *bpmp = inode->i_private; in debugfs_store() local
267 filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf)); in debugfs_store()
271 namevirt = dma_alloc_coherent(bpmp->dev, namesize, &namephys, in debugfs_store()
276 datavirt = dma_alloc_coherent(bpmp->dev, datasize, &dataphys, in debugfs_store()
291 ret = mrq_debugfs_write(bpmp, namephys, len, dataphys, in debugfs_store()
295 dma_free_coherent(bpmp->dev, datasize, datavirt, dataphys); in debugfs_store()
297 dma_free_coherent(bpmp->dev, namesize, namevirt, namephys); in debugfs_store()
310 static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf, in bpmp_populate_dir() argument
343 err = bpmp_populate_dir(bpmp, seqbuf, dentry, depth+1); in bpmp_populate_dir()
352 parent, bpmp, in bpmp_populate_dir()
362 static int create_debugfs_mirror(struct tegra_bpmp *bpmp, void *buf, in create_debugfs_mirror() argument
368 bpmp->debugfs_mirror = debugfs_create_dir("debug", root); in create_debugfs_mirror()
369 if (!bpmp->debugfs_mirror) in create_debugfs_mirror()
373 err = bpmp_populate_dir(bpmp, &seqbuf, bpmp->debugfs_mirror, 0); in create_debugfs_mirror()
375 debugfs_remove_recursive(bpmp->debugfs_mirror); in create_debugfs_mirror()
376 bpmp->debugfs_mirror = NULL; in create_debugfs_mirror()
382 static int mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq) in mrq_is_supported() argument
399 ret = tegra_bpmp_transfer(bpmp, &msg); in mrq_is_supported()
402 dev_warn(bpmp->dev, "tegra_bpmp_transfer failed (%d)\n", ret); in mrq_is_supported()
409 int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp) in tegra_bpmp_init_debugfs() argument
418 if (!mrq_is_supported(bpmp, MRQ_DEBUGFS)) in tegra_bpmp_init_debugfs()
425 virt = dma_alloc_coherent(bpmp->dev, sz, &phys, in tegra_bpmp_init_debugfs()
432 ret = mrq_debugfs_dumpdir(bpmp, phys, sz, &nbytes); in tegra_bpmp_init_debugfs()
436 ret = create_debugfs_mirror(bpmp, virt, nbytes, root); in tegra_bpmp_init_debugfs()
438 dma_free_coherent(bpmp->dev, sz, virt, phys); in tegra_bpmp_init_debugfs()