diff options
author | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2009-08-28 13:54:41 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-08-28 13:54:41 -0400 |
commit | 14e0e6796a0d460ac6f7727616161dc317bbbf3a (patch) | |
tree | 06ff0894445ad8b08aa15e479742131396e1021b /arch/arm/mach-omap2/iommu2.c | |
parent | 613f77696e2c489e87def86a443fb4889acb95aa (diff) |
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>
Diffstat (limited to 'arch/arm/mach-omap2/iommu2.c')
-rw-r--r-- | arch/arm/mach-omap2/iommu2.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 015f22a53ead..2d9b5cc981cd 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c | |||
@@ -217,10 +217,19 @@ static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf) | |||
217 | } | 217 | } |
218 | 218 | ||
219 | #define pr_reg(name) \ | 219 | #define pr_reg(name) \ |
220 | p += sprintf(p, "%20s: %08x\n", \ | 220 | do { \ |
221 | __stringify(name), iommu_read_reg(obj, MMU_##name)); | 221 | ssize_t bytes; \ |
222 | 222 | const char *str = "%20s: %08x\n"; \ | |
223 | static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf) | 223 | const int maxcol = 32; \ |
224 | bytes = snprintf(p, maxcol, str, __stringify(name), \ | ||
225 | iommu_read_reg(obj, MMU_##name)); \ | ||
226 | p += bytes; \ | ||
227 | len -= bytes; \ | ||
228 | if (len < maxcol) \ | ||
229 | goto out; \ | ||
230 | } while (0) | ||
231 | |||
232 | static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t len) | ||
224 | { | 233 | { |
225 | char *p = buf; | 234 | char *p = buf; |
226 | 235 | ||
@@ -242,7 +251,7 @@ static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf) | |||
242 | pr_reg(READ_CAM); | 251 | pr_reg(READ_CAM); |
243 | pr_reg(READ_RAM); | 252 | pr_reg(READ_RAM); |
244 | pr_reg(EMU_FAULT_AD); | 253 | pr_reg(EMU_FAULT_AD); |
245 | 254 | out: | |
246 | return p - buf; | 255 | return p - buf; |
247 | } | 256 | } |
248 | 257 | ||