18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/dma/st,stm32-dma.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: STMicroelectronics STM32 DMA Controller bindings
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cidescription: |
108c2ecf20Sopenharmony_ci  The STM32 DMA is a general-purpose direct memory access controller capable of
118c2ecf20Sopenharmony_ci  supporting 8 independent DMA channels. Each channel can have up to 8 requests.
128c2ecf20Sopenharmony_ci  DMA clients connected to the STM32 DMA controller must use the format
138c2ecf20Sopenharmony_ci  described in the dma.txt file, using a four-cell specifier for each
148c2ecf20Sopenharmony_ci  channel: a phandle to the DMA controller plus the following four integer cells:
158c2ecf20Sopenharmony_ci    1. The channel id
168c2ecf20Sopenharmony_ci    2. The request line number
178c2ecf20Sopenharmony_ci    3. A 32bit mask specifying the DMA channel configuration which are device
188c2ecf20Sopenharmony_ci      dependent:
198c2ecf20Sopenharmony_ci        -bit 9: Peripheral Increment Address
208c2ecf20Sopenharmony_ci          0x0: no address increment between transfers
218c2ecf20Sopenharmony_ci          0x1: increment address between transfers
228c2ecf20Sopenharmony_ci        -bit 10: Memory Increment Address
238c2ecf20Sopenharmony_ci          0x0: no address increment between transfers
248c2ecf20Sopenharmony_ci          0x1: increment address between transfers
258c2ecf20Sopenharmony_ci        -bit 15: Peripheral Increment Offset Size
268c2ecf20Sopenharmony_ci          0x0: offset size is linked to the peripheral bus width
278c2ecf20Sopenharmony_ci          0x1: offset size is fixed to 4 (32-bit alignment)
288c2ecf20Sopenharmony_ci        -bit 16-17: Priority level
298c2ecf20Sopenharmony_ci          0x0: low
308c2ecf20Sopenharmony_ci          0x1: medium
318c2ecf20Sopenharmony_ci          0x2: high
328c2ecf20Sopenharmony_ci          0x3: very high
338c2ecf20Sopenharmony_ci    4. A 32bit bitfield value specifying DMA features which are device dependent:
348c2ecf20Sopenharmony_ci       -bit 0-1: DMA FIFO threshold selection
358c2ecf20Sopenharmony_ci         0x0: 1/4 full FIFO
368c2ecf20Sopenharmony_ci         0x1: 1/2 full FIFO
378c2ecf20Sopenharmony_ci         0x2: 3/4 full FIFO
388c2ecf20Sopenharmony_ci         0x3: full FIFO
398c2ecf20Sopenharmony_ci       -bit 2: DMA direct mode
408c2ecf20Sopenharmony_ci         0x0: FIFO mode with threshold selectable with bit 0-1
418c2ecf20Sopenharmony_ci         0x1: Direct mode: each DMA request immediately initiates a transfer
428c2ecf20Sopenharmony_ci              from/to the memory, FIFO is bypassed.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_cimaintainers:
468c2ecf20Sopenharmony_ci  - Amelie Delaunay <amelie.delaunay@st.com>
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciallOf:
498c2ecf20Sopenharmony_ci  - $ref: "dma-controller.yaml#"
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciproperties:
528c2ecf20Sopenharmony_ci  "#dma-cells":
538c2ecf20Sopenharmony_ci    const: 4
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci  compatible:
568c2ecf20Sopenharmony_ci    const: st,stm32-dma
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci  reg:
598c2ecf20Sopenharmony_ci    maxItems: 1
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci  clocks:
628c2ecf20Sopenharmony_ci    maxItems: 1
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci  interrupts:
658c2ecf20Sopenharmony_ci    maxItems: 8
668c2ecf20Sopenharmony_ci    description: Should contain all of the per-channel DMA
678c2ecf20Sopenharmony_ci      interrupts in ascending order with respect to the
688c2ecf20Sopenharmony_ci      DMA channel index.
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci  resets:
718c2ecf20Sopenharmony_ci    maxItems: 1
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci  st,mem2mem:
748c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/flag
758c2ecf20Sopenharmony_ci    description: if defined, it indicates that the controller
768c2ecf20Sopenharmony_ci      supports memory-to-memory transfer
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_cirequired:
798c2ecf20Sopenharmony_ci  - compatible
808c2ecf20Sopenharmony_ci  - reg
818c2ecf20Sopenharmony_ci  - clocks
828c2ecf20Sopenharmony_ci  - interrupts
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ciunevaluatedProperties: false
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciexamples:
878c2ecf20Sopenharmony_ci  - |
888c2ecf20Sopenharmony_ci    #include <dt-bindings/interrupt-controller/arm-gic.h>
898c2ecf20Sopenharmony_ci    #include <dt-bindings/clock/stm32mp1-clks.h>
908c2ecf20Sopenharmony_ci    #include <dt-bindings/reset/stm32mp1-resets.h>
918c2ecf20Sopenharmony_ci    dma-controller@40026400 {
928c2ecf20Sopenharmony_ci      compatible = "st,stm32-dma";
938c2ecf20Sopenharmony_ci      reg = <0x40026400 0x400>;
948c2ecf20Sopenharmony_ci      interrupts = <56>,
958c2ecf20Sopenharmony_ci                   <57>,
968c2ecf20Sopenharmony_ci                   <58>,
978c2ecf20Sopenharmony_ci                   <59>,
988c2ecf20Sopenharmony_ci                   <60>,
998c2ecf20Sopenharmony_ci                   <68>,
1008c2ecf20Sopenharmony_ci                   <69>,
1018c2ecf20Sopenharmony_ci                   <70>;
1028c2ecf20Sopenharmony_ci      clocks = <&clk_hclk>;
1038c2ecf20Sopenharmony_ci      #dma-cells = <4>;
1048c2ecf20Sopenharmony_ci      st,mem2mem;
1058c2ecf20Sopenharmony_ci      resets = <&rcc 150>;
1068c2ecf20Sopenharmony_ci      dma-requests = <8>;
1078c2ecf20Sopenharmony_ci    };
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci...
110