Lines Matching refs:bpmp
70 static const char *get_filename(struct tegra_bpmp *bpmp, in get_filename() argument
82 root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf, in get_filename()
107 static int mrq_debug_open(struct tegra_bpmp *bpmp, const char *name, in mrq_debug_open() argument
134 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debug_open()
146 static int mrq_debug_close(struct tegra_bpmp *bpmp, u32 fd) in mrq_debug_close() argument
168 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debug_close()
177 static int mrq_debug_read(struct tegra_bpmp *bpmp, const char *name, in mrq_debug_read() argument
199 err = mrq_debug_open(bpmp, name, &fd, &len, 0); in mrq_debug_read()
212 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debug_read()
234 close_err = mrq_debug_close(bpmp, fd); in mrq_debug_read()
242 static int mrq_debug_write(struct tegra_bpmp *bpmp, const char *name, in mrq_debug_write() argument
265 err = mrq_debug_open(bpmp, name, &fd, &len, 1); in mrq_debug_write()
282 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debug_write()
295 err = mrq_debug_close(bpmp, fd); in mrq_debug_write()
305 struct tegra_bpmp *bpmp = inode->i_private; in bpmp_debug_show() local
326 filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf)); in bpmp_debug_show()
331 err = mrq_debug_open(bpmp, filename, &fd, &len, 0); in bpmp_debug_show()
339 err = tegra_bpmp_transfer(bpmp, &msg); in bpmp_debug_show()
358 close_err = mrq_debug_close(bpmp, fd); in bpmp_debug_show()
370 struct tegra_bpmp *bpmp = inode->i_private; in bpmp_debug_store() local
376 filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf)); in bpmp_debug_store()
384 err = mrq_debug_write(bpmp, filename, databuf, count); in bpmp_debug_store()
403 static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp, in bpmp_populate_debugfs_inband() argument
416 if (!bpmp || !parent || !ppath) in bpmp_populate_debugfs_inband()
429 err = mrq_debug_read(bpmp, ppath, buf, bufsize, &dsize); in bpmp_populate_debugfs_inband()
459 err = bpmp_populate_debugfs_inband(bpmp, dentry, in bpmp_populate_debugfs_inband()
468 dentry = debugfs_create_file(name, mode, parent, bpmp, in bpmp_populate_debugfs_inband()
484 static int mrq_debugfs_read(struct tegra_bpmp *bpmp, in mrq_debugfs_read() argument
512 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debugfs_read()
523 static int mrq_debugfs_write(struct tegra_bpmp *bpmp, in mrq_debugfs_write() argument
544 return tegra_bpmp_transfer(bpmp, &msg); in mrq_debugfs_write()
547 static int mrq_debugfs_dumpdir(struct tegra_bpmp *bpmp, dma_addr_t addr, in mrq_debugfs_dumpdir() argument
571 err = tegra_bpmp_transfer(bpmp, &msg); in mrq_debugfs_dumpdir()
586 struct tegra_bpmp *bpmp = inode->i_private; in debugfs_show() local
596 filename = get_filename(bpmp, file, buf, sizeof(buf)); in debugfs_show()
600 namevirt = dma_alloc_coherent(bpmp->dev, namesize, &namephys, in debugfs_show()
605 datavirt = dma_alloc_coherent(bpmp->dev, datasize, &dataphys, in debugfs_show()
615 err = mrq_debugfs_read(bpmp, namephys, len, dataphys, datasize, in debugfs_show()
621 dma_free_coherent(bpmp->dev, datasize, datavirt, dataphys); in debugfs_show()
623 dma_free_coherent(bpmp->dev, namesize, namevirt, namephys); in debugfs_show()
637 struct tegra_bpmp *bpmp = inode->i_private; in debugfs_store() local
647 filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf)); in debugfs_store()
651 namevirt = dma_alloc_coherent(bpmp->dev, namesize, &namephys, in debugfs_store()
656 datavirt = dma_alloc_coherent(bpmp->dev, datasize, &dataphys, in debugfs_store()
671 err = mrq_debugfs_write(bpmp, namephys, len, dataphys, in debugfs_store()
675 dma_free_coherent(bpmp->dev, datasize, datavirt, dataphys); in debugfs_store()
677 dma_free_coherent(bpmp->dev, namesize, namevirt, namephys); in debugfs_store()
690 static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf, in bpmp_populate_dir() argument
723 err = bpmp_populate_dir(bpmp, seqbuf, dentry, depth+1); in bpmp_populate_dir()
732 parent, bpmp, in bpmp_populate_dir()
742 static int bpmp_populate_debugfs_shmem(struct tegra_bpmp *bpmp) in bpmp_populate_debugfs_shmem() argument
751 virt = dma_alloc_coherent(bpmp->dev, sz, &phys, in bpmp_populate_debugfs_shmem()
756 err = mrq_debugfs_dumpdir(bpmp, phys, sz, &nbytes); in bpmp_populate_debugfs_shmem()
765 err = bpmp_populate_dir(bpmp, &seqbuf, bpmp->debugfs_mirror, 0); in bpmp_populate_debugfs_shmem()
767 dma_free_coherent(bpmp->dev, sz, virt, phys); in bpmp_populate_debugfs_shmem()
772 int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp) in tegra_bpmp_init_debugfs() argument
778 inband = tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUG); in tegra_bpmp_init_debugfs()
780 if (!inband && !tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS)) in tegra_bpmp_init_debugfs()
787 bpmp->debugfs_mirror = debugfs_create_dir("debug", root); in tegra_bpmp_init_debugfs()
788 if (IS_ERR(bpmp->debugfs_mirror)) { in tegra_bpmp_init_debugfs()
794 err = bpmp_populate_debugfs_inband(bpmp, bpmp->debugfs_mirror, in tegra_bpmp_init_debugfs()
797 err = bpmp_populate_debugfs_shmem(bpmp); in tegra_bpmp_init_debugfs()