Skip to contentSkip to conversation

dmaengine: sl-dma: Add Smartlogic HCC DMA IP Core driver

PATCH New Philipp Zabel 1 participant 1 message Sep 4, 2025 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dmaengine: sl-dma: Add Smartlogic HCC DMA IP Core driver

Add a dmaengine driver for the Smartlogic HCC DMA IP Core. This core is intended to be included in custom FPGA designs. As such, the dmaengine device expects to be the child of a FPGA design specific MFD PCIe device. The MFD driver determines the BAR and DMA channel configuration and creates the functional devices that make use of the DMA channels.

Since the IP core requires to be configured with a transfer buffer size that can not be changed while the DMA engine is active, the per-channel configuration in platform data contains the fixed buffer size, as well as interface and IRQ mapping.

Additional interrupts for user logic, such as frame sync interrupts, or error signals can be enabled in the configuration structure.

---
Smartlogic PCI Express High Channel Count (HCC) DMA IP Cores [1] can be implemented within various FPGAs to provide translation between a PCIe endpoint and multiple AXI Stream Slave and Master interfaces, as well as map AXI Master interfaces to BARs.

A downloadable demo design [2], provided by the IP vendor to be flashed onto a Dream Chip Technologies Arria 10 evaluation board, demonstrates a multi-channel video capture use case with 8 test pattern generators. For this configuration, an example MFD driver and a V4L2 capture driver using the DMA channels are located in the sl-dma-demo branch at [3].

The dmaengine driver supports paired channels that transfer together, with only a single, shared EOF interrupt. The demo design uses this to pair video data and metadata channels.

[1] https://www.smartlogic.de/en/produkt/high-channel-count-dma-ip-core
[2] https://www.smartlogic.de/en/knowledge/ -> "Arria 10 Demo Design and Bitstream"
[3] https://git.pengutronix.de/cgit/pza/linux/log/?h=sl-dma-demo
git://git.pengutronix.de/pza/linux refs/heads/sl-dma-demo
---
Changes in v2:
- Fix issues reported by kernel test robot <[email protected]>:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Use scoped_guard() to make limited lock scopes clearer.
- Check that the optional reset flag register resource is configured by the MFD driver before trying to ioremap it.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 MAINTAINERS                |    7 +
 drivers/dma/Kconfig        |   12 +
 drivers/dma/Makefile       |    1 +
 drivers/dma/sl-dma.c       | 1427 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/dma/sl-dma.h       |  109 ++++
 include/linux/dma/sl-dma.h |   88 +++
 6 files changed, 1644 insertions(+)
MAINTAINERS +7 -0
index fe168477caa45799dfe07de2f54de6d6a1ce0615..ac5ec51f1056966adb826f51d841d5afbc5755e1 100644
@@ -922,6 +922,13 @@ M:	Mun Yew Tham <[email protected]>
 S:	Maintained
 F:	drivers/mailbox/mailbox-altera.c
 
+SMARTLOGIC HCC DMA IP CORE DRIVER
+M:	Philipp Zabel <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/dma/sl-dma.*
+F:	include/linux/dma/sl-dma.h
+
 ALTERA MSGDMA IP CORE DRIVER
 M:	Olivier Dautricourt <[email protected]>
 R:	Stefan Roese <[email protected]>
drivers/dma/Kconfig +12 -0
index 05c7c7d9e5a4e52a8ad7ada8c8b9b1a6f9d875f6..aadfa66140b81b78c123aac16ecd79d6727340cf 100644
@@ -571,6 +571,18 @@ config PLX_DMA
 	  These are exposed via extra functions on the switch's
 	  upstream port. Each function exposes one DMA channel.
 
+config SL_DMA
+	tristate "Smartlogic DMA IP Core support"
+	depends on PCI_MSI || COMPILE_TEST
+	select DMA_ENGINE
+	help
+	  Enable support for the Smartlogic HCC DMA IP Core.
+
+	  This configurable core can be included in custom FPGA designs.
+	  A design specific MFD driver is required to set up BAR and DMA
+	  channel configuration and to instantiate the DMA device and the
+	  functional devices that make use of the DMA channels.
+
 config SOPHGO_CV1800B_DMAMUX
 	tristate "Sophgo CV1800/SG2000 series SoC DMA multiplexer support"
 	depends on MFD_SYSCON
drivers/dma/Makefile +1 -0
index a54d7688392b1a0e956fa5d23633507f52f017d9..82b0edd32344e2e2b8d12150c39ba367770b7c08 100644
@@ -71,6 +71,7 @@ obj-$(CONFIG_PPC_BESTCOMM) += bestcomm/
 obj-$(CONFIG_PXA_DMA) += pxa_dma.o
 obj-$(CONFIG_RENESAS_DMA) += sh/
 obj-$(CONFIG_SF_PDMA) += sf-pdma/
+obj-$(CONFIG_SL_DMA) += sl-dma.o
 obj-$(CONFIG_SOPHGO_CV1800B_DMAMUX) += cv1800b-dmamux.o
 obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o
 obj-$(CONFIG_SPRD_DMA) += sprd-dma.o
drivers/dma/sl-dma.c new file +1427 -0

1,427 lines not on this page · raw message

drivers/dma/sl-dma.h new file +109 -0

109 lines not on this page · raw message

include/linux/dma/sl-dma.h new file +88 -0

88 lines not on this page · raw message

---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20240703-sl-dma-54f7a4333abc

Best regards,

Signature · 1 line
Philipp Zabel <[email protected]>