diff options
Diffstat (limited to 'arch/tile/include/asm/io.h')
-rw-r--r-- | arch/tile/include/asm/io.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h index ee43328713ab..c9ea1652af03 100644 --- a/arch/tile/include/asm/io.h +++ b/arch/tile/include/asm/io.h | |||
@@ -52,12 +52,10 @@ 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 | ||
58 | void __iomem *ioport_map(unsigned long port, unsigned int len); | ||
59 | extern inline void ioport_unmap(void __iomem *addr) {} | ||
60 | |||
61 | #define mmiowb() | 59 | #define mmiowb() |
62 | 60 | ||
63 | /* Conversion between virtual and physical mappings. */ | 61 | /* Conversion between virtual and physical mappings. */ |
@@ -164,6 +162,15 @@ static inline void _tile_writeq(u64 val, unsigned long addr) | |||
164 | #define iowrite32 writel | 162 | #define iowrite32 writel |
165 | #define iowrite64 writeq | 163 | #define iowrite64 writeq |
166 | 164 | ||
165 | static 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 | |||
167 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, | 174 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, |
168 | size_t len) | 175 | size_t len) |
169 | { | 176 | { |
@@ -189,12 +196,22 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, | |||
189 | * we never run, uses them unconditionally. | 196 | * we never run, uses them unconditionally. |
190 | */ | 197 | */ |
191 | 198 | ||
192 | static inline int ioport_panic(void) | 199 | static inline long ioport_panic(void) |
193 | { | 200 | { |
194 | panic("inb/outb and friends do not exist on tile"); | 201 | panic("inb/outb and friends do not exist on tile"); |
195 | return 0; | 202 | return 0; |
196 | } | 203 | } |
197 | 204 | ||
205 | static inline void __iomem *ioport_map(unsigned long port, unsigned int len) | ||
206 | { | ||
207 | return (void __iomem *) ioport_panic(); | ||
208 | } | ||
209 | |||
210 | static inline void ioport_unmap(void __iomem *addr) | ||
211 | { | ||
212 | ioport_panic(); | ||
213 | } | ||
214 | |||
198 | static inline u8 inb(unsigned long addr) | 215 | static inline u8 inb(unsigned long addr) |
199 | { | 216 | { |
200 | return ioport_panic(); | 217 | return ioport_panic(); |
@@ -262,6 +279,11 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
262 | ioport_panic(); | 279 | ioport_panic(); |
263 | } | 280 | } |
264 | 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 | |||
265 | #define ioread8_rep(p, dst, count) \ | 287 | #define ioread8_rep(p, dst, count) \ |
266 | insb((unsigned long) (p), (dst), (count)) | 288 | insb((unsigned long) (p), (dst), (count)) |
267 | #define ioread16_rep(p, dst, count) \ | 289 | #define ioread16_rep(p, dst, count) \ |
@@ -276,4 +298,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
276 | #define iowrite32_rep(p, src, count) \ | 298 | #define iowrite32_rep(p, src, count) \ |
277 | outsl((unsigned long) (p), (src), (count)) | 299 | outsl((unsigned long) (p), (src), (count)) |
278 | 300 | ||
301 | #define virt_to_bus virt_to_phys | ||
302 | #define bus_to_virt phys_to_virt | ||
303 | |||
279 | #endif /* _ASM_TILE_IO_H */ | 304 | #endif /* _ASM_TILE_IO_H */ |