From: Anton Blanchard <anton@samba•org>
To: benh@kernel•crashing.org
Cc: linuxppc-dev@ozlabs•org
Subject: [PATCH 1/2] powerpc: Add ioremap_wc
Date: Mon, 9 May 2011 17:41:59 +1000 [thread overview]
Message-ID: <20110509174159.6f9759d9@kryten> (raw)
Add ioremap_wc so drivers can request write combining on kernel
mappings.
Signed-off-by: Anton Blanchard <anton@samba•org>
---
Index: linux-powerpc/arch/powerpc/include/asm/io.h
===================================================================
--- linux-powerpc.orig/arch/powerpc/include/asm/io.h 2011-05-09 11:25:11.987156163 +1000
+++ linux-powerpc/arch/powerpc/include/asm/io.h 2011-05-09 13:29:33.405575494 +1000
@@ -2,6 +2,8 @@
#define _ASM_POWERPC_IO_H
#ifdef __KERNEL__
+#define ARCH_HAS_IOREMAP_WC
+
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -628,6 +630,8 @@ static inline void iosync(void)
*
* * ioremap_nocache is identical to ioremap
*
+ * * ioremap_wc enables write combining
+ *
* * iounmap undoes such a mapping and can be hooked
*
* * __ioremap_at (and the pending __iounmap_at) are low level functions to
@@ -648,6 +652,7 @@ static inline void iosync(void)
extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
extern void __iomem *ioremap_flags(phys_addr_t address, unsigned long size,
unsigned long flags);
+extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size);
#define ioremap_nocache(addr, size) ioremap((addr), (size))
#define ioremap_prot(addr, size, prot) ioremap_flags((addr), (size), (prot))
Index: linux-powerpc/arch/powerpc/mm/pgtable_32.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/mm/pgtable_32.c 2011-05-09 13:29:48.565843294 +1000
+++ linux-powerpc/arch/powerpc/mm/pgtable_32.c 2011-05-09 13:30:21.376422809 +1000
@@ -133,6 +133,14 @@ ioremap(phys_addr_t addr, unsigned long
EXPORT_SYMBOL(ioremap);
void __iomem *
+ioremap_wc(phys_addr_t addr, unsigned long size)
+{
+ return __ioremap_caller(addr, size, _PAGE_NO_CACHE,
+ __builtin_return_address(0));
+}
+EXPORT_SYMBOL(ioremap_wc);
+
+void __iomem *
ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags)
{
/* writeable implies dirty for kernel addresses */
Index: linux-powerpc/arch/powerpc/mm/pgtable_64.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/mm/pgtable_64.c 2011-05-09 13:29:48.605844002 +1000
+++ linux-powerpc/arch/powerpc/mm/pgtable_64.c 2011-05-09 13:32:20.378523852 +1000
@@ -255,6 +255,16 @@ void __iomem * ioremap(phys_addr_t addr,
return __ioremap_caller(addr, size, flags, caller);
}
+void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
+{
+ unsigned long flags = _PAGE_NO_CACHE;
+ 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_flags(phys_addr_t addr, unsigned long size,
unsigned long flags)
{
@@ -311,6 +321,7 @@ void iounmap(volatile void __iomem *toke
}
EXPORT_SYMBOL(ioremap);
+EXPORT_SYMBOL(ioremap_wc);
EXPORT_SYMBOL(ioremap_flags);
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(__ioremap_at);
next reply other threads:[~2011-05-09 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 7:41 Anton Blanchard [this message]
2011-05-09 7:43 ` [PATCH 2/2] powerpc: Remove ioremap_flags Anton Blanchard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110509174159.6f9759d9@kryten \
--to=anton@samba$(echo .)org \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox