riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU
authorKefeng Wang <wangkefeng.wang@huawei.com>
Mon, 11 May 2020 02:19:54 +0000 (10:19 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Wed, 13 May 2020 00:20:32 +0000 (17:20 -0700)
Some drivers use PAGE_SHARED, pgprot_writecombine()/pgprot_device(),
add the defination to fix build error if NOMMU.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/mmio.h
arch/riscv/include/asm/pgtable.h

index a2c809df2733f52238e227331b5bc7679dcc1534..56053c9838b2fcdafd09f7e90b3b0d143e3ffad2 100644 (file)
@@ -16,6 +16,8 @@
 
 #ifndef CONFIG_MMU
 #define pgprot_noncached(x)    (x)
+#define pgprot_writecombine(x) (x)
+#define pgprot_device(x)       (x)
 #endif /* CONFIG_MMU */
 
 /* Generic IO read/write.  These perform native-endian accesses. */
index 9c188ad2e52d2f94245fd7b4984b5f4c74d3a1f7..f225e2fbdfb45a58019a56ba6b8067b1f5bbc817 100644 (file)
@@ -470,6 +470,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
 
 #else /* CONFIG_MMU */
 
+#define PAGE_SHARED            __pgprot(0)
 #define PAGE_KERNEL            __pgprot(0)
 #define swapper_pg_dir         NULL
 #define VMALLOC_START          0