Skip to content

Commit e73b7af

Browse files
committed
iommu/omap: Move data structures to omap-iommu.h
The internal data-structures are scattered over various header and C files. Consolidate them in omap-iommu.h. While at this, add the kerneldoc comment for the missing iommu domain variable and revise the iommu_arch_data name. Signed-off-by: Joerg Roedel <jroedel@suse.de> [s-anna@ti.com: revise kerneldoc comments] Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 49a57ef commit e73b7af

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

drivers/iommu/omap-iommu.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,6 @@
4242
/* bitmap of the page sizes currently supported */
4343
#define OMAP_IOMMU_PGSIZES (SZ_4K | SZ_64K | SZ_1M | SZ_16M)
4444

45-
/**
46-
* struct omap_iommu_domain - omap iommu domain
47-
* @pgtable: the page table
48-
* @iommu_dev: an omap iommu device attached to this domain. only a single
49-
* iommu device can be attached for now.
50-
* @dev: Device using this domain.
51-
* @lock: domain lock, should be taken when attaching/detaching
52-
*/
53-
struct omap_iommu_domain {
54-
u32 *pgtable;
55-
struct omap_iommu *iommu_dev;
56-
struct device *dev;
57-
spinlock_t lock;
58-
struct iommu_domain domain;
59-
};
60-
6145
#define MMU_LOCK_BASE_SHIFT 10
6246
#define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT)
6347
#define MMU_LOCK_BASE(x) \

drivers/iommu/omap-iommu.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define _OMAP_IOMMU_H
1515

1616
#include <linux/bitops.h>
17+
#include <linux/iommu.h>
1718

1819
#define for_each_iotlb_cr(obj, n, __i, cr) \
1920
for (__i = 0; \
@@ -27,6 +28,23 @@ struct iotlb_entry {
2728
u32 endian, elsz, mixed;
2829
};
2930

31+
/**
32+
* struct omap_iommu_domain - omap iommu domain
33+
* @pgtable: the page table
34+
* @iommu_dev: an omap iommu device attached to this domain. only a single
35+
* iommu device can be attached for now.
36+
* @dev: Device using this domain.
37+
* @lock: domain lock, should be taken when attaching/detaching
38+
* @domain: generic domain handle used by iommu core code
39+
*/
40+
struct omap_iommu_domain {
41+
u32 *pgtable;
42+
struct omap_iommu *iommu_dev;
43+
struct device *dev;
44+
spinlock_t lock;
45+
struct iommu_domain domain;
46+
};
47+
3048
struct omap_iommu {
3149
const char *name;
3250
void __iomem *regbase;
@@ -52,6 +70,21 @@ struct omap_iommu {
5270
u32 id;
5371
};
5472

73+
/**
74+
* struct omap_iommu_arch_data - omap iommu private data
75+
* @name: name of the iommu device
76+
* @iommu_dev: handle of the iommu device
77+
*
78+
* This is an omap iommu private data object, which binds an iommu user
79+
* to its iommu device. This object should be placed at the iommu user's
80+
* dev_archdata so generic IOMMU API can be used without having to
81+
* utilize omap-specific plumbing anymore.
82+
*/
83+
struct omap_iommu_arch_data {
84+
const char *name;
85+
struct omap_iommu *iommu_dev;
86+
};
87+
5588
struct cr_regs {
5689
u32 cam;
5790
u32 ram;

include/linux/platform_data/iommu-omap.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,6 @@
1212

1313
#include <linux/platform_device.h>
1414

15-
#define MMU_REG_SIZE 256
16-
17-
/**
18-
* struct iommu_arch_data - omap iommu private data
19-
* @name: name of the iommu device
20-
* @iommu_dev: handle of the iommu device
21-
*
22-
* This is an omap iommu private data object, which binds an iommu user
23-
* to its iommu device. This object should be placed at the iommu user's
24-
* dev_archdata so generic IOMMU API can be used without having to
25-
* utilize omap-specific plumbing anymore.
26-
*/
27-
struct omap_iommu_arch_data {
28-
const char *name;
29-
struct omap_iommu *iommu_dev;
30-
};
31-
3215
struct iommu_platform_data {
3316
const char *reset_name;
3417
int (*assert_reset)(struct platform_device *pdev, const char *name);

0 commit comments

Comments
 (0)