dmaengine: add k3dma
Subsystems (2)
PATCH v4 1/1 dmaengine: add k3dma
change since v3:
Rebase to slave-dma.git, next branch
Fix two warnning reported via smatch
change since v2:
0002:
Vinod suggest use __ffl, remove "#ifdef CONFIG_PM_SLEEP" and micro namespace
change since v1:
Follow Arnd suggestion:
using dma_get_slave_channel interface
Correct dma-channels and dma-requests for phy and virt channel
Follow Vinod suggestion:
add name space
use SIMPLE_DEV_PM_OPS
Besides:
add pause/resume
Using kzalloc instead of dma pool
Zhangfei Gao (1):
dmaengine: Add hisilicon k3 DMA engine driver
Documentation/devicetree/bindings/dma/k3dma.txt | 46 ++ drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/k3dma.c | 837 +++++++++++++++++++++++ 4 files changed, 893 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/k3dma.txt create mode 100644 drivers/dma/k3dma.c
Signature · 1 line
1.7.9.5
PATCH v4 1/1 dmaengine: Add hisilicon k3 DMA engine driver
Add dmaengine driver for hisilicon k3 platform based on virt_dma
--- Documentation/devicetree/bindings/dma/k3dma.txt | 46 ++ drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/k3dma.c | 837 +++++++++++++++++++++++ 4 files changed, 893 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/k3dma.txt create mode 100644 drivers/dma/k3dma.c
Documentation/devicetree/bindings/dma/k3dma.txt new file +46 -0
@@ -0,0 +1,46 @@ +* Hisilicon K3 DMA controller + +See dma.txt first + +Required properties: +- compatible: Should be "hisilicon,k3-dma-1.0" +- reg: Should contain DMA registers location and length. +- interrupts: Should contain one interrupt shared by all channel +- #dma-cells: see dma.txt, should be 1, para number +- dma-channels: physical channels supported +- dma-requests: virtual channels supported, each virtual channel + have specific request line +- clocks: clock required + +Example: + +Controller: + dma0: dma at fcd02000 { + compatible = "hisilicon,k3-dma-1.0"; + reg = <0xfcd02000 0x1000>; + #dma-cells = <1>; + dma-channels = <16>; + dma-requests = <27>; + interrupts = <0 12 4>; + clocks = <&pclk>; + status = "disable"; + }; + +Client: +Use specific request line passing from dmax +For example, i2c0 read channel request line is 18, while write channel use 19 + + i2c0: i2c at fcb08000 { + compatible = "snps,designware-i2c"; + dmas = <&dma0 18 /* read channel */ + &dma0 19>; /* write channel */ + dma-names = "rx", "tx"; + }; + + i2c1: i2c at fcb09000 { + compatible = "snps,designware-i2c"; + dmas = <&dma0 20 /* read channel */ + &dma0 21>; /* write channel */ + dma-names = "rx", "tx"; + }; +
drivers/dma/Kconfig +9 -0
@@ -300,6 +300,15 @@ config DMA_JZ4740 select DMA_ENGINE select DMA_VIRTUAL_CHANNELS +config K3_DMA + tristate "Hisilicon K3 DMA support" + depends on ARCH_HI3xxx + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help + Support the DMA engine for Hisilicon K3 platform + devices. + config DMA_ENGINE bool
drivers/dma/Makefile +1 -0
@@ -39,3 +39,4 @@ obj-$(CONFIG_MMP_TDMA) += mmp_tdma.o obj-$(CONFIG_DMA_OMAP) += omap-dma.o obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o +obj-$(CONFIG_K3_DMA) += k3dma.o
drivers/dma/k3dma.c new file +837 -0
837 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Vinod Koul
AppliedPATCH v4 1/1 dmaengine: Add hisilicon k3 DMA engine driver
Quoted 1 line · Zhangfei Gao
Add dmaengine driver for hisilicon k3 platform based on
virt_dma
Applied, thanks
~Vinod
PATCH v4 1/1 dmaengine: Add hisilicon k3 DMA engine driver
Quoted 7 lines · Vinod Koul
Quoted 1 line · Zhangfei Gao
Add dmaengine driver for hisilicon k3 platform based on
virt_dmaApplied, thanks
~Vinod
Thanks Vinod
PATCH v4 1/1 dmaengine: Add hisilicon k3 DMA engine driver
In reply to Zhangfei GaoQuoted 71 lines · Zhangfei Gao
Add dmaengine driver for hisilicon k3 platform based on
virt_dmaSigned-off-by Zhangfei Gao <[email protected]>Tested-by Kai Yang <[email protected]>Acked-by Arnd Bergmann <[email protected]>--- Documentation/devicetree/bindings/dma/k3dma.txt | 46 ++ drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/k3dma.c | 837 +++++++++++++++++++++++ 4 files changed, 893 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/k3dma.txt create mode 100644 drivers/dma/k3dma.cDocumentation/devicetree/bindings/dma/k3dma.txt new file +46
-0@@ -0,0 +1,46 @@ +* Hisilicon K3 DMA controller + +See dma.txt first + +Required properties: +- compatible: Should be "hisilicon,k3-dma-1.0" +- reg: Should contain DMA registers location and length. +- interrupts: Should contain one interrupt shared by all channel +- #dma-cells: see dma.txt, should be 1, para number +- dma-channels: physical channels supported +- dma-requests: virtual channels supported, each virtual channel + have specific request line +- clocks: clock required + +Example: + +Controller: + dma0: dma at fcd02000 { + compatible = "hisilicon,k3-dma-1.0"; + reg = <0xfcd02000 0x1000>; + #dma-cells = <1>; + dma-channels = <16>; + dma-requests = <27>; + interrupts = <0 12 4>; + clocks = <&pclk>; + status = "disable"; + }; + +Client: +Use specific request line passing from dmax +For example, i2c0 read channel request line is 18, while write channel use 19 + + i2c0: i2c at fcb08000 { + compatible = "snps,designware-i2c"; + dmas = <&dma0 18 /* read channel */ + &dma0 19>; /* write channel */ + dma-names = "rx", "tx"; + }; + + i2c1: i2c at fcb09000 { + compatible = "snps,designware-i2c"; + dmas = <&dma0 20 /* read channel */ + &dma0 21>; /* write channel */ + dma-names = "rx", "tx"; + }; +drivers/dma/Kconfig +0
-0
drivers/dma/Kconfig config DMA_JZ4740 · line 305
Quoted 6 lines
drivers/dma/Kconfig +3
-0@@ -300,6 +300,15 @@ config DMA_JZ4740 select DMA_ENGINE select DMA_VIRTUAL_CHANNELS +config K3_DMA + tristate "Hisilicon K3 DMA support" + depends on ARCH_HI3xxx
Unless I am missing something this driver cannot be built since ARCH_HI3xxx does not exist. Is this arch still winding its way upstream?
PATCH v4 1/1 dmaengine: Add hisilicon k3 DMA engine driver
Dear Dan
Quoted 16 lines · Dan Williams
Quoted 15 lines · Zhangfei Gao
Add dmaengine driver for hisilicon k3 platform based on
virt_dmaSigned-off-by Zhangfei Gao <[email protected]>Tested-by Kai Yang <[email protected]>Acked-by Arnd Bergmann <[email protected]>---
drivers/dma/Kconfig +0
-0@@ -300,6 +300,15 @@ config DMA_JZ4740 select DMA_ENGINE select DMA_VIRTUAL_CHANNELS
Quoted 8 lines
drivers/dma/Kconfig config DMA_JZ4740 · line 305
Quoted 3 lines
drivers/dma/Kconfig +3
-0+config K3_DMA + tristate "Hisilicon K3 DMA support" + depends on ARCH_HI3xxxUnless I am missing something this driver cannot be built since
ARCH_HI3xxxdoes not exist. Is this arch still winding its way upstream?
The patch set "enable hi3xxx SoC" still on the way, suppose to be in 3.13, including adding ARCH_HI3xxx.
Sorry for the confusion.
Thanks