@@ -133,6 +133,16 @@ __io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
#define outsq(addr, buffer, count) __outsq(PCI_IOBASE + (addr), buffer, count)
#endif
+#ifdef CONFIG_MMU
+#define ioremap_wc(addr, size) \
+ ioremap_prot((addr), (size), _PAGE_IOREMAP_WC)
+#endif
+
#include <asm-generic/io.h>
+#ifdef CONFIG_MMU
+#define ioremap_cache(addr, size) \
+ ioremap_prot((addr), (size), _PAGE_KERNEL)
+#endif
+
#endif /* _ASM_RISCV_IO_H */
@@ -182,6 +182,8 @@ extern struct pt_alloc_ops pt_ops __initdata;
#define PAGE_TABLE __pgprot(_PAGE_TABLE)
#define _PAGE_IOREMAP ((_PAGE_KERNEL & ~_PAGE_MTMASK) | _PAGE_IO)
+#define _PAGE_IOREMAP_WC ((_PAGE_KERNEL & ~_PAGE_MTMASK) | \
+ _PAGE_NOCACHE)
#define PAGE_KERNEL_IO __pgprot(_PAGE_IOREMAP)
extern pgd_t swapper_pg_dir[];