diff options
author | Ido Yariv <ido@wizery.com> | 2012-11-02 15:23:56 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-11-20 13:03:13 -0500 |
commit | 8953fe54e7bd0f8cf1a763204e0e3b9e32bcc223 (patch) | |
tree | f29d8e9cab5b91cd98f8d5071a105f989fcb7994 /arch/arm/plat-omap | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
ARM: OMAP: Merge iommu2.h into iommu.h
Since iommu is not supported on OMAP1 and will not likely to ever be
supported, merge plat/iommu2.h into iommu.h so only one file would have
to move to platform_data/ as part of the single zImage effort.
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/iommu.h | 88 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/iommu2.h | 96 |
2 files changed, 83 insertions, 101 deletions
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h index 68b5f0362f35..7e8c7b66ee35 100644 --- a/arch/arm/plat-omap/include/plat/iommu.h +++ b/arch/arm/plat-omap/include/plat/iommu.h | |||
@@ -13,6 +13,12 @@ | |||
13 | #ifndef __MACH_IOMMU_H | 13 | #ifndef __MACH_IOMMU_H |
14 | #define __MACH_IOMMU_H | 14 | #define __MACH_IOMMU_H |
15 | 15 | ||
16 | #include <linux/io.h> | ||
17 | |||
18 | #if defined(CONFIG_ARCH_OMAP1) | ||
19 | #error "iommu for this processor not implemented yet" | ||
20 | #endif | ||
21 | |||
16 | struct iotlb_entry { | 22 | struct iotlb_entry { |
17 | u32 da; | 23 | u32 da; |
18 | u32 pa; | 24 | u32 pa; |
@@ -159,11 +165,70 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev) | |||
159 | #define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3) | 165 | #define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3) |
160 | #define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4) | 166 | #define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4) |
161 | 167 | ||
162 | #if defined(CONFIG_ARCH_OMAP1) | 168 | /* |
163 | #error "iommu for this processor not implemented yet" | 169 | * MMU Register offsets |
164 | #else | 170 | */ |
165 | #include <plat/iommu2.h> | 171 | #define MMU_REVISION 0x00 |
166 | #endif | 172 | #define MMU_SYSCONFIG 0x10 |
173 | #define MMU_SYSSTATUS 0x14 | ||
174 | #define MMU_IRQSTATUS 0x18 | ||
175 | #define MMU_IRQENABLE 0x1c | ||
176 | #define MMU_WALKING_ST 0x40 | ||
177 | #define MMU_CNTL 0x44 | ||
178 | #define MMU_FAULT_AD 0x48 | ||
179 | #define MMU_TTB 0x4c | ||
180 | #define MMU_LOCK 0x50 | ||
181 | #define MMU_LD_TLB 0x54 | ||
182 | #define MMU_CAM 0x58 | ||
183 | #define MMU_RAM 0x5c | ||
184 | #define MMU_GFLUSH 0x60 | ||
185 | #define MMU_FLUSH_ENTRY 0x64 | ||
186 | #define MMU_READ_CAM 0x68 | ||
187 | #define MMU_READ_RAM 0x6c | ||
188 | #define MMU_EMU_FAULT_AD 0x70 | ||
189 | |||
190 | #define MMU_REG_SIZE 256 | ||
191 | |||
192 | /* | ||
193 | * MMU Register bit definitions | ||
194 | */ | ||
195 | #define MMU_LOCK_BASE_SHIFT 10 | ||
196 | #define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT) | ||
197 | #define MMU_LOCK_BASE(x) \ | ||
198 | ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT) | ||
199 | |||
200 | #define MMU_LOCK_VICT_SHIFT 4 | ||
201 | #define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT) | ||
202 | #define MMU_LOCK_VICT(x) \ | ||
203 | ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT) | ||
204 | |||
205 | #define MMU_CAM_VATAG_SHIFT 12 | ||
206 | #define MMU_CAM_VATAG_MASK \ | ||
207 | ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT) | ||
208 | #define MMU_CAM_P (1 << 3) | ||
209 | #define MMU_CAM_V (1 << 2) | ||
210 | #define MMU_CAM_PGSZ_MASK 3 | ||
211 | #define MMU_CAM_PGSZ_1M (0 << 0) | ||
212 | #define MMU_CAM_PGSZ_64K (1 << 0) | ||
213 | #define MMU_CAM_PGSZ_4K (2 << 0) | ||
214 | #define MMU_CAM_PGSZ_16M (3 << 0) | ||
215 | |||
216 | #define MMU_RAM_PADDR_SHIFT 12 | ||
217 | #define MMU_RAM_PADDR_MASK \ | ||
218 | ((~0UL >> MMU_RAM_PADDR_SHIFT) << MMU_RAM_PADDR_SHIFT) | ||
219 | #define MMU_RAM_ENDIAN_SHIFT 9 | ||
220 | #define MMU_RAM_ENDIAN_MASK (1 << MMU_RAM_ENDIAN_SHIFT) | ||
221 | #define MMU_RAM_ENDIAN_BIG (1 << MMU_RAM_ENDIAN_SHIFT) | ||
222 | #define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT) | ||
223 | #define MMU_RAM_ELSZ_SHIFT 7 | ||
224 | #define MMU_RAM_ELSZ_MASK (3 << MMU_RAM_ELSZ_SHIFT) | ||
225 | #define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT) | ||
226 | #define MMU_RAM_ELSZ_16 (1 << MMU_RAM_ELSZ_SHIFT) | ||
227 | #define MMU_RAM_ELSZ_32 (2 << MMU_RAM_ELSZ_SHIFT) | ||
228 | #define MMU_RAM_ELSZ_NONE (3 << MMU_RAM_ELSZ_SHIFT) | ||
229 | #define MMU_RAM_MIXED_SHIFT 6 | ||
230 | #define MMU_RAM_MIXED_MASK (1 << MMU_RAM_MIXED_SHIFT) | ||
231 | #define MMU_RAM_MIXED MMU_RAM_MIXED_MASK | ||
167 | 232 | ||
168 | /* | 233 | /* |
169 | * utilities for super page(16MB, 1MB, 64KB and 4KB) | 234 | * utilities for super page(16MB, 1MB, 64KB and 4KB) |
@@ -218,4 +283,17 @@ omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len); | |||
218 | extern size_t | 283 | extern size_t |
219 | omap_dump_tlb_entries(struct omap_iommu *obj, char *buf, ssize_t len); | 284 | omap_dump_tlb_entries(struct omap_iommu *obj, char *buf, ssize_t len); |
220 | 285 | ||
286 | /* | ||
287 | * register accessors | ||
288 | */ | ||
289 | static inline u32 iommu_read_reg(struct omap_iommu *obj, size_t offs) | ||
290 | { | ||
291 | return __raw_readl(obj->regbase + offs); | ||
292 | } | ||
293 | |||
294 | static inline void iommu_write_reg(struct omap_iommu *obj, u32 val, size_t offs) | ||
295 | { | ||
296 | __raw_writel(val, obj->regbase + offs); | ||
297 | } | ||
298 | |||
221 | #endif /* __MACH_IOMMU_H */ | 299 | #endif /* __MACH_IOMMU_H */ |
diff --git a/arch/arm/plat-omap/include/plat/iommu2.h b/arch/arm/plat-omap/include/plat/iommu2.h deleted file mode 100644 index d4116b595e40..000000000000 --- a/arch/arm/plat-omap/include/plat/iommu2.h +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | /* | ||
2 | * omap iommu: omap2 architecture specific definitions | ||
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 | #ifndef __MACH_IOMMU2_H | ||
14 | #define __MACH_IOMMU2_H | ||
15 | |||
16 | #include <linux/io.h> | ||
17 | |||
18 | /* | ||
19 | * MMU Register offsets | ||
20 | */ | ||
21 | #define MMU_REVISION 0x00 | ||
22 | #define MMU_SYSCONFIG 0x10 | ||
23 | #define MMU_SYSSTATUS 0x14 | ||
24 | #define MMU_IRQSTATUS 0x18 | ||
25 | #define MMU_IRQENABLE 0x1c | ||
26 | #define MMU_WALKING_ST 0x40 | ||
27 | #define MMU_CNTL 0x44 | ||
28 | #define MMU_FAULT_AD 0x48 | ||
29 | #define MMU_TTB 0x4c | ||
30 | #define MMU_LOCK 0x50 | ||
31 | #define MMU_LD_TLB 0x54 | ||
32 | #define MMU_CAM 0x58 | ||
33 | #define MMU_RAM 0x5c | ||
34 | #define MMU_GFLUSH 0x60 | ||
35 | #define MMU_FLUSH_ENTRY 0x64 | ||
36 | #define MMU_READ_CAM 0x68 | ||
37 | #define MMU_READ_RAM 0x6c | ||
38 | #define MMU_EMU_FAULT_AD 0x70 | ||
39 | |||
40 | #define MMU_REG_SIZE 256 | ||
41 | |||
42 | /* | ||
43 | * MMU Register bit definitions | ||
44 | */ | ||
45 | #define MMU_LOCK_BASE_SHIFT 10 | ||
46 | #define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT) | ||
47 | #define MMU_LOCK_BASE(x) \ | ||
48 | ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT) | ||
49 | |||
50 | #define MMU_LOCK_VICT_SHIFT 4 | ||
51 | #define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT) | ||
52 | #define MMU_LOCK_VICT(x) \ | ||
53 | ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT) | ||
54 | |||
55 | #define MMU_CAM_VATAG_SHIFT 12 | ||
56 | #define MMU_CAM_VATAG_MASK \ | ||
57 | ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT) | ||
58 | #define MMU_CAM_P (1 << 3) | ||
59 | #define MMU_CAM_V (1 << 2) | ||
60 | #define MMU_CAM_PGSZ_MASK 3 | ||
61 | #define MMU_CAM_PGSZ_1M (0 << 0) | ||
62 | #define MMU_CAM_PGSZ_64K (1 << 0) | ||
63 | #define MMU_CAM_PGSZ_4K (2 << 0) | ||
64 | #define MMU_CAM_PGSZ_16M (3 << 0) | ||
65 | |||
66 | #define MMU_RAM_PADDR_SHIFT 12 | ||
67 | #define MMU_RAM_PADDR_MASK \ | ||
68 | ((~0UL >> MMU_RAM_PADDR_SHIFT) << MMU_RAM_PADDR_SHIFT) | ||
69 | #define MMU_RAM_ENDIAN_SHIFT 9 | ||
70 | #define MMU_RAM_ENDIAN_MASK (1 << MMU_RAM_ENDIAN_SHIFT) | ||
71 | #define MMU_RAM_ENDIAN_BIG (1 << MMU_RAM_ENDIAN_SHIFT) | ||
72 | #define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT) | ||
73 | #define MMU_RAM_ELSZ_SHIFT 7 | ||
74 | #define MMU_RAM_ELSZ_MASK (3 << MMU_RAM_ELSZ_SHIFT) | ||
75 | #define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT) | ||
76 | #define MMU_RAM_ELSZ_16 (1 << MMU_RAM_ELSZ_SHIFT) | ||
77 | #define MMU_RAM_ELSZ_32 (2 << MMU_RAM_ELSZ_SHIFT) | ||
78 | #define MMU_RAM_ELSZ_NONE (3 << MMU_RAM_ELSZ_SHIFT) | ||
79 | #define MMU_RAM_MIXED_SHIFT 6 | ||
80 | #define MMU_RAM_MIXED_MASK (1 << MMU_RAM_MIXED_SHIFT) | ||
81 | #define MMU_RAM_MIXED MMU_RAM_MIXED_MASK | ||
82 | |||
83 | /* | ||
84 | * register accessors | ||
85 | */ | ||
86 | static inline u32 iommu_read_reg(struct omap_iommu *obj, size_t offs) | ||
87 | { | ||
88 | return __raw_readl(obj->regbase + offs); | ||
89 | } | ||
90 | |||
91 | static inline void iommu_write_reg(struct omap_iommu *obj, u32 val, size_t offs) | ||
92 | { | ||
93 | __raw_writel(val, obj->regbase + offs); | ||
94 | } | ||
95 | |||
96 | #endif /* __MACH_IOMMU2_H */ | ||