]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
openrisc: map as uncached in ioremap
authorChristoph Hellwig <hch@lst.de>
Sat, 17 Aug 2019 07:32:32 +0000 (09:32 +0200)
committerStafford Horne <shorne@gmail.com>
Sat, 31 Aug 2019 02:57:53 +0000 (11:57 +0900)
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Stafford Horne <shorne@gmail.com>
arch/openrisc/include/asm/io.h
arch/openrisc/include/asm/pgtable.h
arch/openrisc/mm/ioremap.c

index 06a710757789e7cc6a85f1caa7580ecf9ac0bc23..5b81a96ab85ee4acb1ccb4bd670f2771b483b28f 100644 (file)
 #define PIO_OFFSET             0
 #define PIO_MASK               0
 
-#define ioremap_nocache ioremap_nocache
+#define ioremap_nocache ioremap
 #include <asm-generic/io.h>
 #include <asm/pgtable.h>
 
-extern 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));
-}
-
+void __iomem *ioremap(phys_addr_t offset, unsigned long size);
 extern void iounmap(void *addr);
+
 #endif
index 497fd908a4c40c4d9b7119fad7a1f9d044e8c739..2fe9ff5b5d6f7d8b4ac00f35858036032820f207 100644 (file)
@@ -97,7 +97,7 @@ extern void paging_init(void);
 /* Define some higher level generic page attributes.
  *
  * If you change _PAGE_CI definition be sure to change it in
- * io.h for ioremap_nocache() too.
+ * io.h for ioremap() too.
  */
 
 /*
index e0c551ca0891776282db3827e38a04070e32e63e..8f8e97f7eac981302d621c5063e5ef349573f073 100644 (file)
@@ -34,8 +34,7 @@ static unsigned int fixmaps_used __initdata;
  * have to convert them into an offset in a page-aligned mapping, but the
  * caller shouldn't need to know that small detail.
  */
-void __iomem *__ref
-__ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
+void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size)
 {
        phys_addr_t p;
        unsigned long v;
@@ -66,7 +65,8 @@ __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
                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))
                        vfree(area->addr);
                else
@@ -76,7 +76,7 @@ __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
 
        return (void __iomem *)(offset + (char *)v);
 }
-EXPORT_SYMBOL(__ioremap);
+EXPORT_SYMBOL(ioremap);
 
 void iounmap(void *addr)
 {