Skip to content

Commit 5c0ebbd

Browse files
tjeznachjoergroedel
authored andcommitted
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: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Co-developed-by: Sebastien Boeuf <seb@rivosinc.com> Signed-off-by: Sebastien Boeuf <seb@rivosinc.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Tomasz Jeznach <tjeznach@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Link: https://lore.kernel.org/r/2f2e4530c0ee4a81385efa90f1da932f5179f3fb.1729059707.git.tjeznach@rivosinc.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 14d050c commit 5c0ebbd

File tree

9 files changed

+987
-1
lines changed

9 files changed

+987
-1
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19895,7 +19895,9 @@ M: Tomasz Jeznach <tjeznach@rivosinc.com>
1989519895
L: iommu@lists.linux.dev
1989619896
L: linux-riscv@lists.infradead.org
1989719897
S: Maintained
19898+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1989819899
F: Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
19900+
F: drivers/iommu/riscv/
1989919901

1990019902
RISC-V MICROCHIP FPGA SUPPORT
1990119903
M: Conor Dooley <conor.dooley@microchip.com>

drivers/iommu/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ config MSM_IOMMU
195195
source "drivers/iommu/amd/Kconfig"
196196
source "drivers/iommu/intel/Kconfig"
197197
source "drivers/iommu/iommufd/Kconfig"
198+
source "drivers/iommu/riscv/Kconfig"
198199

199200
config IRQ_REMAP
200201
bool "Support for Interrupt Remapping"

drivers/iommu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
obj-y += amd/ intel/ arm/ iommufd/
2+
obj-y += amd/ intel/ arm/ iommufd/ riscv/
33
obj-$(CONFIG_IOMMU_API) += iommu.o
44
obj-$(CONFIG_IOMMU_API) += iommu-traces.o
55
obj-$(CONFIG_IOMMU_API) += iommu-sysfs.o

drivers/iommu/riscv/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# RISC-V IOMMU support
3+
4+
config RISCV_IOMMU
5+
bool "RISC-V IOMMU Support"
6+
depends on RISCV && 64BIT
7+
default y
8+
select IOMMU_API
9+
help
10+
Support for implementations of the RISC-V IOMMU architecture that
11+
complements the RISC-V MMU capabilities, providing similar address
12+
translation and protection functions for accesses from I/O devices.
13+
14+
Say Y here if your SoC includes an IOMMU device implementing
15+
the RISC-V IOMMU architecture.

drivers/iommu/riscv/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
obj-$(CONFIG_RISCV_IOMMU) += iommu.o iommu-platform.o

0 commit comments

Comments
 (0)