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

arch/*/io.h: Add ioremap_wt() to all architectures

Add ioremap_wt() to all arch-specific asm/io.h headers which
define ioremap_wc() locally. These headers do not include
<asm-generic/iomap.h>. Some of them include <asm-generic/io.h>,
but ioremap_wt() is defined for consistency since they define
all ioremap_xxx locally.

In all architectures without Write-Through support, ioremap_wt()
is defined indentical to ioremap_nocache().

frv and m68k already have ioremap_writethrough(). On those we
add ioremap_wt() indetical to ioremap_writethrough() and defines
ARCH_HAS_IOREMAP_WT in both architectures.

The ioremap_wt() interface is exported to drivers.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Elliott@hp.com
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: arnd@arndb.de
Cc: hch@lst.de
Cc: hmh@hmh.eng.br
Cc: jgross@suse.com
Cc: konrad.wilk@oracle.com
Cc: linux-mm <linux-mm@kvack.org>
Cc: linux-nvdimm@lists.01.org
Cc: stefan.bader@canonical.com
Cc: yigal@plexistor.com
Link: http://lkml.kernel.org/r/1433436928-31903-9-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Toshi Kani and committed by
Ingo Molnar
556269c1 d838270e

+36
+1
arch/arc/include/asm/io.h
··· 20 20 21 21 #define ioremap_nocache(phy, sz) ioremap(phy, sz) 22 22 #define ioremap_wc(phy, sz) ioremap(phy, sz) 23 + #define ioremap_wt(phy, sz) ioremap(phy, sz) 23 24 24 25 /* Change struct page to physical address */ 25 26 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
+1
arch/arm/include/asm/io.h
··· 336 336 #define ioremap_nocache(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE) 337 337 #define ioremap_cache(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE_CACHED) 338 338 #define ioremap_wc(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE_WC) 339 + #define ioremap_wt(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE) 339 340 #define iounmap __arm_iounmap 340 341 341 342 /*
+1
arch/arm64/include/asm/io.h
··· 170 170 #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) 171 171 #define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) 172 172 #define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC)) 173 + #define ioremap_wt(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) 173 174 #define iounmap __iounmap 174 175 175 176 /*
+1
arch/avr32/include/asm/io.h
··· 296 296 __iounmap(addr) 297 297 298 298 #define ioremap_wc ioremap_nocache 299 + #define ioremap_wt ioremap_nocache 299 300 300 301 #define cached(addr) P1SEGADDR(addr) 301 302 #define uncached(addr) P2SEGADDR(addr)
+7
arch/frv/include/asm/io.h
··· 17 17 18 18 #ifdef __KERNEL__ 19 19 20 + #define ARCH_HAS_IOREMAP_WT 21 + 20 22 #include <linux/types.h> 21 23 #include <asm/virtconvert.h> 22 24 #include <asm/string.h> ··· 268 266 } 269 267 270 268 static inline void __iomem *ioremap_writethrough(unsigned long physaddr, unsigned long size) 269 + { 270 + return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); 271 + } 272 + 273 + static inline void __iomem *ioremap_wt(unsigned long physaddr, unsigned long size) 271 274 { 272 275 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); 273 276 }
+1
arch/m32r/include/asm/io.h
··· 68 68 extern void iounmap(volatile void __iomem *addr); 69 69 #define ioremap_nocache(off,size) ioremap(off,size) 70 70 #define ioremap_wc ioremap_nocache 71 + #define ioremap_wt ioremap_nocache 71 72 72 73 /* 73 74 * IO bus memory addresses are also 1:1 with the physical address
+7
arch/m68k/include/asm/io_mm.h
··· 20 20 21 21 #ifdef __KERNEL__ 22 22 23 + #define ARCH_HAS_IOREMAP_WT 24 + 23 25 #include <linux/compiler.h> 24 26 #include <asm/raw_io.h> 25 27 #include <asm/virtconvert.h> ··· 468 466 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); 469 467 } 470 468 static inline void __iomem *ioremap_writethrough(unsigned long physaddr, 469 + unsigned long size) 470 + { 471 + return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); 472 + } 473 + static inline void __iomem *ioremap_wt(unsigned long physaddr, 471 474 unsigned long size) 472 475 { 473 476 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
+6
arch/m68k/include/asm/io_no.h
··· 3 3 4 4 #ifdef __KERNEL__ 5 5 6 + #define ARCH_HAS_IOREMAP_WT 7 + 6 8 #include <asm/virtconvert.h> 7 9 #include <asm-generic/iomap.h> 8 10 ··· 156 154 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); 157 155 } 158 156 static inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size) 157 + { 158 + return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); 159 + } 160 + static inline void *ioremap_wt(unsigned long physaddr, unsigned long size) 159 161 { 160 162 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); 161 163 }
+3
arch/metag/include/asm/io.h
··· 160 160 #define ioremap_wc(offset, size) \ 161 161 __ioremap((offset), (size), _PAGE_WR_COMBINE) 162 162 163 + #define ioremap_wt(offset, size) \ 164 + __ioremap((offset), (size), 0) 165 + 163 166 #define iounmap(addr) \ 164 167 __iounmap(addr) 165 168
+1
arch/microblaze/include/asm/io.h
··· 43 43 #define ioremap_nocache(addr, size) ioremap((addr), (size)) 44 44 #define ioremap_fullcache(addr, size) ioremap((addr), (size)) 45 45 #define ioremap_wc(addr, size) ioremap((addr), (size)) 46 + #define ioremap_wt(addr, size) ioremap((addr), (size)) 46 47 47 48 #endif /* CONFIG_MMU */ 48 49
+1
arch/mn10300/include/asm/io.h
··· 282 282 } 283 283 284 284 #define ioremap_wc ioremap_nocache 285 + #define ioremap_wt ioremap_nocache 285 286 286 287 static inline void iounmap(void __iomem *addr) 287 288 {
+1
arch/nios2/include/asm/io.h
··· 46 46 } 47 47 48 48 #define ioremap_wc ioremap_nocache 49 + #define ioremap_wt ioremap_nocache 49 50 50 51 /* Pages to physical address... */ 51 52 #define page_to_phys(page) virt_to_phys(page_to_virt(page))
+1
arch/s390/include/asm/io.h
··· 29 29 30 30 #define ioremap_nocache(addr, size) ioremap(addr, size) 31 31 #define ioremap_wc ioremap_nocache 32 + #define ioremap_wt ioremap_nocache 32 33 33 34 static inline void __iomem *ioremap(unsigned long offset, unsigned long size) 34 35 {
+1
arch/sparc/include/asm/io_32.h
··· 129 129 void __iomem *ioremap(unsigned long offset, unsigned long size); 130 130 #define ioremap_nocache(X,Y) ioremap((X),(Y)) 131 131 #define ioremap_wc(X,Y) ioremap((X),(Y)) 132 + #define ioremap_wt(X,Y) ioremap((X),(Y)) 132 133 void iounmap(volatile void __iomem *addr); 133 134 134 135 /* Create a virtual mapping cookie for an IO port range */
+1
arch/sparc/include/asm/io_64.h
··· 402 402 403 403 #define ioremap_nocache(X,Y) ioremap((X),(Y)) 404 404 #define ioremap_wc(X,Y) ioremap((X),(Y)) 405 + #define ioremap_wt(X,Y) ioremap((X),(Y)) 405 406 406 407 static inline void iounmap(volatile void __iomem *addr) 407 408 {
+1
arch/tile/include/asm/io.h
··· 54 54 55 55 #define ioremap_nocache(physaddr, size) ioremap(physaddr, size) 56 56 #define ioremap_wc(physaddr, size) ioremap(physaddr, size) 57 + #define ioremap_wt(physaddr, size) ioremap(physaddr, size) 57 58 #define ioremap_writethrough(physaddr, size) ioremap(physaddr, size) 58 59 #define ioremap_fullcache(physaddr, size) ioremap(physaddr, size) 59 60
+1
arch/xtensa/include/asm/io.h
··· 59 59 } 60 60 61 61 #define ioremap_wc ioremap_nocache 62 + #define ioremap_wt ioremap_nocache 62 63 63 64 static inline void __iomem *ioremap(unsigned long offset, unsigned long size) 64 65 {