riscv: dma-mapping: switch over to generic implementation
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 16 Aug 2023 23:23:36 +0000 (00:23 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 1 Sep 2023 16:07:46 +0000 (09:07 -0700)
commit935730160738a478dbf4b61cf0cfc29c1442fb4e
tree9aee1699d9a4479b4ac70ec4b2629636a1ce5df6
parent482069ebdc1d61fba14527055894b9f4f0ced08c
riscv: dma-mapping: switch over to generic implementation

Add helper functions for cache wback/inval/clean and use them
arch_sync_dma_for_device()/arch_sync_dma_for_cpu() functions. The proposed
changes are in preparation for switching over to generic implementation.

Reorganization of the code is based on the patch (Link[0]) from Arnd.
For now I have dropped CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU check as this
will be enabled by default upon selection of RISCV_DMA_NONCOHERENT
and also dropped arch_dma_mark_dcache_clean().

Link[0]: https://lore.kernel.org/all/20230327121317.4081816-22-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20230816232336.164413-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/dma-noncoherent.c