1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2c66ec88fSEmmanuel Vadot%YAML 1.2 3c66ec88fSEmmanuel Vadot--- 4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/dma/st,stm32-dma.yaml# 5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c66ec88fSEmmanuel Vadot 78bab661aSEmmanuel Vadottitle: STMicroelectronics STM32 DMA Controller 8c66ec88fSEmmanuel Vadot 9c66ec88fSEmmanuel Vadotdescription: | 10c66ec88fSEmmanuel Vadot The STM32 DMA is a general-purpose direct memory access controller capable of 11c66ec88fSEmmanuel Vadot supporting 8 independent DMA channels. Each channel can have up to 8 requests. 12c66ec88fSEmmanuel Vadot DMA clients connected to the STM32 DMA controller must use the format 13c66ec88fSEmmanuel Vadot described in the dma.txt file, using a four-cell specifier for each 14c66ec88fSEmmanuel Vadot channel: a phandle to the DMA controller plus the following four integer cells: 15c66ec88fSEmmanuel Vadot 1. The channel id 16c66ec88fSEmmanuel Vadot 2. The request line number 17c66ec88fSEmmanuel Vadot 3. A 32bit mask specifying the DMA channel configuration which are device 18c66ec88fSEmmanuel Vadot dependent: 19c66ec88fSEmmanuel Vadot -bit 9: Peripheral Increment Address 20c66ec88fSEmmanuel Vadot 0x0: no address increment between transfers 21c66ec88fSEmmanuel Vadot 0x1: increment address between transfers 22c66ec88fSEmmanuel Vadot -bit 10: Memory Increment Address 23c66ec88fSEmmanuel Vadot 0x0: no address increment between transfers 24c66ec88fSEmmanuel Vadot 0x1: increment address between transfers 25c66ec88fSEmmanuel Vadot -bit 15: Peripheral Increment Offset Size 26c66ec88fSEmmanuel Vadot 0x0: offset size is linked to the peripheral bus width 27c66ec88fSEmmanuel Vadot 0x1: offset size is fixed to 4 (32-bit alignment) 28c66ec88fSEmmanuel Vadot -bit 16-17: Priority level 29c66ec88fSEmmanuel Vadot 0x0: low 30c66ec88fSEmmanuel Vadot 0x1: medium 31c66ec88fSEmmanuel Vadot 0x2: high 32c66ec88fSEmmanuel Vadot 0x3: very high 33c66ec88fSEmmanuel Vadot 4. A 32bit bitfield value specifying DMA features which are device dependent: 34c66ec88fSEmmanuel Vadot -bit 0-1: DMA FIFO threshold selection 35c66ec88fSEmmanuel Vadot 0x0: 1/4 full FIFO 36c66ec88fSEmmanuel Vadot 0x1: 1/2 full FIFO 37c66ec88fSEmmanuel Vadot 0x2: 3/4 full FIFO 38c66ec88fSEmmanuel Vadot 0x3: full FIFO 39c66ec88fSEmmanuel Vadot -bit 2: DMA direct mode 40c66ec88fSEmmanuel Vadot 0x0: FIFO mode with threshold selectable with bit 0-1 41c66ec88fSEmmanuel Vadot 0x1: Direct mode: each DMA request immediately initiates a transfer 42c66ec88fSEmmanuel Vadot from/to the memory, FIFO is bypassed. 43354d7675SEmmanuel Vadot -bit 4: alternative DMA request/acknowledge protocol 44354d7675SEmmanuel Vadot 0x0: Use standard DMA ACK management, where ACK signal is maintained 45354d7675SEmmanuel Vadot up to the removal of request and transfer completion 46354d7675SEmmanuel Vadot 0x1: Use alternative DMA ACK management, where ACK de-assertion does 47354d7675SEmmanuel Vadot not wait for the de-assertion of the REQuest, ACK is only managed 48354d7675SEmmanuel Vadot by transfer completion. This must only be used on channels 49354d7675SEmmanuel Vadot managing transfers for STM32 USART/UART. 50c66ec88fSEmmanuel Vadot 51c66ec88fSEmmanuel Vadot 52c66ec88fSEmmanuel Vadotmaintainers: 538cc087a1SEmmanuel Vadot - Amelie Delaunay <amelie.delaunay@foss.st.com> 54c66ec88fSEmmanuel Vadot 55c66ec88fSEmmanuel VadotallOf: 56cb7aa33aSEmmanuel Vadot - $ref: dma-controller.yaml# 57c66ec88fSEmmanuel Vadot 58c66ec88fSEmmanuel Vadotproperties: 59c66ec88fSEmmanuel Vadot "#dma-cells": 60c66ec88fSEmmanuel Vadot const: 4 61c66ec88fSEmmanuel Vadot 62c66ec88fSEmmanuel Vadot compatible: 63c66ec88fSEmmanuel Vadot const: st,stm32-dma 64c66ec88fSEmmanuel Vadot 65c66ec88fSEmmanuel Vadot reg: 66c66ec88fSEmmanuel Vadot maxItems: 1 67c66ec88fSEmmanuel Vadot 68c66ec88fSEmmanuel Vadot clocks: 69c66ec88fSEmmanuel Vadot maxItems: 1 70c66ec88fSEmmanuel Vadot 71c66ec88fSEmmanuel Vadot interrupts: 72c66ec88fSEmmanuel Vadot maxItems: 8 73c66ec88fSEmmanuel Vadot description: Should contain all of the per-channel DMA 74c66ec88fSEmmanuel Vadot interrupts in ascending order with respect to the 75c66ec88fSEmmanuel Vadot DMA channel index. 76c66ec88fSEmmanuel Vadot 77c66ec88fSEmmanuel Vadot resets: 78c66ec88fSEmmanuel Vadot maxItems: 1 79c66ec88fSEmmanuel Vadot 80c66ec88fSEmmanuel Vadot st,mem2mem: 81c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 82c66ec88fSEmmanuel Vadot description: if defined, it indicates that the controller 83c66ec88fSEmmanuel Vadot supports memory-to-memory transfer 84c66ec88fSEmmanuel Vadot 85*7d0873ebSEmmanuel Vadot access-controllers: 86*7d0873ebSEmmanuel Vadot minItems: 1 87*7d0873ebSEmmanuel Vadot maxItems: 2 88*7d0873ebSEmmanuel Vadot 89c66ec88fSEmmanuel Vadotrequired: 90c66ec88fSEmmanuel Vadot - compatible 91c66ec88fSEmmanuel Vadot - reg 92c66ec88fSEmmanuel Vadot - clocks 93c66ec88fSEmmanuel Vadot - interrupts 94c66ec88fSEmmanuel Vadot 956be33864SEmmanuel VadotunevaluatedProperties: false 966be33864SEmmanuel Vadot 97c66ec88fSEmmanuel Vadotexamples: 98c66ec88fSEmmanuel Vadot - | 99c66ec88fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 100c66ec88fSEmmanuel Vadot #include <dt-bindings/clock/stm32mp1-clks.h> 101c66ec88fSEmmanuel Vadot #include <dt-bindings/reset/stm32mp1-resets.h> 102c66ec88fSEmmanuel Vadot dma-controller@40026400 { 103c66ec88fSEmmanuel Vadot compatible = "st,stm32-dma"; 104c66ec88fSEmmanuel Vadot reg = <0x40026400 0x400>; 105c66ec88fSEmmanuel Vadot interrupts = <56>, 106c66ec88fSEmmanuel Vadot <57>, 107c66ec88fSEmmanuel Vadot <58>, 108c66ec88fSEmmanuel Vadot <59>, 109c66ec88fSEmmanuel Vadot <60>, 110c66ec88fSEmmanuel Vadot <68>, 111c66ec88fSEmmanuel Vadot <69>, 112c66ec88fSEmmanuel Vadot <70>; 113c66ec88fSEmmanuel Vadot clocks = <&clk_hclk>; 114c66ec88fSEmmanuel Vadot #dma-cells = <4>; 115c66ec88fSEmmanuel Vadot st,mem2mem; 116c66ec88fSEmmanuel Vadot resets = <&rcc 150>; 117c66ec88fSEmmanuel Vadot dma-requests = <8>; 118c66ec88fSEmmanuel Vadot }; 119c66ec88fSEmmanuel Vadot 120c66ec88fSEmmanuel Vadot... 121