Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] iommu: apple-dart: device specific DMA aperture support
@ 2026-08-19 14:52 Janne Grunau
  2026-08-19 14:52 ` [PATCH 1/2] dt-bindings: iommu: dart: Support specifying the DMA aperture Janne Grunau
  2026-08-19 14:52 ` [PATCH 2/2] iommu: apple-dart: Support specifying the DMA aperture in the DT Janne Grunau
  0 siblings, 2 replies; 4+ messages in thread
From: Janne Grunau @ 2026-08-19 14:52 UTC (permalink / raw)
  To: Sven Peter, Neal Gompa, Joerg Roedel (AMD), Will Deacon,
	Robin Murphy, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: asahi, linux-arm-kernel, iommu, devicetree, linux-kernel,
	Janne Grunau, Hector Martin

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 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@jannau.net>
---
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/Kconfig                              |  2 +-
 drivers/iommu/apple-dart.c                         | 62 ++++++++++++++++++----
 3 files changed, 61 insertions(+), 15 deletions(-)
---
base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
change-id: 20260819-iommu-apple-dart-aperture-c3b9cc79d7e1

Best regards,
-- 
Janne Grunau <j@jannau.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-19 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 14:52 [PATCH 0/2] iommu: apple-dart: device specific DMA aperture support Janne Grunau
2026-08-19 14:52 ` [PATCH 1/2] dt-bindings: iommu: dart: Support specifying the DMA aperture Janne Grunau
2026-08-19 14:52 ` [PATCH 2/2] iommu: apple-dart: Support specifying the DMA aperture in the DT Janne Grunau
2026-08-19 15:06   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox