Commit f3b17320 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Stafford Horne

openrisc: map as uncached in ioremap

Openrisc is the only architecture not mapping ioremap as uncached,
which has been the default since the Linux 2.6.x days.  Switch it
over to implement uncached semantics by default.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
parent eabe7e9a
...@@ -25,25 +25,11 @@ ...@@ -25,25 +25,11 @@
#define PIO_OFFSET 0 #define PIO_OFFSET 0
#define PIO_MASK 0 #define PIO_MASK 0
#define ioremap_nocache ioremap_nocache #define ioremap_nocache ioremap
#include <asm-generic/io.h> #include <asm-generic/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
extern void __iomem *__ioremap(phys_addr_t offset, unsigned long size, void __iomem *ioremap(phys_addr_t offset, unsigned long size);
pgprot_t prot);
static inline void __iomem *ioremap(phys_addr_t offset, size_t size)
{
return __ioremap(offset, size, PAGE_KERNEL);
}
/* #define _PAGE_CI 0x002 */
static inline void __iomem *ioremap_nocache(phys_addr_t offset,
unsigned long size)
{
return __ioremap(offset, size,
__pgprot(pgprot_val(PAGE_KERNEL) | _PAGE_CI));
}
extern void iounmap(void *addr); extern void iounmap(void *addr);
#endif #endif
...@@ -97,7 +97,7 @@ extern void paging_init(void); ...@@ -97,7 +97,7 @@ extern void paging_init(void);
/* Define some higher level generic page attributes. /* Define some higher level generic page attributes.
* *
* If you change _PAGE_CI definition be sure to change it in * If you change _PAGE_CI definition be sure to change it in
* io.h for ioremap_nocache() too. * io.h for ioremap() too.
*/ */
/* /*
......
...@@ -34,8 +34,7 @@ static unsigned int fixmaps_used __initdata; ...@@ -34,8 +34,7 @@ static unsigned int fixmaps_used __initdata;
* have to convert them into an offset in a page-aligned mapping, but the * have to convert them into an offset in a page-aligned mapping, but the
* caller shouldn't need to know that small detail. * caller shouldn't need to know that small detail.
*/ */
void __iomem *__ref void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size)
__ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
{ {
phys_addr_t p; phys_addr_t p;
unsigned long v; unsigned long v;
...@@ -66,7 +65,8 @@ __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot) ...@@ -66,7 +65,8 @@ __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
fixmaps_used += (size >> PAGE_SHIFT); fixmaps_used += (size >> PAGE_SHIFT);
} }
if (ioremap_page_range(v, v + size, p, prot)) { if (ioremap_page_range(v, v + size, p,
__pgprot(pgprot_val(PAGE_KERNEL) | _PAGE_CI))) {
if (likely(mem_init_done)) if (likely(mem_init_done))
vfree(area->addr); vfree(area->addr);
else else
...@@ -76,7 +76,7 @@ __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot) ...@@ -76,7 +76,7 @@ __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
return (void __iomem *)(offset + (char *)v); return (void __iomem *)(offset + (char *)v);
} }
EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(ioremap);
void iounmap(void *addr) void iounmap(void *addr)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment