Skip to content

dmaengine: sf-pdma: Add platform dma driver

Green Wan dmaengine linux-devicetree linux-riscv lkml 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest4 patches 3 repliesIn review
  2. v54 patches 2 repliesSuperseded
  3. v2 RFC posting 2/24 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v44 patches2 repliesSuperseded
v33 patches3 repliesSuperseded
v2 posting 1/23 patches1 replySuperseded
v13 patches0 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dt-bindings: dmaengine: sf-pdma: add bindins for SiFive PDMADocumentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml+55 -00 replies
2/4riscv: dts: add support for PDMA device of HiFive Unleashed Rev A00arch/riscv/boot/dts/sifive/fu540-c000.dtsi+7 -01 reply
3/4dmaengine: sf-pdma: add platform DMA support for HiFive Unleashed A00drivers/dma/Kconfig drivers/dma/Makefile drivers/dma/sf-pdma/Kconfig +3 more+753 -00 replies
4/4MAINTAINERS: Add Green as SiFive PDMA driver maintainerMAINTAINERS+6 -00 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchRob HerringPragnesh Patel
1/4R-b R-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/4] dmaengine: sf-pdma: Add platform dma driver

Add PDMA driver support for SiFive HiFive Unleashed RevA00 board. Mainly follows DMAengine controller doc[1] to implement and take other DMA drivers as reference. Such as

- drivers/dma/fsl-edma.c
- drivers/dma/dw-edma/
- drivers/dma/pxa-dma.c

Using DMA test client[2] to test. Detailed datasheet is doc[3]. Driver supports:

- 4 physical DMA channels, share same DONE and error interrupt handler.
- Support MEM_TO_MEM
- Tested by DMA test client
- patches include DT Bindgins document and dts for fu450-c000 SoC. Separate dts patch for easier review and apply to different branch or SoC platform.
- retry 1 time if DMA error occurs.

[Changelog]
- v6 patch
. Remove incorrect reviewer and fix commit number
. Revise sf_pdma_desc_residue() to report residue according to cookie. The tx
could be in completed, in-progress state or still in pending list.
. Refer to fsl-edma.c to free irq and kill tasklet before exit. . Minor fixes include left-justisfied, empty line and unnecessary line.

[Reference Doc]
[1] ./Documentation/driver-api/dmaengine/provider.rst
[2] ./Documentation/driver-api/dmaengine/dmatest.rst
[3] https://static.dev.sifive.com/FU540-C000-v1.0.pdf

[Simple steps to test of DMA Test client]

 $ echo 1 > /sys/module/dmatest/parameters/iterations
 $ echo dma0chan0 > /sys/module/dmatest/parameters/channel
 $ echo dma0chan1 > /sys/module/dmatest/parameters/channel
 $ echo dma0chan2 > /sys/module/dmatest/parameters/channel
 $ echo dma0chan3 > /sys/module/dmatest/parameters/channel
 $ echo 1 > /sys/module/dmatest/parameters/run

[Expected test result]

[  267.563323] dmatest: dma0chan0-copy0: summary 45629 tests, 0 failures 38769.01 iops 309661 KB/s (0)
[  267.572427] dmatest: dma0chan1-copy0: summary 45863 tests, 0 failures 40286.85 iops 321643 KB/s (0)
[  267.581392] dmatest: dma0chan2-copy0: summary 45975 tests, 0 failures 41178.48 iops 328740 KB/s (0)
[  267.590542] dmatest: dma0chan3-copy0: summary 44768 tests, 0 failures 38560.29 iops 307726 KB/s (0)

Green Wan (4):
dt-bindings: dmaengine: sf-pdma: add bindins for SiFive PDMA
riscv: dts: add support for PDMA device of HiFive Unleashed Rev A00
dmaengine: sf-pdma: add platform DMA support for HiFive Unleashed A00
MAINTAINERS: Add Green as SiFive PDMA driver maintainer

 .../bindings/dma/sifive,fu540-c000-pdma.yaml  |  55 ++
 MAINTAINERS                                   |   6 +
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi    |   7 +
 drivers/dma/Kconfig                           |   2 +
 drivers/dma/Makefile                          |   1 +
 drivers/dma/sf-pdma/Kconfig                   |   6 +
 drivers/dma/sf-pdma/Makefile                  |   1 +
 drivers/dma/sf-pdma/sf-pdma.c                 | 621 ++++++++++++++++++
 drivers/dma/sf-pdma/sf-pdma.h                 | 122 ++++
 9 files changed, 821 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
 create mode 100644 drivers/dma/sf-pdma/Kconfig
 create mode 100644 drivers/dma/sf-pdma/Makefile
 create mode 100644 drivers/dma/sf-pdma/sf-pdma.c
 create mode 100644 drivers/dma/sf-pdma/sf-pdma.h

base-commit: 4dd58158254c8a027f2bf5060b72ef64cafa3b9d

Signature · 1 line
2.17.1