diff options
-rw-r--r-- | arch/mips/include/asm/io.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 501a40b9f18d..436878e4e063 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h | |||
@@ -295,6 +295,12 @@ static inline void iounmap(const volatile void __iomem *addr) | |||
295 | #undef __IS_KSEG1 | 295 | #undef __IS_KSEG1 |
296 | } | 296 | } |
297 | 297 | ||
298 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
299 | #define war_octeon_io_reorder_wmb() wmb() | ||
300 | #else | ||
301 | #define war_octeon_io_reorder_wmb() do { } while (0) | ||
302 | #endif | ||
303 | |||
298 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ | 304 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ |
299 | \ | 305 | \ |
300 | static inline void pfx##write##bwlq(type val, \ | 306 | static inline void pfx##write##bwlq(type val, \ |
@@ -303,6 +309,8 @@ static inline void pfx##write##bwlq(type val, \ | |||
303 | volatile type *__mem; \ | 309 | volatile type *__mem; \ |
304 | type __val; \ | 310 | type __val; \ |
305 | \ | 311 | \ |
312 | war_octeon_io_reorder_wmb(); \ | ||
313 | \ | ||
306 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ | 314 | __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ |
307 | \ | 315 | \ |
308 | __val = pfx##ioswab##bwlq(__mem, val); \ | 316 | __val = pfx##ioswab##bwlq(__mem, val); \ |
@@ -370,6 +378,8 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ | |||
370 | volatile type *__addr; \ | 378 | volatile type *__addr; \ |
371 | type __val; \ | 379 | type __val; \ |
372 | \ | 380 | \ |
381 | war_octeon_io_reorder_wmb(); \ | ||
382 | \ | ||
373 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ | 383 | __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ |
374 | \ | 384 | \ |
375 | __val = pfx##ioswab##bwlq(__addr, val); \ | 385 | __val = pfx##ioswab##bwlq(__addr, val); \ |
@@ -504,8 +514,12 @@ BUILDSTRING(q, u64) | |||
504 | #endif | 514 | #endif |
505 | 515 | ||
506 | 516 | ||
517 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
518 | #define mmiowb() wmb() | ||
519 | #else | ||
507 | /* Depends on MIPS II instruction set */ | 520 | /* Depends on MIPS II instruction set */ |
508 | #define mmiowb() asm volatile ("sync" ::: "memory") | 521 | #define mmiowb() asm volatile ("sync" ::: "memory") |
522 | #endif | ||
509 | 523 | ||
510 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) | 524 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) |
511 | { | 525 | { |