Commit 5c0ebbd3 authored by Tomasz Jeznach's avatar Tomasz Jeznach Committed by Joerg Roedel
Browse files

iommu/riscv: Add RISC-V IOMMU platform device driver

Introduce platform device driver for implementation of RISC-V IOMMU
architected hardware.

Hardware interface definition located in file iommu-bits.h is based on
ratified RISC-V IOMMU Architecture Specification version 1.0.0.

This patch implements platform device initialization, early check and
configuration of the IOMMU interfaces and enables global pass-through
address translation mode (iommu_mode == BARE), without registering
hardware instance in the IOMMU subsystem.

Link: https://github.com/riscv-non-isa/riscv-iommu


Co-developed-by: default avatarNick Kossifidis <mick@ics.forth.gr>
Signed-off-by: default avatarNick Kossifidis <mick@ics.forth.gr>
Co-developed-by: default avatarSebastien Boeuf <seb@rivosinc.com>
Signed-off-by: default avatarSebastien Boeuf <seb@rivosinc.com>
Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarTomasz Jeznach <tjeznach@rivosinc.com>
Acked-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/2f2e4530c0ee4a81385efa90f1da932f5179f3fb.1729059707.git.tjeznach@rivosinc.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 14d050cd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -19895,7 +19895,9 @@ M: Tomasz Jeznach <tjeznach@rivosinc.com>
L:	iommu@lists.linux.dev
L:	linux-riscv@lists.infradead.org
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
F:	Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
F:	drivers/iommu/riscv/
RISC-V MICROCHIP FPGA SUPPORT
M:	Conor Dooley <conor.dooley@microchip.com>
+1 −0
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@ config MSM_IOMMU
source "drivers/iommu/amd/Kconfig"
source "drivers/iommu/intel/Kconfig"
source "drivers/iommu/iommufd/Kconfig"
source "drivers/iommu/riscv/Kconfig"

config IRQ_REMAP
	bool "Support for Interrupt Remapping"
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
obj-y += amd/ intel/ arm/ iommufd/
obj-y += amd/ intel/ arm/ iommufd/ riscv/
obj-$(CONFIG_IOMMU_API) += iommu.o
obj-$(CONFIG_IOMMU_API) += iommu-traces.o
obj-$(CONFIG_IOMMU_API) += iommu-sysfs.o
+15 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
# RISC-V IOMMU support

config RISCV_IOMMU
	bool "RISC-V IOMMU Support"
	depends on RISCV && 64BIT
	default y
	select IOMMU_API
	help
	  Support for implementations of the RISC-V IOMMU architecture that
	  complements the RISC-V MMU capabilities, providing similar address
	  translation and protection functions for accesses from I/O devices.

	  Say Y here if your SoC includes an IOMMU device implementing
	  the RISC-V IOMMU architecture.
+2 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_RISCV_IOMMU) += iommu.o iommu-platform.o
Loading