Skip to contentSkip to conversation

iommu: dart: Add DART iommu driver

PATCH Superseded Sven Peter 1 participant 1 message Mar 20, 2021 IOMMU

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Sven Peter

author
#0 lore raw

PATCH 3/3 iommu: dart: Add DART iommu driver

Apple's new SoCs use iommus for almost all peripherals. These Device Address Resolution Tables must be setup before these peripherals can act as DMA masters.

---
 MAINTAINERS                      |   1 +
 drivers/iommu/Kconfig            |  13 +
 drivers/iommu/Makefile           |   1 +
 drivers/iommu/apple-dart-iommu.c | 653 +++++++++++++++++++++++++++++++
 4 files changed, 668 insertions(+)
 create mode 100644 drivers/iommu/apple-dart-iommu.c
MAINTAINERS +1 -0
index 1f9a4f2de88b..7dcfce53dd04 100644
@@ -1241,6 +1241,7 @@ M:	Sven Peter <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/iommu/apple,t8103-dart.yaml
+F:	drivers/iommu/apple-dart-iommu.c
 
 APPLE SMC DRIVER
 M:	Henrik Rydberg <[email protected]>
drivers/iommu/Kconfig +13 -0
index 3c95c8524abe..810bcb3ed414 100644
@@ -262,6 +262,19 @@ config SPAPR_TCE_IOMMU
 	  Enables bits of IOMMU API required by VFIO. The iommu_ops
 	  is not implemented as it is not necessary for VFIO.
 
+config IOMMU_APPLE_DART
+	tristate "Apple DART IOMMU Support"
+	depends on ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
+	select IOMMU_API
+	select IOMMU_IO_PGTABLE_APPLE_DART
+	help
+	  Support for Apple DART (Device Address Resolution Table) IOMMUs
+	  found in Apple ARM SoCs like the M1.
+	  This IOMMU is required for most peripherals using DMA to access
+	  the main memory.
+
+	  Say Y here if you are using an Apple SoC with a DART IOMMU.
+
 # ARM IOMMU support
 config ARM_SMMU
 	tristate "ARM Ltd. System MMU (SMMU) Support"
drivers/iommu/Makefile +1 -0
index 61bd30cd8369..5f21f0dfec6a 100644
@@ -28,3 +28,4 @@ obj-$(CONFIG_S390_IOMMU) += s390-iommu.o
 obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
 obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o
 obj-$(CONFIG_IOMMU_SVA_LIB) += iommu-sva-lib.o
+obj-$(CONFIG_IOMMU_APPLE_DART) += apple-dart-iommu.o
drivers/iommu/apple-dart-iommu.c new file +653 -0

653 lines not on this page · raw message

--
2.25.1