Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * omap iommu: debugfs interface |
| 3 | * |
| 4 | * Copyright (C) 2008-2009 Nokia Corporation |
| 5 | * |
| 6 | * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/err.h> |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 14 | #include <linux/io.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 15 | #include <linux/slab.h> |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 16 | #include <linux/uaccess.h> |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 17 | #include <linux/pm_runtime.h> |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 18 | #include <linux/debugfs.h> |
Tony Lindgren | 2ab7c84 | 2012-11-02 12:24:14 -0700 | [diff] [blame] | 19 | #include <linux/platform_data/iommu-omap.h> |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 20 | |
Ido Yariv | 2f7702a | 2012-11-02 12:24:00 -0700 | [diff] [blame] | 21 | #include "omap-iopgtable.h" |
Tony Lindgren | ed1c7de | 2012-11-02 12:24:06 -0700 | [diff] [blame] | 22 | #include "omap-iommu.h" |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 23 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 24 | static DEFINE_MUTEX(iommu_debug_lock); |
| 25 | |
| 26 | static struct dentry *iommu_debug_root; |
| 27 | |
Suman Anna | c5cf5c5 | 2014-10-22 17:22:34 -0500 | [diff] [blame] | 28 | static inline bool is_omap_iommu_detached(struct omap_iommu *obj) |
| 29 | { |
| 30 | return !obj->domain; |
| 31 | } |
| 32 | |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 33 | #define pr_reg(name) \ |
| 34 | do { \ |
| 35 | ssize_t bytes; \ |
| 36 | const char *str = "%20s: %08x\n"; \ |
| 37 | const int maxcol = 32; \ |
| 38 | bytes = snprintf(p, maxcol, str, __stringify(name), \ |
| 39 | iommu_read_reg(obj, MMU_##name)); \ |
| 40 | p += bytes; \ |
| 41 | len -= bytes; \ |
| 42 | if (len < maxcol) \ |
| 43 | goto out; \ |
| 44 | } while (0) |
| 45 | |
| 46 | static ssize_t |
| 47 | omap2_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len) |
| 48 | { |
| 49 | char *p = buf; |
| 50 | |
| 51 | pr_reg(REVISION); |
| 52 | pr_reg(IRQSTATUS); |
| 53 | pr_reg(IRQENABLE); |
| 54 | pr_reg(WALKING_ST); |
| 55 | pr_reg(CNTL); |
| 56 | pr_reg(FAULT_AD); |
| 57 | pr_reg(TTB); |
| 58 | pr_reg(LOCK); |
| 59 | pr_reg(LD_TLB); |
| 60 | pr_reg(CAM); |
| 61 | pr_reg(RAM); |
| 62 | pr_reg(GFLUSH); |
| 63 | pr_reg(FLUSH_ENTRY); |
| 64 | pr_reg(READ_CAM); |
| 65 | pr_reg(READ_RAM); |
| 66 | pr_reg(EMU_FAULT_AD); |
| 67 | out: |
| 68 | return p - buf; |
| 69 | } |
| 70 | |
| 71 | static ssize_t omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, |
| 72 | ssize_t bytes) |
| 73 | { |
| 74 | if (!obj || !buf) |
| 75 | return -EINVAL; |
| 76 | |
| 77 | pm_runtime_get_sync(obj->dev); |
| 78 | |
| 79 | bytes = omap2_iommu_dump_ctx(obj, buf, bytes); |
| 80 | |
| 81 | pm_runtime_put_sync(obj->dev); |
| 82 | |
| 83 | return bytes; |
| 84 | } |
| 85 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 86 | static ssize_t debug_read_regs(struct file *file, char __user *userbuf, |
| 87 | size_t count, loff_t *ppos) |
| 88 | { |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 89 | struct omap_iommu *obj = file->private_data; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 90 | char *p, *buf; |
| 91 | ssize_t bytes; |
| 92 | |
Suman Anna | c5cf5c5 | 2014-10-22 17:22:34 -0500 | [diff] [blame] | 93 | if (is_omap_iommu_detached(obj)) |
| 94 | return -EPERM; |
| 95 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 96 | buf = kmalloc(count, GFP_KERNEL); |
| 97 | if (!buf) |
| 98 | return -ENOMEM; |
| 99 | p = buf; |
| 100 | |
| 101 | mutex_lock(&iommu_debug_lock); |
| 102 | |
Ohad Ben-Cohen | 6c32df4 | 2011-08-17 22:57:56 +0300 | [diff] [blame] | 103 | bytes = omap_iommu_dump_ctx(obj, p, count); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 104 | bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes); |
| 105 | |
| 106 | mutex_unlock(&iommu_debug_lock); |
| 107 | kfree(buf); |
| 108 | |
| 109 | return bytes; |
| 110 | } |
| 111 | |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 112 | static int |
| 113 | __dump_tlb_entries(struct omap_iommu *obj, struct cr_regs *crs, int num) |
| 114 | { |
| 115 | int i; |
| 116 | struct iotlb_lock saved; |
| 117 | struct cr_regs tmp; |
| 118 | struct cr_regs *p = crs; |
| 119 | |
| 120 | pm_runtime_get_sync(obj->dev); |
| 121 | iotlb_lock_get(obj, &saved); |
| 122 | |
| 123 | for_each_iotlb_cr(obj, num, i, tmp) { |
| 124 | if (!iotlb_cr_valid(&tmp)) |
| 125 | continue; |
| 126 | *p++ = tmp; |
| 127 | } |
| 128 | |
| 129 | iotlb_lock_set(obj, &saved); |
| 130 | pm_runtime_put_sync(obj->dev); |
| 131 | |
| 132 | return p - crs; |
| 133 | } |
| 134 | |
| 135 | static ssize_t iotlb_dump_cr(struct omap_iommu *obj, struct cr_regs *cr, |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 136 | struct seq_file *s) |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 137 | { |
Joe Perches | 6798a8c | 2015-09-11 13:07:48 -0700 | [diff] [blame] | 138 | seq_printf(s, "%08x %08x %01x\n", cr->cam, cr->ram, |
Suman Anna | a5c0e0b | 2016-04-04 17:46:21 -0500 | [diff] [blame] | 139 | (cr->cam & MMU_CAM_P) ? 1 : 0); |
Joe Perches | 6798a8c | 2015-09-11 13:07:48 -0700 | [diff] [blame] | 140 | return 0; |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 141 | } |
| 142 | |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 143 | static size_t omap_dump_tlb_entries(struct omap_iommu *obj, struct seq_file *s) |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 144 | { |
| 145 | int i, num; |
| 146 | struct cr_regs *cr; |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 147 | |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 148 | num = obj->nr_tlb_entries; |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 149 | |
| 150 | cr = kcalloc(num, sizeof(*cr), GFP_KERNEL); |
| 151 | if (!cr) |
| 152 | return 0; |
| 153 | |
| 154 | num = __dump_tlb_entries(obj, cr, num); |
| 155 | for (i = 0; i < num; i++) |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 156 | iotlb_dump_cr(obj, cr + i, s); |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 157 | kfree(cr); |
| 158 | |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 159 | return 0; |
Suman Anna | 69c2c19 | 2015-07-20 17:33:25 -0500 | [diff] [blame] | 160 | } |
| 161 | |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 162 | static int debug_read_tlb(struct seq_file *s, void *data) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 163 | { |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 164 | struct omap_iommu *obj = s->private; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 165 | |
Suman Anna | c5cf5c5 | 2014-10-22 17:22:34 -0500 | [diff] [blame] | 166 | if (is_omap_iommu_detached(obj)) |
| 167 | return -EPERM; |
| 168 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 169 | mutex_lock(&iommu_debug_lock); |
| 170 | |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 171 | seq_printf(s, "%8s %8s\n", "cam:", "ram:"); |
| 172 | seq_puts(s, "-----------------------------------------\n"); |
| 173 | omap_dump_tlb_entries(obj, s); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 174 | |
| 175 | mutex_unlock(&iommu_debug_lock); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 176 | |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 177 | return 0; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 178 | } |
| 179 | |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 180 | static void dump_ioptable(struct seq_file *s) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 181 | { |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 182 | int i, j; |
| 183 | u32 da; |
| 184 | u32 *iopgd, *iopte; |
| 185 | struct omap_iommu *obj = s->private; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 186 | |
| 187 | spin_lock(&obj->page_table_lock); |
| 188 | |
| 189 | iopgd = iopgd_offset(obj, 0); |
| 190 | for (i = 0; i < PTRS_PER_IOPGD; i++, iopgd++) { |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 191 | if (!*iopgd) |
| 192 | continue; |
| 193 | |
| 194 | if (!(*iopgd & IOPGD_TABLE)) { |
| 195 | da = i << IOPGD_SHIFT; |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 196 | seq_printf(s, "1: 0x%08x 0x%08x\n", da, *iopgd); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 197 | continue; |
| 198 | } |
| 199 | |
| 200 | iopte = iopte_offset(iopgd, 0); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 201 | for (j = 0; j < PTRS_PER_IOPTE; j++, iopte++) { |
| 202 | if (!*iopte) |
| 203 | continue; |
| 204 | |
| 205 | da = (i << IOPGD_SHIFT) + (j << IOPTE_SHIFT); |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 206 | seq_printf(s, "2: 0x%08x 0x%08x\n", da, *iopte); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 207 | } |
| 208 | } |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 209 | |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 210 | spin_unlock(&obj->page_table_lock); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 211 | } |
| 212 | |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 213 | static int debug_read_pagetable(struct seq_file *s, void *data) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 214 | { |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 215 | struct omap_iommu *obj = s->private; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 216 | |
Suman Anna | c5cf5c5 | 2014-10-22 17:22:34 -0500 | [diff] [blame] | 217 | if (is_omap_iommu_detached(obj)) |
| 218 | return -EPERM; |
| 219 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 220 | mutex_lock(&iommu_debug_lock); |
| 221 | |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 222 | seq_printf(s, "L: %8s %8s\n", "da:", "pte:"); |
| 223 | seq_puts(s, "--------------------------\n"); |
| 224 | dump_ioptable(s); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 225 | |
| 226 | mutex_unlock(&iommu_debug_lock); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 227 | |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 228 | return 0; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 229 | } |
| 230 | |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 231 | #define DEBUG_SEQ_FOPS_RO(name) \ |
| 232 | static int debug_open_##name(struct inode *inode, struct file *file) \ |
| 233 | { \ |
| 234 | return single_open(file, debug_read_##name, inode->i_private); \ |
| 235 | } \ |
| 236 | \ |
| 237 | static const struct file_operations debug_##name##_fops = { \ |
| 238 | .open = debug_open_##name, \ |
| 239 | .read = seq_read, \ |
| 240 | .llseek = seq_lseek, \ |
| 241 | .release = single_release, \ |
| 242 | } |
| 243 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 244 | #define DEBUG_FOPS_RO(name) \ |
| 245 | static const struct file_operations debug_##name##_fops = { \ |
Stephen Boyd | 234e340 | 2012-04-05 14:25:11 -0700 | [diff] [blame] | 246 | .open = simple_open, \ |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 247 | .read = debug_read_##name, \ |
Arnd Bergmann | c0b0aca | 2010-07-06 19:16:33 +0200 | [diff] [blame] | 248 | .llseek = generic_file_llseek, \ |
Suman Anna | 5b39a37 | 2015-07-20 17:33:28 -0500 | [diff] [blame] | 249 | } |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 250 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 251 | DEBUG_FOPS_RO(regs); |
Salva Peiró | e203db2 | 2015-07-23 14:26:19 +0200 | [diff] [blame] | 252 | DEBUG_SEQ_FOPS_RO(tlb); |
Suman Anna | 9c83e9f | 2014-10-22 17:22:35 -0500 | [diff] [blame] | 253 | DEBUG_SEQ_FOPS_RO(pagetable); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 254 | |
| 255 | #define __DEBUG_ADD_FILE(attr, mode) \ |
| 256 | { \ |
| 257 | struct dentry *dent; \ |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 258 | dent = debugfs_create_file(#attr, mode, obj->debug_dir, \ |
| 259 | obj, &debug_##attr##_fops); \ |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 260 | if (!dent) \ |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 261 | goto err; \ |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 262 | } |
| 263 | |
Joe Perches | ff3a2b7 | 2014-02-25 15:01:40 -0800 | [diff] [blame] | 264 | #define DEBUG_ADD_FILE_RO(name) __DEBUG_ADD_FILE(name, 0400) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 265 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 266 | void omap_iommu_debugfs_add(struct omap_iommu *obj) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 267 | { |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 268 | struct dentry *d; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 269 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 270 | if (!iommu_debug_root) |
| 271 | return; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 272 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 273 | obj->debug_dir = debugfs_create_dir(obj->name, iommu_debug_root); |
| 274 | if (!obj->debug_dir) |
| 275 | return; |
Ohad Ben-Cohen | 46451d6 | 2012-02-22 10:52:51 +0200 | [diff] [blame] | 276 | |
Geert Uytterhoeven | f18affb | 2018-01-02 16:29:45 +0100 | [diff] [blame] | 277 | d = debugfs_create_u32("nr_tlb_entries", 0400, obj->debug_dir, |
| 278 | &obj->nr_tlb_entries); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 279 | if (!d) |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 280 | return; |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 281 | |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 282 | DEBUG_ADD_FILE_RO(regs); |
| 283 | DEBUG_ADD_FILE_RO(tlb); |
Suman Anna | 3ca5db07 | 2014-10-22 17:22:29 -0500 | [diff] [blame] | 284 | DEBUG_ADD_FILE_RO(pagetable); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 285 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 286 | return; |
Ohad Ben-Cohen | 46451d6 | 2012-02-22 10:52:51 +0200 | [diff] [blame] | 287 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 288 | err: |
| 289 | debugfs_remove_recursive(obj->debug_dir); |
Ohad Ben-Cohen | 46451d6 | 2012-02-22 10:52:51 +0200 | [diff] [blame] | 290 | } |
| 291 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 292 | void omap_iommu_debugfs_remove(struct omap_iommu *obj) |
Ohad Ben-Cohen | 46451d6 | 2012-02-22 10:52:51 +0200 | [diff] [blame] | 293 | { |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 294 | if (!obj->debug_dir) |
| 295 | return; |
Ohad Ben-Cohen | 46451d6 | 2012-02-22 10:52:51 +0200 | [diff] [blame] | 296 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 297 | debugfs_remove_recursive(obj->debug_dir); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 298 | } |
| 299 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 300 | void __init omap_iommu_debugfs_init(void) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 301 | { |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 302 | iommu_debug_root = debugfs_create_dir("omap_iommu", NULL); |
| 303 | if (!iommu_debug_root) |
| 304 | pr_err("can't create debugfs dir\n"); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 305 | } |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 306 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 307 | void __exit omap_iommu_debugfs_exit(void) |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 308 | { |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 309 | debugfs_remove(iommu_debug_root); |
Hiroshi DOYU | 14e0e67 | 2009-08-28 10:54:41 -0700 | [diff] [blame] | 310 | } |