riscv: Only initialize swiotlb when necessary
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 2 Jun 2021 08:55:16 +0000 (16:55 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 11 Jun 2021 20:42:26 +0000 (13:42 -0700)
commitce3aca0465e31c20ada1270ac6547ba28b610ab2
treea2b2e71d99e1ec5a2f187f88bdc279e0370abf7d
parentae3d69bcc455905bac1d08d3563e4e576028e896
riscv: Only initialize swiotlb when necessary

The SWIOTLB buffer is not needed unless the physical address space
is beyond the limit of dma, only initialize swiotlb when swiotlb_force
is true or not all system memory is DMA-able.

Also move the swiotlb_init() into mem_init().

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/setup.c
arch/riscv/mm/init.c