1# Copyright (c) 2019, STMicroelectronics
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  STM32 DMAMUX controller
6
7  The STM32 DMAMUX is a direct memory access multiplexer
8  capable of supporting independent DMA channels.
9  DMAMUX clients connected to the STM32 DMA ultiplexer must use a two-cell specifier
10  for each dmamux channel: a phandle to the DMA multiplexer plus the following 2 integer cells:
11    1. channel: the mux channel from 0 to <dma-channels> - 1
12    2. slot: the request line Multiplexer ID
13    3. channel-config: A 32bit mask specifying the DMA channel configuration
14    which is device dependent:
15        -bit 6-7 : Direction  (see dma.h)
16               0x0: MEM to MEM
17               0x1: MEM to PERIPH
18               0x2: PERIPH to MEM
19               0x3: reserved for PERIPH to PERIPH
20        -bit 9 : Peripheral Increment Address
21               0x0: no address increment between transfers
22               0x1: increment address between transfers
23        -bit 10 : Memory Increment Address
24               0x0: no address increment between transfers
25               0x1: increment address between transfers
26        -bit 11-12 : Peripheral data size
27               0x0: Byte (8 bits)
28               0x1: Half-word (16 bits)
29               0x2: Word (32 bits)
30               0x3: reserved
31        -bit 13-14 : Memory data size
32               0x0: Byte (8 bits)
33               0x1: Half-word (16 bits)
34               0x2: Word (32 bits)
35               0x3: reserved
36        -bit 15: Peripheral Increment Offset Size not USED for DMA V2
37               0x0: offset size is linked to the peripheral bus width
38               0x1: offset size is fixed to 4 (32-bit alignment)
39        -bit 16-17 : Priority level
40               0x0: low
41               0x1: medium
42               0x2: high
43               0x3: very high
44   example for stm32wb55x
45     dmamux1: dmamux@40020800 {
46         compatible = "st,stm32-dmamux";
47         ...
48         dma-channels = <14>;
49         dma-generators = <4>;
50         dma-requests= <36>;
51         status = "disabled";
52        };
53    for client SPI of stm32wb55x
54     spi1: spi@40013000 {
55         compatible = "st,stm32-spi";
56         dmas = <&dmamux1 11 7 0x20440
57                  &dmamux1 1 6 0x20480>;
58         dma-names = "tx", "rx";
59        };
60
61compatible: "st,stm32-dmamux"
62
63include: dmamux-controller.yaml
64
65properties:
66  reg:
67    required: true
68
69  "#dma-cells":
70    const: 3
71
72# Parameter syntax of stm32 follows the dma client dts syntax
73# in the Linux kernel declared in
74# https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/plain/Bindings/dma/st,stm32-dmamux.yaml
75
76dma-cells:
77  - channel
78  - slot
79  - channel-config
80