[PATCH v2 0/2] iommu: apple-dart: device specific DMA aperture support

From: Janne Grunau

Date: Mon Aug 31 2026 - 11:21:24 EST


Apple DARTs are often connected directly to devices that expect only a
portion of their address space to be used for DMA (for example, because
other ranges are mapped directly to something else).

The USB4 native host controller on M2 Pro/Max/Ultra devices expected to
be sent by Sven after v7.3-rc1 requires this. In the Asahi downstream
kernel the display controller and ISP require a specified DMA aperture
as well.
The downstream kernel uses a "apple,dma-range" property in the iommu
node to specify the aperture. This is not a good way to describe the
aperture as it is not property of the iommu itself but of its connected
device. iommu.txt describes this use case as DMA window in its
"#iommu-cells = <4>" example.

Implement this for DART allowing additionally 5 iommu-cells specifying a
64-bit aperture start and length. 0x100_0000_0000 is a commonly used
aperture start and the aperture often spans a 36-bit address space.

This range *can* be outside of the DART's IAS. In that case, it is
assumed that the hardware truncates addresses and the page tables will
only map the lower bits of the address. However, the specified range
cannot straddle an IAS boundary (you cannot cover more than IAS worth
of address space nor wrap).

This corresponds to the vm-base and vm-size properties on the Apple
device tree side of things.

Signed-off-by: Janne Grunau <j@xxxxxxxxxx>
---
Changes in v2:
- validation of the DTS supplied aperture: page size alignment and
overflow checks
- actually add `64BIT` to the COMPILE_TEST depends
- Link to v1: https://lore.kernel.org/r/20260819-iommu-apple-dart-aperture-v1-0-252703f381aa@xxxxxxxxxx

---
Janne Grunau (2):
dt-bindings: iommu: dart: Support specifying the DMA aperture
iommu: apple-dart: Support specifying the DMA aperture in the DT

.../devicetree/bindings/iommu/apple,dart.yaml | 12 ++--
drivers/iommu/apple-dart.c | 74 +++++++++++++++++++---
2 files changed, 72 insertions(+), 14 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260819-iommu-apple-dart-aperture-c3b9cc79d7e1

Best regards,
--
Janne Grunau <j@xxxxxxxxxx>