aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-05-08 17:41:59 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 00:30:42 -0400
commitbe135f40899cb3334faa7d2e27025055da311ec4 (patch)
tree8dd20fc82c239562a16fdf9d8f32065e9927b231 /arch/powerpc
parentf5f0307f42d39a51a925ca4841f76a2f2ea330ff (diff)
powerpc: Add ioremap_wc
Add ioremap_wc so drivers can request write combining on kernel mappings. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/io.h5
-rw-r--r--arch/powerpc/mm/pgtable_32.c8
-rw-r--r--arch/powerpc/mm/pgtable_64.c11
3 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 2f365f5007a0..662d2edae768 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -2,6 +2,8 @@
2#define _ASM_POWERPC_IO_H 2#define _ASM_POWERPC_IO_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#define ARCH_HAS_IOREMAP_WC
6
5/* 7/*
6 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -628,6 +630,8 @@ static inline void iosync(void)
628 * 630 *
629 * * ioremap_nocache is identical to ioremap 631 * * ioremap_nocache is identical to ioremap
630 * 632 *
633 * * ioremap_wc enables write combining
634 *
631 * * iounmap undoes such a mapping and can be hooked 635 * * iounmap undoes such a mapping and can be hooked
632 * 636 *
633 * * __ioremap_at (and the pending __iounmap_at) are low level functions to 637 * * __ioremap_at (and the pending __iounmap_at) are low level functions to
@@ -648,6 +652,7 @@ static inline void iosync(void)
648extern void __iomem *ioremap(phys_addr_t address, unsigned long size); 652extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
649extern void __iomem *ioremap_flags(phys_addr_t address, unsigned long size, 653extern void __iomem *ioremap_flags(phys_addr_t address, unsigned long size,
650 unsigned long flags); 654 unsigned long flags);
655extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size);
651#define ioremap_nocache(addr, size) ioremap((addr), (size)) 656#define ioremap_nocache(addr, size) ioremap((addr), (size))
652#define ioremap_prot(addr, size, prot) ioremap_flags((addr), (size), (prot)) 657#define ioremap_prot(addr, size, prot) ioremap_flags((addr), (size), (prot))
653 658
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 8dc41c0157fe..fca98f8fb600 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -133,6 +133,14 @@ ioremap(phys_addr_t addr, unsigned long size)
133EXPORT_SYMBOL(ioremap); 133EXPORT_SYMBOL(ioremap);
134 134
135void __iomem * 135void __iomem *
136ioremap_wc(phys_addr_t addr, unsigned long size)
137{
138 return __ioremap_caller(addr, size, _PAGE_NO_CACHE,
139 __builtin_return_address(0));
140}
141EXPORT_SYMBOL(ioremap_wc);
142
143void __iomem *
136ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags) 144ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags)
137{ 145{
138 /* writeable implies dirty for kernel addresses */ 146 /* writeable implies dirty for kernel addresses */
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 88927a05cdc2..1146fc6e8921 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -255,6 +255,16 @@ void __iomem * ioremap(phys_addr_t addr, unsigned long size)
255 return __ioremap_caller(addr, size, flags, caller); 255 return __ioremap_caller(addr, size, flags, caller);
256} 256}
257 257
258void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
259{
260 unsigned long flags = _PAGE_NO_CACHE;
261 void *caller = __builtin_return_address(0);
262
263 if (ppc_md.ioremap)
264 return ppc_md.ioremap(addr, size, flags, caller);
265 return __ioremap_caller(addr, size, flags, caller);
266}
267
258void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size, 268void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size,
259 unsigned long flags) 269 unsigned long flags)
260{ 270{
@@ -311,6 +321,7 @@ void iounmap(volatile void __iomem *token)
311} 321}
312 322
313EXPORT_SYMBOL(ioremap); 323EXPORT_SYMBOL(ioremap);
324EXPORT_SYMBOL(ioremap_wc);
314EXPORT_SYMBOL(ioremap_flags); 325EXPORT_SYMBOL(ioremap_flags);
315EXPORT_SYMBOL(__ioremap); 326EXPORT_SYMBOL(__ioremap);
316EXPORT_SYMBOL(__ioremap_at); 327EXPORT_SYMBOL(__ioremap_at);