Skip to content

Commit 7bd9e25

Browse files
Ido Yarivtmlind
authored andcommitted
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>
1 parent ed1c7de commit 7bd9e25

3 files changed

Lines changed: 24 additions & 30 deletions

File tree

‎drivers/iommu/omap-iommu.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ struct omap_iommu_domain {
5454
spinlock_t lock;
5555
};
5656

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+
5772
/* accommodate the difference between omap1 and omap2/3 */
5873
static const struct iommu_functions *arch_iommu;
5974

‎drivers/iommu/omap-iommu.h‎

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ struct cr_regs {
7272
};
7373
};
7474

75-
struct iotlb_lock {
76-
short base;
77-
short vict;
78-
};
79-
8075
/* architecture specific functions */
8176
struct iommu_functions {
8277
unsigned long version;
@@ -117,13 +112,6 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
117112
}
118113
#endif
119114

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-
127115
/*
128116
* MMU Register offsets
129117
*/
@@ -151,16 +139,6 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
151139
/*
152140
* MMU Register bit definitions
153141
*/
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-
164142
#define MMU_CAM_VATAG_SHIFT 12
165143
#define MMU_CAM_VATAG_MASK \
166144
((~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);
222200
extern int
223201
omap_iopgtable_store_entry(struct omap_iommu *obj, struct iotlb_entry *e);
224202

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-
230203
extern void omap_iommu_save_ctx(struct device *dev);
231204
extern void omap_iommu_restore_ctx(struct device *dev);
232205

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-
236206
extern int omap_foreach_iommu_device(void *data,
237207
int (*fn)(struct device *, void *));
238208

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+
239212
extern ssize_t
240213
omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len);
241214
extern size_t

‎drivers/iommu/omap-iommu2.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@
6868
((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \
6969
((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0)
7070

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)
7177

7278
static void __iommu_set_twl(struct omap_iommu *obj, bool on)
7379
{

0 commit comments

Comments
 (0)