summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2018-10-09 13:51:33 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2018-10-13 22:21:25 +1100
commit86c391bd5f47101acf1f3e0abd9fe0616ae2a4fb (patch)
tree7fd0801b74451e47227947f6e6ba92b40018a917 /arch/powerpc/mm
parentdfd718a2ed1f678e66749ffe41bdeafedf3f4314 (diff)
downloadlinux-86c391bd5f47101acf1f3e0abd9fe0616ae2a4fb.tar.gz
linux-86c391bd5f47101acf1f3e0abd9fe0616ae2a4fb.tar.bz2
linux-86c391bd5f47101acf1f3e0abd9fe0616ae2a4fb.zip
powerpc/32: Add ioremap_wt() and ioremap_coherent()
Other arches have ioremap_wt() to map IO areas write-through. Implement it on PPC as well in order to avoid drivers using __ioremap(_PAGE_WRITETHRU) Also implement ioremap_coherent() to avoid drivers using __ioremap(_PAGE_COHERENT) Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/pgtable_32.c16
-rw-r--r--arch/powerpc/mm/pgtable_64.c10
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 120a49bfb9c6..4c3adde09d95 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -90,6 +90,22 @@ ioremap_wc(phys_addr_t addr, unsigned long size)
EXPORT_SYMBOL(ioremap_wc);
void __iomem *
+ioremap_wt(phys_addr_t addr, unsigned long size)
+{
+ return __ioremap_caller(addr, size, _PAGE_WRITETHRU,
+ __builtin_return_address(0));
+}
+EXPORT_SYMBOL(ioremap_wt);
+
+void __iomem *
+ioremap_coherent(phys_addr_t addr, unsigned long size)
+{
+ return __ioremap_caller(addr, size, _PAGE_COHERENT,
+ __builtin_return_address(0));
+}
+EXPORT_SYMBOL(ioremap_coherent);
+
+void __iomem *
ioremap_prot(phys_addr_t addr, unsigned long size, unsigned long flags)
{
/* writeable implies dirty for kernel addresses */
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index e15e63079ba8..c0f356d9b135 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -222,6 +222,16 @@ void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
return __ioremap_caller(addr, size, flags, caller);
}
+void __iomem *ioremap_coherent(phys_addr_t addr, unsigned long size)
+{
+ unsigned long flags = pgprot_val(pgprot_cached(__pgprot(0)));
+ void *caller = __builtin_return_address(0);
+
+ if (ppc_md.ioremap)
+ return ppc_md.ioremap(addr, size, flags, caller);
+ return __ioremap_caller(addr, size, flags, caller);
+}
+
void __iomem * ioremap_prot(phys_addr_t addr, unsigned long size,
unsigned long flags)
{