diff options
author | Ido Yariv <ido@wizery.com> | 2012-11-02 15:24:09 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-11-20 13:04:51 -0500 |
commit | 7bd9e25fa4e1eab0adb2632a0752e0835850dfb7 (patch) | |
tree | cd2a4bfb0019fc453f72240662173306fca2bc62 | |
parent | ed1c7de29f9f3d56b3ca5ef69682cc1a3d369e9d (diff) |
ARM: OMAP2+: Make some definitions local
Move some of the definitions in omap-iommu.h that can be made local to
either drivers/iommu.
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Omar Ramirez Luna <omar.luna@linaro.org>
Signed-off-by: Ido Yariv <ido@wizery.com>
Acked-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Joerg Roedel <joro@8bytes.org>
[tony@atomide.com: updated for header changes in the series]
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | drivers/iommu/omap-iommu.c | 15 | ||||
-rw-r--r-- | drivers/iommu/omap-iommu.h | 33 | ||||
-rw-r--r-- | drivers/iommu/omap-iommu2.c | 6 |
3 files changed, 24 insertions, 30 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 4db86e12c200..df840870e2a1 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c | |||
@@ -54,6 +54,21 @@ struct omap_iommu_domain { | |||
54 | spinlock_t lock; | 54 | spinlock_t lock; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #define MMU_LOCK_BASE_SHIFT 10 | ||
58 | #define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT) | ||
59 | #define MMU_LOCK_BASE(x) \ | ||
60 | ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT) | ||
61 | |||
62 | #define MMU_LOCK_VICT_SHIFT 4 | ||
63 | #define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT) | ||
64 | #define MMU_LOCK_VICT(x) \ | ||
65 | ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT) | ||
66 | |||
67 | struct iotlb_lock { | ||
68 | short base; | ||
69 | short vict; | ||
70 | }; | ||
71 | |||
57 | /* accommodate the difference between omap1 and omap2/3 */ | 72 | /* accommodate the difference between omap1 and omap2/3 */ |
58 | static const struct iommu_functions *arch_iommu; | 73 | static const struct iommu_functions *arch_iommu; |
59 | 74 | ||
diff --git a/drivers/iommu/omap-iommu.h b/drivers/iommu/omap-iommu.h index 8c3378d99b81..2b5f3c04d167 100644 --- a/drivers/iommu/omap-iommu.h +++ b/drivers/iommu/omap-iommu.h | |||
@@ -72,11 +72,6 @@ struct cr_regs { | |||
72 | }; | 72 | }; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | struct iotlb_lock { | ||
76 | short base; | ||
77 | short vict; | ||
78 | }; | ||
79 | |||
80 | /* architecture specific functions */ | 75 | /* architecture specific functions */ |
81 | struct iommu_functions { | 76 | struct iommu_functions { |
82 | unsigned long version; | 77 | unsigned long version; |
@@ -117,13 +112,6 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev) | |||
117 | } | 112 | } |
118 | #endif | 113 | #endif |
119 | 114 | ||
120 | /* IOMMU errors */ | ||
121 | #define OMAP_IOMMU_ERR_TLB_MISS (1 << 0) | ||
122 | #define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1) | ||
123 | #define OMAP_IOMMU_ERR_EMU_MISS (1 << 2) | ||
124 | #define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3) | ||
125 | #define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4) | ||
126 | |||
127 | /* | 115 | /* |
128 | * MMU Register offsets | 116 | * MMU Register offsets |
129 | */ | 117 | */ |
@@ -151,16 +139,6 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev) | |||
151 | /* | 139 | /* |
152 | * MMU Register bit definitions | 140 | * MMU Register bit definitions |
153 | */ | 141 | */ |
154 | #define MMU_LOCK_BASE_SHIFT 10 | ||
155 | #define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT) | ||
156 | #define MMU_LOCK_BASE(x) \ | ||
157 | ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT) | ||
158 | |||
159 | #define MMU_LOCK_VICT_SHIFT 4 | ||
160 | #define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT) | ||
161 | #define MMU_LOCK_VICT(x) \ | ||
162 | ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT) | ||
163 | |||
164 | #define MMU_CAM_VATAG_SHIFT 12 | 142 | #define MMU_CAM_VATAG_SHIFT 12 |
165 | #define MMU_CAM_VATAG_MASK \ | 143 | #define MMU_CAM_VATAG_MASK \ |
166 | ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT) | 144 | ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT) |
@@ -222,20 +200,15 @@ extern void omap_iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e); | |||
222 | extern int | 200 | extern int |
223 | omap_iopgtable_store_entry(struct omap_iommu *obj, struct iotlb_entry *e); | 201 | omap_iopgtable_store_entry(struct omap_iommu *obj, struct iotlb_entry *e); |
224 | 202 | ||
225 | extern int omap_iommu_set_isr(const char *name, | ||
226 | int (*isr)(struct omap_iommu *obj, u32 da, u32 iommu_errs, | ||
227 | void *priv), | ||
228 | void *isr_priv); | ||
229 | |||
230 | extern void omap_iommu_save_ctx(struct device *dev); | 203 | extern void omap_iommu_save_ctx(struct device *dev); |
231 | extern void omap_iommu_restore_ctx(struct device *dev); | 204 | extern void omap_iommu_restore_ctx(struct device *dev); |
232 | 205 | ||
233 | extern int omap_install_iommu_arch(const struct iommu_functions *ops); | ||
234 | extern void omap_uninstall_iommu_arch(const struct iommu_functions *ops); | ||
235 | |||
236 | extern int omap_foreach_iommu_device(void *data, | 206 | extern int omap_foreach_iommu_device(void *data, |
237 | int (*fn)(struct device *, void *)); | 207 | int (*fn)(struct device *, void *)); |
238 | 208 | ||
209 | extern int omap_install_iommu_arch(const struct iommu_functions *ops); | ||
210 | extern void omap_uninstall_iommu_arch(const struct iommu_functions *ops); | ||
211 | |||
239 | extern ssize_t | 212 | extern ssize_t |
240 | omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len); | 213 | omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len); |
241 | extern size_t | 214 | extern size_t |
diff --git a/drivers/iommu/omap-iommu2.c b/drivers/iommu/omap-iommu2.c index f97c3863ef88..29e98a2af906 100644 --- a/drivers/iommu/omap-iommu2.c +++ b/drivers/iommu/omap-iommu2.c | |||
@@ -68,6 +68,12 @@ | |||
68 | ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \ | 68 | ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \ |
69 | ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0) | 69 | ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0) |
70 | 70 | ||
71 | /* IOMMU errors */ | ||
72 | #define OMAP_IOMMU_ERR_TLB_MISS (1 << 0) | ||
73 | #define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1) | ||
74 | #define OMAP_IOMMU_ERR_EMU_MISS (1 << 2) | ||
75 | #define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3) | ||
76 | #define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4) | ||
71 | 77 | ||
72 | static void __iommu_set_twl(struct omap_iommu *obj, bool on) | 78 | static void __iommu_set_twl(struct omap_iommu *obj, bool on) |
73 | { | 79 | { |