Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Modify core io.h macros to account for the Octeon Errata Core-301.

Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
8faca49a 7e69deb8

+14
+14
arch/mips/include/asm/io.h
··· 295 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 304 #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ 299 305 \ 300 306 static inline void pfx##write##bwlq(type val, \ ··· 308 302 { \ 309 303 volatile type *__mem; \ 310 304 type __val; \ 305 + \ 306 + war_octeon_io_reorder_wmb(); \ 311 307 \ 312 308 __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ 313 309 \ ··· 377 369 { \ 378 370 volatile type *__addr; \ 379 371 type __val; \ 372 + \ 373 + war_octeon_io_reorder_wmb(); \ 380 374 \ 381 375 __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ 382 376 \ ··· 514 504 #endif 515 505 516 506 507 + #ifdef CONFIG_CPU_CAVIUM_OCTEON 508 + #define mmiowb() wmb() 509 + #else 517 510 /* Depends on MIPS II instruction set */ 518 511 #define mmiowb() asm volatile ("sync" ::: "memory") 512 + #endif 519 513 520 514 static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) 521 515 {