OMAP: iommu: add initial debugfs support
This enables to peek the following data. $ /debug/iommu/isp# ls mem nr_tlb_entries regs mmap pagetable tlb $ /debug/iommu/isp# head pagetable L: da: pa: ----------------------------------------- 2: 00001000 8ae4a002 2: 00002000 8e7bb002 2: 00003000 8ae49002 2: 00004000 8ae65002 ..... Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:

committed by
Tony Lindgren

parent
613f77696e
commit
14e0e6796a
@@ -217,10 +217,19 @@ static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf)
|
||||
}
|
||||
|
||||
#define pr_reg(name) \
|
||||
p += sprintf(p, "%20s: %08x\n", \
|
||||
__stringify(name), iommu_read_reg(obj, MMU_##name));
|
||||
do { \
|
||||
ssize_t bytes; \
|
||||
const char *str = "%20s: %08x\n"; \
|
||||
const int maxcol = 32; \
|
||||
bytes = snprintf(p, maxcol, str, __stringify(name), \
|
||||
iommu_read_reg(obj, MMU_##name)); \
|
||||
p += bytes; \
|
||||
len -= bytes; \
|
||||
if (len < maxcol) \
|
||||
goto out; \
|
||||
} while (0)
|
||||
|
||||
static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf)
|
||||
static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t len)
|
||||
{
|
||||
char *p = buf;
|
||||
|
||||
@@ -242,7 +251,7 @@ static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf)
|
||||
pr_reg(READ_CAM);
|
||||
pr_reg(READ_RAM);
|
||||
pr_reg(EMU_FAULT_AD);
|
||||
|
||||
out:
|
||||
return p - buf;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user