mbox series

[v4,00/12] Introduce STM32 DMA3 support

Message ID 20240531150712.2503554-1-amelie.delaunay@foss.st.com (mailing list archive)
Headers show
Series Introduce STM32 DMA3 support | expand

Message

Amelie Delaunay May 31, 2024, 3:07 p.m. UTC
STM32 DMA3 is a direct memory access controller with different features
depending on its hardware configuration. It is either called LPDMA (Low
Power), GPDMA (General Purpose) or HPDMA (High Performance), and it can
be found in new STM32 MCUs and MPUs.

In STM32MP25 SoC [1], 3 HPDMAs and 1 LPDMA are embedded. Only HPDMAs are
used by Linux.

Before adding this new driver, this series gathers existing STM32 DMA
drivers and bindings under stm32/ subdirectory and adds an entry in
MAINTAINERS file.

To ease review, the initial "dmaengine: Add STM32 DMA3 support" has been
split into functionnalities.
Patches 6 to 9 can be squashed into patch 5.

Patch 10 has already been proposed [2], the API is now used in stm32-dma3
driver. Indeed, STM32 DMA3 channels can be individually reserved either
because they are secure, or dedicated to another CPU. These channels are
not registered in dmaengine, so id is not incremented, but, using the new
API to specify the channel name, channel name matches the name in the
Reference Manual and ease requesting a channel thanks to its name.

[1] https://www.st.com/resource/en/reference_manual/rm0457-stm32mp25xx-advanced-armbased-3264bit-mpus-stmicroelectronics.pdf
[2] https://lore.kernel.org/lkml/20231213174021.3074759-1-amelie.delaunay@foss.st.com/

v4:
- address Frank's remarks about patch 5: comments alignment, use __packed
  for stm32_dma3_hwdesc structure, use dma_wmb() instead of __iowmb();
  about patch 6: remove wrong MEM_TO_MEM comment

v3:
- address Rob's remarks about st,stm32-dma3.yaml
  (wrap at 80, remove useless '|')
- address Frank's remarks about patch 5: improve commit message and
  ensure descriptors availability before starting the channel

v2:
- fix reference in spi/st,stm32-spi.yaml with an updated description of the
  dmas property to reflect the new path of STM32 DMA controllers bindings.
- address Rob's remarks about st,stm32-dma3.yaml
- address Vinod's remarks about stm32-dma3.c

