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