soc: apple: Add SART driver
authorSven Peter <sven@svenpeter.dev>
Sun, 1 May 2022 14:55:08 +0000 (16:55 +0200)
committerSven Peter <sven@svenpeter.dev>
Mon, 2 May 2022 15:24:45 +0000 (17:24 +0200)
commitb170143ae1113882731666aec9b9105356f1fc17
treebdc78ac1daf9a65ff64e8a4804e59e364e16cae2
parenta12d521f4a3d2088f23b75f063de68ea1dc6b5a3
soc: apple: Add SART driver

The NVMe co-processor on the Apple M1 uses a DMA address filter called
SART for some DMA transactions. This adds a simple driver used to
configure the memory regions from which DMA transactions are allowed.

Unlike a real IOMMU, SART does not support any pagetables and can't be
implemented inside the IOMMU subsystem using iommu_ops.

It also can't be implemented using dma_map_ops since not all DMA
transactions of the NVMe controller are filtered by SART.
Instead, most buffers have to be registered using the integrated NVMe
IOMMU and we can't have two separate dma_map_ops implementations for a
single device.

Co-developed-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Sven Peter <sven@svenpeter.dev>
MAINTAINERS
drivers/soc/apple/Kconfig
drivers/soc/apple/Makefile
drivers/soc/apple/sart.c [new file with mode: 0644]
include/linux/soc/apple/sart.h [new file with mode: 0644]