Skip to contentSkip to conversation

dmaengine: hisilicon: Add Kunpeng DMA engine support

PATCH Applied Zhou Wang 2 participants 2 messages Jan 16, 2020 – Jan 24, 2020

Subsystems (2)
lore
Share & tools
lore

Zhou Wang

author maintainer
#0 lore raw

PATCH v5 1/1 dmaengine: hisilicon: Add Kunpeng DMA engine support

This patch adds a driver for HiSilicon Kunpeng DMA engine. This DMA engine which is an PCIe iEP offers 30 channels, each channel has a send queue, a complete queue and an interrupt to help to do tasks. This DMA engine can do memory copy between memory blocks or between memory and device buffer.

---

Changes v4 -> v5:
- Add hisi_dma_chan_write to do specific channel MMIO write.
- Change BUG_ON to WARN_ON in hisi_dma_reset_hw_chan.
- Remove PCI_DEVICE_ID_HISI_DMA as only used once.

Changes v3 -> v4:
- Add PCI_MSI compile dependency to avoid compile error.

Changes v2 -> v3:
- Add basic description in commit message.
- Add missing tasklet_kill and pci_free_irq_vectors.
- Add BUG_ON when reset fails.
- Add update_bit function to remove some common codes.
- Misc fixes about coding style.

 drivers/dma/Kconfig    |   8 +
 drivers/dma/Makefile   |   1 +
 drivers/dma/hisi_dma.c | 611 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 620 insertions(+)
 create mode 100644 drivers/dma/hisi_dma.c
drivers/dma/Kconfig +8 -0
index 6fa1eba..a8d9704 100644
@@ -239,6 +239,14 @@ config FSL_RAID
 	  the capability to offload memcpy, xor and pq computation
 	  for raid5/6.
 
+config HISI_DMA
+	tristate "HiSilicon DMA Engine support"
+	depends on ARM64 || (COMPILE_TEST && PCI_MSI)
+	select DMA_ENGINE
+	select DMA_VIRTUAL_CHANNELS
+	help
+	  Support HiSilicon Kunpeng DMA engine.
+
 config IMG_MDC_DMA
 	tristate "IMG MDC support"
 	depends on MIPS || COMPILE_TEST
drivers/dma/Makefile +1 -0
index 42d7e2f..dc2f2a4 100644
@@ -35,6 +35,7 @@ obj-$(CONFIG_FSL_EDMA) += fsl-edma.o fsl-edma-common.o
 obj-$(CONFIG_MCF_EDMA) += mcf-edma.o fsl-edma-common.o
 obj-$(CONFIG_FSL_QDMA) += fsl-qdma.o
 obj-$(CONFIG_FSL_RAID) += fsl_raid.o
+obj-$(CONFIG_HISI_DMA) += hisi_dma.o
 obj-$(CONFIG_HSU_DMA) += hsu/
 obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
 obj-$(CONFIG_IMX_DMA) += imx-dma.o
drivers/dma/hisi_dma.c new file +611 -0

611 lines not on this page · raw message

Signature · 1 line
2.8.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Zhou Wang

This patch adds a driver for HiSilicon Kunpeng DMA engine. This DMA engine which is an PCIe iEP offers 30 channels, each channel has a send queue, a complete queue and an interrupt to help to do tasks. This DMA engine can do memory copy between memory blocks or between memory and device buffer.

Applied, thanks

Signature · 1 line
~Vinod