Amelie Delaunay (12):
  dt-bindings: dma: New directory for STM32 DMA controllers bindings
  dmaengine: stm32: New directory for STM32 DMA controllers drivers
  MAINTAINERS: Add entry for STM32 DMA controllers drivers and
    documentation
  dt-bindings: dma: Document STM32 DMA3 controller bindings
  dmaengine: Add STM32 DMA3 support
  dmaengine: stm32-dma3: add DMA_CYCLIC capability
  dmaengine: stm32-dma3: add DMA_MEMCPY capability
  dmaengine: stm32-dma3: add device_pause and device_resume ops
  dmaengine: stm32-dma3: improve residue granularity
  dmaengine: add channel device name to channel registration
  dmaengine: stm32-dma3: defer channel registration to specify channel
    name
  arm64: dts: st: add HPDMA nodes on stm32mp251

 .../dma/{ => stm32}/st,stm32-dma.yaml         |    4 +-
 .../bindings/dma/stm32/st,stm32-dma3.yaml     |  135 ++
 .../dma/{ => stm32}/st,stm32-dmamux.yaml      |    4 +-
 .../dma/{ => stm32}/st,stm32-mdma.yaml        |    4 +-
 .../devicetree/bindings/spi/st,stm32-spi.yaml |    2 +-
 MAINTAINERS                                   |    9 +
 arch/arm64/boot/dts/st/stm32mp251.dtsi        |   69 +
 drivers/dma/Kconfig                           |   34 +-
 drivers/dma/Makefile                          |    4 +-
 drivers/dma/dmaengine.c                       |   16 +-
 drivers/dma/idxd/dma.c                        |    2 +-
 drivers/dma/stm32/Kconfig                     |   47 +
 drivers/dma/stm32/Makefile                    |    5 +
 drivers/dma/{ => stm32}/stm32-dma.c           |    2 +-
 drivers/dma/stm32/stm32-dma3.c                | 1847 +++++++++++++++++
 drivers/dma/{ => stm32}/stm32-dmamux.c        |    0
 drivers/dma/{ => stm32}/stm32-mdma.c          |    2 +-
 include/linux/dmaengine.h                     |    3 +-
 18 files changed, 2137 insertions(+), 52 deletions(-)
 rename Documentation/devicetree/bindings/dma/{ => stm32}/st,stm32-dma.yaml (97%)
 create mode 100644 Documentation/devicetree/bindings/dma/stm32/st,stm32-dma3.yaml
 rename Documentation/devicetree/bindings/dma/{ => stm32}/st,stm32-dmamux.yaml (90%)
 rename Documentation/devicetree/bindings/dma/{ => stm32}/st,stm32-mdma.yaml (96%)
 create mode 100644 drivers/dma/stm32/Kconfig
 create mode 100644 drivers/dma/stm32/Makefile
 rename drivers/dma/{ => stm32}/stm32-dma.c (99%)
 create mode 100644 drivers/dma/stm32/stm32-dma3.c
 rename drivers/dma/{ => stm32}/stm32-dmamux.c (100%)
 rename drivers/dma/{ => stm32}/stm32-mdma.c (99%)

Comments

Vinod Koul June 11, 2024, 6:28 p.m. UTC | #1
On Fri, 31 May 2024 17:07:00 +0200, Amelie Delaunay wrote:
> STM32 DMA3 is a direct memory access controller with different features
> depending on its hardware configuration. It is either called LPDMA (Low
> Power), GPDMA (General Purpose) or HPDMA (High Performance), and it can
> be found in new STM32 MCUs and MPUs.
> 
> In STM32MP25 SoC [1], 3 HPDMAs and 1 LPDMA are embedded. Only HPDMAs are
> used by Linux.
> 
> [...]

Applied, thanks!

[01/12] dt-bindings: dma: New directory for STM32 DMA controllers bindings
        commit: 8494ae75dde4495c73b7425543138d088133f75f
[02/12] dmaengine: stm32: New directory for STM32 DMA controllers drivers
        commit: 76178a2c49a7c01ef684b0d689f3da4fd12e0154
[03/12] MAINTAINERS: Add entry for STM32 DMA controllers drivers and documentation
        commit: 81d09bb5249e5f844ee342cc1419e97fc9108cda
[04/12] dt-bindings: dma: Document STM32 DMA3 controller bindings
        commit: a204f64d9f834bdf7085c617aed229eb7500e331
[05/12] dmaengine: Add STM32 DMA3 support
        commit: f561ec8b2b33da6a07cf211e43c8eb35b2dd97a2
[06/12] dmaengine: stm32-dma3: add DMA_CYCLIC capability
        commit: 08ea31024ab9cd512c4a897bd1afd2a5820c53e6
[07/12] dmaengine: stm32-dma3: add DMA_MEMCPY capability
        commit: b3b893a937764731c41423aab4cc0c1a6821e31e
[08/12] dmaengine: stm32-dma3: add device_pause and device_resume ops
        commit: b62a13071cffad03690ee19656248077cb388a14
[09/12] dmaengine: stm32-dma3: improve residue granularity
        commit: 2088473802ab9641114681bee92ba902bccdc19b
[10/12] dmaengine: add channel device name to channel registration
        commit: 10b8e0fd3f7234a38db2c8d2c8dec0bd6eeede44
[11/12] dmaengine: stm32-dma3: defer channel registration to specify channel name
        commit: 49b1c21ff815168eca44e81ab0612b1f00759efb

Best regards,