[PATCH v2 2/5] RISC-V: Use swiotlb on RV64 only

From: Zong Li
Date: Wed Sep 26 2018 - 04:33:03 EST


Only RV64 supports swiotlb.

Signed-off-by: Zong Li <zong@xxxxxxxxxxxxx>
---
arch/riscv/kernel/setup.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index aee6031..872a280 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -227,7 +227,10 @@ void __init setup_arch(char **cmdline_p)
setup_bootmem();
paging_init();
unflatten_device_tree();
+
+#ifdef CONFIG_64bit
swiotlb_init(1);
+#endif

#ifdef CONFIG_SMP
setup_smp();
--
2.7.4