diff options
Diffstat (limited to 'include/asm-arm/io.h')
-rw-r--r-- | include/asm-arm/io.h | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 5f60b4220906..1d3caa42a386 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -56,13 +56,22 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); | |||
56 | 56 | ||
57 | /* | 57 | /* |
58 | * Architecture ioremap implementation. | 58 | * Architecture ioremap implementation. |
59 | * | ||
60 | * __ioremap takes CPU physical address. | ||
61 | * | ||
62 | * __ioremap_pfn takes a Page Frame Number and an offset into that page | ||
63 | */ | 59 | */ |
64 | extern void __iomem * __ioremap_pfn(unsigned long, unsigned long, size_t, unsigned long); | 60 | #define MT_DEVICE 0 |
65 | extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); | 61 | #define MT_DEVICE_NONSHARED 1 |
62 | #define MT_DEVICE_CACHED 2 | ||
63 | #define MT_DEVICE_IXP2000 3 | ||
64 | /* | ||
65 | * types 4 onwards can be found in asm/mach/map.h and are undefined | ||
66 | * for ioremap | ||
67 | */ | ||
68 | |||
69 | /* | ||
70 | * __arm_ioremap takes CPU physical address. | ||
71 | * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page | ||
72 | */ | ||
73 | extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); | ||
74 | extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int); | ||
66 | extern void __iounmap(volatile void __iomem *addr); | 75 | extern void __iounmap(volatile void __iomem *addr); |
67 | 76 | ||
68 | /* | 77 | /* |
@@ -203,14 +212,14 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
203 | * | 212 | * |
204 | */ | 213 | */ |
205 | #ifndef __arch_ioremap | 214 | #ifndef __arch_ioremap |
206 | #define ioremap(cookie,size) __ioremap(cookie,size,0) | 215 | #define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) |
207 | #define ioremap_nocache(cookie,size) __ioremap(cookie,size,0) | 216 | #define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) |
208 | #define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE) | 217 | #define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED) |
209 | #define iounmap(cookie) __iounmap(cookie) | 218 | #define iounmap(cookie) __iounmap(cookie) |
210 | #else | 219 | #else |
211 | #define ioremap(cookie,size) __arch_ioremap((cookie),(size),0) | 220 | #define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) |
212 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0) | 221 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) |
213 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE) | 222 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED) |
214 | #define iounmap(cookie) __arch_iounmap(cookie) | 223 | #define iounmap(cookie) __arch_iounmap(cookie) |
215 | #endif | 224 | #endif |
216 | 225 | ||
@@ -250,9 +259,11 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); | |||
250 | #define BIOVEC_MERGEABLE(vec1, vec2) \ | 259 | #define BIOVEC_MERGEABLE(vec1, vec2) \ |
251 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) | 260 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) |
252 | 261 | ||
262 | #ifdef CONFIG_MMU | ||
253 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE | 263 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE |
254 | extern int valid_phys_addr_range(unsigned long addr, size_t size); | 264 | extern int valid_phys_addr_range(unsigned long addr, size_t size); |
255 | extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); | 265 | extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); |
266 | #endif | ||
256 | 267 | ||
257 | /* | 268 | /* |
258 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 269 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |