aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/include/asm/io.h')
-rw-r--r--arch/tile/include/asm/io.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h
index d3cbb9b14cbe..c9ea1652af03 100644
--- a/arch/tile/include/asm/io.h
+++ b/arch/tile/include/asm/io.h
@@ -52,6 +52,7 @@ extern void iounmap(volatile void __iomem *addr);
52#endif 52#endif
53 53
54#define ioremap_nocache(physaddr, size) ioremap(physaddr, size) 54#define ioremap_nocache(physaddr, size) ioremap(physaddr, size)
55#define ioremap_wc(physaddr, size) ioremap(physaddr, size)
55#define ioremap_writethrough(physaddr, size) ioremap(physaddr, size) 56#define ioremap_writethrough(physaddr, size) ioremap(physaddr, size)
56#define ioremap_fullcache(physaddr, size) ioremap(physaddr, size) 57#define ioremap_fullcache(physaddr, size) ioremap(physaddr, size)
57 58
@@ -161,6 +162,15 @@ static inline void _tile_writeq(u64 val, unsigned long addr)
161#define iowrite32 writel 162#define iowrite32 writel
162#define iowrite64 writeq 163#define iowrite64 writeq
163 164
165static inline void memset_io(void *dst, int val, size_t len)
166{
167 int x;
168 BUG_ON((unsigned long)dst & 0x3);
169 val = (val & 0xff) * 0x01010101;
170 for (x = 0; x < len; x += 4)
171 writel(val, dst + x);
172}
173
164static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, 174static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
165 size_t len) 175 size_t len)
166{ 176{
@@ -269,6 +279,11 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
269 ioport_panic(); 279 ioport_panic();
270} 280}
271 281
282#define ioread16be(addr) be16_to_cpu(ioread16(addr))
283#define ioread32be(addr) be32_to_cpu(ioread32(addr))
284#define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr))
285#define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr))
286
272#define ioread8_rep(p, dst, count) \ 287#define ioread8_rep(p, dst, count) \
273 insb((unsigned long) (p), (dst), (count)) 288 insb((unsigned long) (p), (dst), (count))
274#define ioread16_rep(p, dst, count) \ 289#define ioread16_rep(p, dst, count) \
@@ -283,4 +298,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
283#define iowrite32_rep(p, src, count) \ 298#define iowrite32_rep(p, src, count) \
284 outsl((unsigned long) (p), (src), (count)) 299 outsl((unsigned long) (p), (src), (count))
285 300
301#define virt_to_bus virt_to_phys
302#define bus_to_virt phys_to_virt
303
286#endif /* _ASM_TILE_IO_H */ 304#endif /* _ASM_TILE_IO_H */