mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] dmaengine: fsl-edma: per-channel IOMMU support via DT child nodes
@ 2026-09-30  6:26 Peng Fan (OSS)
  2026-09-30  6:26 ` [PATCH v2 1/3] dt-bindings: dma: fsl,edma: add per-channel child node support Peng Fan (OSS)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2026-09-30  6:26 UTC (permalink / raw)
  To: Frank Li, Vinod Koul, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam
  Cc: Frank Li, Joy Zou, imx, dmaengine, devicetree, linux-kernel,
	linux-arm-kernel, Peng Fan

I used iommu-map for eDMA, but iommu experts rejected it:
"Using iommu-map to describe synthetic dma_chan_dev devices that the
kernel creates is the same kind of DT abuse from over here:"
More info: https://lore.kernel.org/all/20260917144804.GI3196566@ziepe.ca/

So I followed here [2] as Krzysztof wrote for QCOM VPU:
"Thanks Jason for context and detailed arguments. Robin did not chime in
yet, but from what I understood the DT-child-node approach will be the
way we should go here.

I accept above point of view and I am fine with this, thus Vishnu and
Vikash - please go ahead with DT-child-node solution we had some time ago."
[2] https://lore.kernel.org/linux-iommu/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/

The fsl,edma controller on i.MX95 has per-channel SMMU stream IDs,
where paired TX/RX channels share the same stream ID. The previous
approach used iommu-map at the controller node, but this is
architecturally wrong for platform devices - platform_dma_configure()
passes id=NULL to of_dma_configure_id(), so the iommu-map property is
never consulted by the kernel.

This series adds per-channel child nodes to the eDMA binding and
driver. Each child node (dma-channel@<addr>) describes a real
per-channel MMIO region and can carry its own interrupts, iommus, and
power-domains properties. This approach:

 - Uses the standard iommus property for per-channel stream ID
   assignment, which works through the existing of_dma_configure() ->
   of_iommu_configure() -> iommu_probe_device() path.

 - Provides real MMIO addresses in child reg properties, enabling
   Xen dom0less device passthrough where the hypervisor needs physical
   address information for channel-level granularity.

 - Maintains full backward compatibility - existing DTS without child
   nodes works unchanged.

The driver configures per-channel IOMMU following the same pattern as
tegra186-gpc-dma: set bus type on the dma_chan_dev, coerce the DMA
mask, call of_dma_configure() with the child node, and set
chan_dma_dev=true so dmaengine_get_dma_device() returns the per-channel
device for DMA API calls.

Tested on i.MX95 EVK with SMMUv3 enabled for edma2 channels 2-19
(stream IDs 0x30-0x38, paired). Channels without iommus (used by SPI,
I2C, etc.) continue to work in bypass mode.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in V2:
- Switch to add child node for dma channel.
- Link to V1: https://lore.kernel.org/dmaengine/20260916-edma-iommu-v1-0-e1731968081e@nxp.com/

---
Peng Fan (3):
      dt-bindings: dma: fsl,edma: add per-channel child node support
      dmaengine: fsl-edma: support per-channel DT child nodes
      arm64: dts: imx95: convert eDMA to per-channel child nodes

 .../devicetree/bindings/dma/fsl,edma.yaml          |  70 +-
 arch/arm64/boot/dts/freescale/imx95.dtsi           | 774 +++++++++++++++++----
 drivers/dma/fsl-edma-common.c                      |  10 +-
 drivers/dma/fsl-edma-main.c                        | 149 +++-
 4 files changed, 864 insertions(+), 139 deletions(-)
---
base-commit: 38cc189d30504989ed32704c9b87992de304d0fc
change-id: 20260926-edma-iommu-f5d0d97295d2

Best regards,
--  
Peng Fan <peng.fan@nxp.com>


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

end of thread, other threads:[~2026-09-30 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30  6:26 [PATCH v2 0/3] dmaengine: fsl-edma: per-channel IOMMU support via DT child nodes Peng Fan (OSS)
2026-09-30  6:26 ` [PATCH v2 1/3] dt-bindings: dma: fsl,edma: add per-channel child node support Peng Fan (OSS)
2026-09-30 16:00   ` Frank Li
2026-09-30  6:26 ` [PATCH v2 2/3] dmaengine: fsl-edma: support per-channel DT child nodes Peng Fan (OSS)
2026-09-30  6:26 ` [PATCH v2 3/3] arm64: dts: imx95: convert eDMA to per-channel " Peng Fan (OSS)

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

all inboxes | Powered by JetHome®