diff options
Diffstat (limited to 'arch/arm/include/asm/io.h')
-rw-r--r-- | arch/arm/include/asm/io.h | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index d66605dea55a..065d100fa63e 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -80,6 +80,7 @@ extern void __iomem *__arm_ioremap_caller(unsigned long, size_t, unsigned int, | |||
80 | 80 | ||
81 | extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); | 81 | extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int); |
82 | extern void __iomem *__arm_ioremap(unsigned long, size_t, unsigned int); | 82 | extern void __iomem *__arm_ioremap(unsigned long, size_t, unsigned int); |
83 | extern void __iomem *__arm_ioremap_exec(unsigned long, size_t, bool cached); | ||
83 | extern void __iounmap(volatile void __iomem *addr); | 84 | extern void __iounmap(volatile void __iomem *addr); |
84 | 85 | ||
85 | /* | 86 | /* |
@@ -110,6 +111,27 @@ static inline void __iomem *__typesafe_io(unsigned long addr) | |||
110 | #include <mach/io.h> | 111 | #include <mach/io.h> |
111 | 112 | ||
112 | /* | 113 | /* |
114 | * This is the limit of PC card/PCI/ISA IO space, which is by default | ||
115 | * 64K if we have PC card, PCI or ISA support. Otherwise, default to | ||
116 | * zero to prevent ISA/PCI drivers claiming IO space (and potentially | ||
117 | * oopsing.) | ||
118 | * | ||
119 | * Only set this larger if you really need inb() et.al. to operate over | ||
120 | * a larger address space. Note that SOC_COMMON ioremaps each sockets | ||
121 | * IO space area, and so inb() et.al. must be defined to operate as per | ||
122 | * readb() et.al. on such platforms. | ||
123 | */ | ||
124 | #ifndef IO_SPACE_LIMIT | ||
125 | #if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE) | ||
126 | #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) | ||
127 | #elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD) | ||
128 | #define IO_SPACE_LIMIT ((resource_size_t)0xffff) | ||
129 | #else | ||
130 | #define IO_SPACE_LIMIT ((resource_size_t)0) | ||
131 | #endif | ||
132 | #endif | ||
133 | |||
134 | /* | ||
113 | * IO port access primitives | 135 | * IO port access primitives |
114 | * ------------------------- | 136 | * ------------------------- |
115 | * | 137 | * |
@@ -189,11 +211,11 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
189 | * IO port primitives for more information. | 211 | * IO port primitives for more information. |
190 | */ | 212 | */ |
191 | #ifdef __mem_pci | 213 | #ifdef __mem_pci |
192 | #define readb_relaxed(c) ({ u8 __v = __raw_readb(__mem_pci(c)); __v; }) | 214 | #define readb_relaxed(c) ({ u8 __r = __raw_readb(__mem_pci(c)); __r; }) |
193 | #define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \ | 215 | #define readw_relaxed(c) ({ u16 __r = le16_to_cpu((__force __le16) \ |
194 | __raw_readw(__mem_pci(c))); __v; }) | 216 | __raw_readw(__mem_pci(c))); __r; }) |
195 | #define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \ | 217 | #define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \ |
196 | __raw_readl(__mem_pci(c))); __v; }) | 218 | __raw_readl(__mem_pci(c))); __r; }) |
197 | 219 | ||
198 | #define writeb_relaxed(v,c) ((void)__raw_writeb(v,__mem_pci(c))) | 220 | #define writeb_relaxed(v,c) ((void)__raw_writeb(v,__mem_pci(c))) |
199 | #define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ | 221 | #define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ |
@@ -238,7 +260,7 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
238 | * ioremap and friends. | 260 | * ioremap and friends. |
239 | * | 261 | * |
240 | * ioremap takes a PCI memory address, as specified in | 262 | * ioremap takes a PCI memory address, as specified in |
241 | * Documentation/IO-mapping.txt. | 263 | * Documentation/io-mapping.txt. |
242 | * | 264 | * |
243 | */ | 265 | */ |
244 | #ifndef __arch_ioremap | 266 | #ifndef __arch_ioremap |
@@ -260,10 +282,16 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
260 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; }) | 282 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; }) |
261 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; }) | 283 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; }) |
262 | 284 | ||
285 | #define ioread16be(p) ({ unsigned int __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; }) | ||
286 | #define ioread32be(p) ({ unsigned int __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; }) | ||
287 | |||
263 | #define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); }) | 288 | #define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); }) |
264 | #define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); }) | 289 | #define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); }) |
265 | #define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); }) | 290 | #define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); }) |
266 | 291 | ||
292 | #define iowrite16be(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_be16(v), p); }) | ||
293 | #define iowrite32be(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_be32(v), p); }) | ||
294 | |||
267 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) | 295 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) |
268 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) | 296 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) |
269 | #define ioread32_rep(p,d,c) __raw_readsl(p,d,c) | 297 | #define ioread32_rep(p,d,c) __raw_readsl(p,d,c) |