diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-05-05 15:59:27 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-05-05 15:59:27 -0400 |
commit | 3603ab2b62ad8372fc93816b080b370dd55d7cec (patch) | |
tree | e9012ae43fe5988c288074ee12fc4a0fc2f6b63a /include/asm-arm/io.h | |
parent | 0af92befeb4b330c46cce6b520b2cc775cd6931f (diff) |
[ARM] mm 10: allow memory type to be specified with ioremap
__ioremap() took a set of page table flags (specifically the cacheable
and bufferable bits) to control the mapping type. However, with
the advent of ARMv6, this is far too limited.
Replace the page table flags with a memory type index, so that the
desired attributes can be selected from the mem_type table.
Finally, to prevent silent miscompilation due to the differing
arguments, rename the __ioremap() and __ioremap_pfn() functions.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/io.h')
-rw-r--r-- | include/asm-arm/io.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 5f60b4220906..8261ff9e7955 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 | ||