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-mdma.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: STMicroelectronics STM32 MDMA Controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: |
10c66ec88fSEmmanuel Vadot  The STM32 MDMA is a general-purpose direct memory access controller capable of
11c66ec88fSEmmanuel Vadot  supporting 64 independent DMA channels with 256 HW requests.
12c66ec88fSEmmanuel Vadot  DMA clients connected to the STM32 MDMA controller must use the format
13c66ec88fSEmmanuel Vadot  described in the dma.txt file, using a five-cell specifier for each channel:
14c66ec88fSEmmanuel Vadot  a phandle to the MDMA controller plus the following five integer cells:
15c66ec88fSEmmanuel Vadot    1. The request line number
16c66ec88fSEmmanuel Vadot    2. The priority level
17c66ec88fSEmmanuel Vadot      0x0: Low
18c66ec88fSEmmanuel Vadot      0x1: Medium
19c66ec88fSEmmanuel Vadot      0x2: High
20c66ec88fSEmmanuel Vadot      0x3: Very high
21c66ec88fSEmmanuel Vadot    3. A 32bit mask specifying the DMA channel configuration
22c66ec88fSEmmanuel Vadot      -bit 0-1: Source increment mode
23c66ec88fSEmmanuel Vadot        0x0: Source address pointer is fixed
24c66ec88fSEmmanuel Vadot        0x2: Source address pointer is incremented after each data transfer
25c66ec88fSEmmanuel Vadot        0x3: Source address pointer is decremented after each data transfer
26c66ec88fSEmmanuel Vadot      -bit 2-3: Destination increment mode
27c66ec88fSEmmanuel Vadot        0x0: Destination address pointer is fixed
28c66ec88fSEmmanuel Vadot        0x2: Destination address pointer is incremented after each data transfer
29c66ec88fSEmmanuel Vadot        0x3: Destination address pointer is decremented after each data transfer
30c66ec88fSEmmanuel Vadot      -bit 8-9: Source increment offset size
31c66ec88fSEmmanuel Vadot        0x0: byte (8bit)
32c66ec88fSEmmanuel Vadot        0x1: half-word (16bit)
33c66ec88fSEmmanuel Vadot        0x2: word (32bit)
34c66ec88fSEmmanuel Vadot        0x3: double-word (64bit)
35c66ec88fSEmmanuel Vadot      -bit 10-11: Destination increment offset size
36c66ec88fSEmmanuel Vadot        0x0: byte (8bit)
37c66ec88fSEmmanuel Vadot        0x1: half-word (16bit)
38c66ec88fSEmmanuel Vadot        0x2: word (32bit)
39c66ec88fSEmmanuel Vadot        0x3: double-word (64bit)
40c66ec88fSEmmanuel Vadot      -bit 25-18: The number of bytes to be transferred in a single transfer
41c66ec88fSEmmanuel Vadot                  (min = 1 byte, max = 128 bytes)
42c66ec88fSEmmanuel Vadot      -bit 29:28: Trigger Mode
43c66ec88fSEmmanuel Vadot        0x00: Each MDMA request triggers a buffer transfer (max 128 bytes)
44c66ec88fSEmmanuel Vadot        0x1: Each MDMA request triggers a block transfer (max 64K bytes)
45c66ec88fSEmmanuel Vadot        0x2: Each MDMA request triggers a repeated block transfer
46c66ec88fSEmmanuel Vadot        0x3: Each MDMA request triggers a linked list transfer
47c66ec88fSEmmanuel Vadot    4. A 32bit value specifying the register to be used to acknowledge the request
48c66ec88fSEmmanuel Vadot       if no HW ack signal is used by the MDMA client
49c66ec88fSEmmanuel Vadot    5. A 32bit mask specifying the value to be written to acknowledge the request
50c66ec88fSEmmanuel Vadot       if no HW ack signal is used by the MDMA client
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadotmaintainers:
538cc087a1SEmmanuel Vadot  - Amelie Delaunay <amelie.delaunay@foss.st.com>
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel VadotallOf:
56*cb7aa33aSEmmanuel Vadot  - $ref: dma-controller.yaml#
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel Vadotproperties:
59c66ec88fSEmmanuel Vadot  "#dma-cells":
60c66ec88fSEmmanuel Vadot    const: 5
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot  compatible:
63c66ec88fSEmmanuel Vadot    const: st,stm32h7-mdma
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: 1
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot  resets:
75c66ec88fSEmmanuel Vadot    maxItems: 1
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot  st,ahb-addr-masks:
78c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
79c66ec88fSEmmanuel Vadot    description: Array of u32 mask to list memory devices addressed via AHB bus.
80c66ec88fSEmmanuel Vadot
81c66ec88fSEmmanuel Vadotrequired:
82c66ec88fSEmmanuel Vadot  - compatible
83c66ec88fSEmmanuel Vadot  - reg
84c66ec88fSEmmanuel Vadot  - clocks
85c66ec88fSEmmanuel Vadot  - interrupts
86c66ec88fSEmmanuel Vadot
876be33864SEmmanuel VadotunevaluatedProperties: false
886be33864SEmmanuel Vadot
89c66ec88fSEmmanuel Vadotexamples:
90c66ec88fSEmmanuel Vadot  - |
91c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
92c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/stm32mp1-clks.h>
93c66ec88fSEmmanuel Vadot    #include <dt-bindings/reset/stm32mp1-resets.h>
94c66ec88fSEmmanuel Vadot    dma-controller@52000000 {
95c66ec88fSEmmanuel Vadot      compatible = "st,stm32h7-mdma";
96c66ec88fSEmmanuel Vadot      reg = <0x52000000 0x1000>;
97c66ec88fSEmmanuel Vadot      interrupts = <122>;
98c66ec88fSEmmanuel Vadot      clocks = <&timer_clk>;
99c66ec88fSEmmanuel Vadot      resets = <&rcc 992>;
100c66ec88fSEmmanuel Vadot      #dma-cells = <5>;
101c66ec88fSEmmanuel Vadot      dma-channels = <16>;
102c66ec88fSEmmanuel Vadot      dma-requests = <32>;
103c66ec88fSEmmanuel Vadot      st,ahb-addr-masks = <0x20000000>, <0x00000000>;
104c66ec88fSEmmanuel Vadot    };
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot...
107