aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/omap-iommu-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/omap-iommu-debug.c')
-rw-r--r--drivers/iommu/omap-iommu-debug.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index 0f8c8dd55018..9c192e79f806 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -32,7 +32,7 @@ static struct dentry *iommu_debug_root;
32static ssize_t debug_read_ver(struct file *file, char __user *userbuf, 32static ssize_t debug_read_ver(struct file *file, char __user *userbuf,
33 size_t count, loff_t *ppos) 33 size_t count, loff_t *ppos)
34{ 34{
35 u32 ver = iommu_arch_version(); 35 u32 ver = omap_iommu_arch_version();
36 char buf[MAXCOLUMN], *p = buf; 36 char buf[MAXCOLUMN], *p = buf;
37 37
38 p += sprintf(p, "H/W version: %d.%d\n", (ver >> 4) & 0xf , ver & 0xf); 38 p += sprintf(p, "H/W version: %d.%d\n", (ver >> 4) & 0xf , ver & 0xf);
@@ -43,7 +43,7 @@ static ssize_t debug_read_ver(struct file *file, char __user *userbuf,
43static ssize_t debug_read_regs(struct file *file, char __user *userbuf, 43static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
44 size_t count, loff_t *ppos) 44 size_t count, loff_t *ppos)
45{ 45{
46 struct iommu *obj = file->private_data; 46 struct omap_iommu *obj = file->private_data;
47 char *p, *buf; 47 char *p, *buf;
48 ssize_t bytes; 48 ssize_t bytes;
49 49
@@ -54,7 +54,7 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
54 54
55 mutex_lock(&iommu_debug_lock); 55 mutex_lock(&iommu_debug_lock);
56 56
57 bytes = iommu_dump_ctx(obj, p, count); 57 bytes = omap_iommu_dump_ctx(obj, p, count);
58 bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes); 58 bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes);
59 59
60 mutex_unlock(&iommu_debug_lock); 60 mutex_unlock(&iommu_debug_lock);
@@ -66,7 +66,7 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
66static ssize_t debug_read_tlb(struct file *file, char __user *userbuf, 66static ssize_t debug_read_tlb(struct file *file, char __user *userbuf,
67 size_t count, loff_t *ppos) 67 size_t count, loff_t *ppos)
68{ 68{
69 struct iommu *obj = file->private_data; 69 struct omap_iommu *obj = file->private_data;
70 char *p, *buf; 70 char *p, *buf;
71 ssize_t bytes, rest; 71 ssize_t bytes, rest;
72 72
@@ -80,7 +80,7 @@ static ssize_t debug_read_tlb(struct file *file, char __user *userbuf,
80 p += sprintf(p, "%8s %8s\n", "cam:", "ram:"); 80 p += sprintf(p, "%8s %8s\n", "cam:", "ram:");
81 p += sprintf(p, "-----------------------------------------\n"); 81 p += sprintf(p, "-----------------------------------------\n");
82 rest = count - (p - buf); 82 rest = count - (p - buf);
83 p += dump_tlb_entries(obj, p, rest); 83 p += omap_dump_tlb_entries(obj, p, rest);
84 84
85 bytes = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); 85 bytes = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
86 86
@@ -96,7 +96,7 @@ static ssize_t debug_write_pagetable(struct file *file,
96 struct iotlb_entry e; 96 struct iotlb_entry e;
97 struct cr_regs cr; 97 struct cr_regs cr;
98 int err; 98 int err;
99 struct iommu *obj = file->private_data; 99 struct omap_iommu *obj = file->private_data;
100 char buf[MAXCOLUMN], *p = buf; 100 char buf[MAXCOLUMN], *p = buf;
101 101
102 count = min(count, sizeof(buf)); 102 count = min(count, sizeof(buf));
@@ -113,8 +113,8 @@ static ssize_t debug_write_pagetable(struct file *file,
113 return -EINVAL; 113 return -EINVAL;
114 } 114 }
115 115
116 iotlb_cr_to_e(&cr, &e); 116 omap_iotlb_cr_to_e(&cr, &e);
117 err = iopgtable_store_entry(obj, &e); 117 err = omap_iopgtable_store_entry(obj, &e);
118 if (err) 118 if (err)
119 dev_err(obj->dev, "%s: fail to store cr\n", __func__); 119 dev_err(obj->dev, "%s: fail to store cr\n", __func__);
120 120
@@ -136,7 +136,7 @@ static ssize_t debug_write_pagetable(struct file *file,
136 __err; \ 136 __err; \
137 }) 137 })
138 138
139static ssize_t dump_ioptable(struct iommu *obj, char *buf, ssize_t len) 139static ssize_t dump_ioptable(struct omap_iommu *obj, char *buf, ssize_t len)
140{ 140{
141 int i; 141 int i;
142 u32 *iopgd; 142 u32 *iopgd;
@@ -183,7 +183,7 @@ out:
183static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf, 183static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf,
184 size_t count, loff_t *ppos) 184 size_t count, loff_t *ppos)
185{ 185{
186 struct iommu *obj = file->private_data; 186 struct omap_iommu *obj = file->private_data;
187 char *p, *buf; 187 char *p, *buf;
188 size_t bytes; 188 size_t bytes;
189 189
@@ -211,7 +211,7 @@ static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf,
211static ssize_t debug_read_mmap(struct file *file, char __user *userbuf, 211static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,
212 size_t count, loff_t *ppos) 212 size_t count, loff_t *ppos)
213{ 213{
214 struct iommu *obj = file->private_data; 214 struct omap_iommu *obj = file->private_data;
215 char *p, *buf; 215 char *p, *buf;
216 struct iovm_struct *tmp; 216 struct iovm_struct *tmp;
217 int uninitialized_var(i); 217 int uninitialized_var(i);
@@ -253,7 +253,7 @@ static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,
253static ssize_t debug_read_mem(struct file *file, char __user *userbuf, 253static ssize_t debug_read_mem(struct file *file, char __user *userbuf,
254 size_t count, loff_t *ppos) 254 size_t count, loff_t *ppos)
255{ 255{
256 struct iommu *obj = file->private_data; 256 struct omap_iommu *obj = file->private_data;
257 char *p, *buf; 257 char *p, *buf;
258 struct iovm_struct *area; 258 struct iovm_struct *area;
259 ssize_t bytes; 259 ssize_t bytes;
@@ -267,7 +267,7 @@ static ssize_t debug_read_mem(struct file *file, char __user *userbuf,
267 267
268 mutex_lock(&iommu_debug_lock); 268 mutex_lock(&iommu_debug_lock);
269 269
270 area = find_iovm_area(obj, (u32)ppos); 270 area = omap_find_iovm_area(obj, (u32)ppos);
271 if (IS_ERR(area)) { 271 if (IS_ERR(area)) {
272 bytes = -EINVAL; 272 bytes = -EINVAL;
273 goto err_out; 273 goto err_out;
@@ -286,7 +286,7 @@ err_out:
286static ssize_t debug_write_mem(struct file *file, const char __user *userbuf, 286static ssize_t debug_write_mem(struct file *file, const char __user *userbuf,
287 size_t count, loff_t *ppos) 287 size_t count, loff_t *ppos)
288{ 288{
289 struct iommu *obj = file->private_data; 289 struct omap_iommu *obj = file->private_data;
290 struct iovm_struct *area; 290 struct iovm_struct *area;
291 char *p, *buf; 291 char *p, *buf;
292 292
@@ -304,7 +304,7 @@ static ssize_t debug_write_mem(struct file *file, const char __user *userbuf,
304 goto err_out; 304 goto err_out;
305 } 305 }
306 306
307 area = find_iovm_area(obj, (u32)ppos); 307 area = omap_find_iovm_area(obj, (u32)ppos);
308 if (IS_ERR(area)) { 308 if (IS_ERR(area)) {
309 count = -EINVAL; 309 count = -EINVAL;
310 goto err_out; 310 goto err_out;
@@ -360,7 +360,7 @@ DEBUG_FOPS(mem);
360static int iommu_debug_register(struct device *dev, void *data) 360static int iommu_debug_register(struct device *dev, void *data)
361{ 361{
362 struct platform_device *pdev = to_platform_device(dev); 362 struct platform_device *pdev = to_platform_device(dev);
363 struct iommu *obj = platform_get_drvdata(pdev); 363 struct omap_iommu *obj = platform_get_drvdata(pdev);
364 struct dentry *d, *parent; 364 struct dentry *d, *parent;
365 365
366 if (!obj || !obj->dev) 366 if (!obj || !obj->dev)
@@ -396,7 +396,7 @@ static int __init iommu_debug_init(void)
396 return -ENOMEM; 396 return -ENOMEM;
397 iommu_debug_root = d; 397 iommu_debug_root = d;
398 398
399 err = foreach_iommu_device(d, iommu_debug_register); 399 err = omap_foreach_iommu_device(d, iommu_debug_register);
400 if (err) 400 if (err)
401 goto err_out; 401 goto err_out;
402 return 0; 402 return 0;