1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (C) 2020 Texas Instruments Incorporated
3# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
4%YAML 1.2
5---
6$id: http://devicetree.org/schemas/dma/ti/k3-bcdma.yaml#
7$schema: http://devicetree.org/meta-schemas/core.yaml#
8
9title: Texas Instruments K3 DMSS BCDMA
10
11maintainers:
12  - Peter Ujfalusi <peter.ujfalusi@gmail.com>
13
14description: |
15  The Block Copy DMA (BCDMA) is intended to perform similar functions as the TR
16  mode channels of K3 UDMA-P.
17  BCDMA includes block copy channels and Split channels.
18
19  Block copy channels mainly used for memory to memory transfers, but with
20  optional triggers a block copy channel can service peripherals by accessing
21  directly to memory mapped registers or area.
22
23  Split channels can be used to service PSI-L based peripherals.
24  The peripherals can be PSI-L native or legacy, non PSI-L native peripherals
25  with PDMAs. PDMA is tasked to act as a bridge between the PSI-L fabric and the
26  legacy peripheral.
27
28  PDMAs can be configured via BCDMA split channel's peer registers to match with
29  the configuration of the legacy peripheral.
30
31properties:
32  compatible:
33    enum:
34      - ti,am62a-dmss-bcdma-csirx
35      - ti,am64-dmss-bcdma
36      - ti,j721s2-dmss-bcdma-csi
37
38  reg:
39    minItems: 3
40    maxItems: 9
41
42  reg-names:
43    minItems: 3
44    maxItems: 9
45
46  "#dma-cells":
47    const: 3
48    description: |
49      cell 1: type of the BCDMA channel to be used to service the peripheral:
50        0 - split channel
51        1 - block copy channel using global trigger 1
52        2 - block copy channel using global trigger 2
53        3 - block copy channel using local trigger
54
55      cell 2: parameter for the channel:
56        if cell 1 is 0 (split channel):
57          PSI-L thread ID of the remote (to BCDMA) end.
58          Valid ranges for thread ID depends on the data movement direction:
59          for source thread IDs (rx): 0 - 0x7fff
60          for destination thread IDs (tx): 0x8000 - 0xffff
61
62          Please refer to the device documentation for the PSI-L thread map and
63          also the PSI-L peripheral chapter for the correct thread ID.
64        if cell 1 is 1 or 2 (block copy channel using global trigger):
65          Unused, ignored
66
67          The trigger must be configured for the channel externally to BCDMA,
68          channels using global triggers should not be requested directly, but
69          via DMA event router.
70        if cell 1 is 3 (block copy channel using local trigger):
71          bchan number of the locally triggered channel
72
73      cell 3: ASEL value for the channel
74
75  msi-parent: true
76
77  power-domains:
78    description:
79      Power domain if available
80    maxItems: 1
81
82  ti,asel:
83    $ref: /schemas/types.yaml#/definitions/uint32
84    description: ASEL value for non slave channels
85
86  ti,sci-rm-range-bchan:
87    $ref: /schemas/types.yaml#/definitions/uint32-array
88    description: |
89      Array of BCDMA block-copy channel resource subtypes for resource
90      allocation for this host
91    minItems: 1
92    # Should be enough
93    maxItems: 255
94    items:
95      maximum: 0x3f
96
97  ti,sci-rm-range-tchan:
98    $ref: /schemas/types.yaml#/definitions/uint32-array
99    description: |
100      Array of BCDMA split tx channel resource subtypes for resource allocation
101      for this host
102    minItems: 1
103    # Should be enough
104    maxItems: 255
105    items:
106      maximum: 0x3f
107
108  ti,sci-rm-range-rchan:
109    $ref: /schemas/types.yaml#/definitions/uint32-array
110    description: |
111      Array of BCDMA split rx channel resource subtypes for resource allocation
112      for this host
113    minItems: 1
114    # Should be enough
115    maxItems: 255
116    items:
117      maximum: 0x3f
118
119required:
120  - compatible
121  - "#dma-cells"
122  - reg
123  - reg-names
124  - msi-parent
125  - ti,sci
126  - ti,sci-dev-id
127  - ti,sci-rm-range-rchan
128
129allOf:
130  - $ref: /schemas/dma/dma-controller.yaml#
131  - $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml#
132
133  - if:
134      properties:
135        compatible:
136          contains:
137            const: ti,am62a-dmss-bcdma-csirx
138    then:
139      properties:
140        ti,sci-rm-range-bchan: false
141        ti,sci-rm-range-tchan: false
142
143        reg:
144          items:
145            - description: BCDMA Control /Status Registers region
146            - description: RX Channel Realtime Registers region
147            - description: Ring Realtime Registers region
148
149        reg-names:
150          items:
151            - const: gcfg
152            - const: rchanrt
153            - const: ringrt
154
155      required:
156        - power-domains
157
158  - if:
159      properties:
160        compatible:
161          contains:
162            const: ti,am64-dmss-bcdma
163    then:
164      properties:
165        reg:
166          minItems: 5
167          items:
168            - description: BCDMA Control /Status Registers region
169            - description: Block Copy Channel Realtime Registers region
170            - description: RX Channel Realtime Registers region
171            - description: TX Channel Realtime Registers region
172            - description: Ring Realtime Registers region
173            - description: Ring Configuration Registers region
174            - description: TX Channel Configuration Registers region
175            - description: RX Channel Configuration Registers region
176            - description: Block Copy Channel Configuration Registers region
177
178        reg-names:
179          minItems: 5
180          items:
181            - const: gcfg
182            - const: bchanrt
183            - const: rchanrt
184            - const: tchanrt
185            - const: ringrt
186            - const: ring
187            - const: tchan
188            - const: rchan
189            - const: bchan
190
191      required:
192        - ti,sci-rm-range-bchan
193        - ti,sci-rm-range-tchan
194
195  - if:
196      properties:
197        compatible:
198          contains:
199            const: ti,j721s2-dmss-bcdma-csi
200    then:
201      properties:
202        ti,sci-rm-range-bchan: false
203
204        reg:
205          items:
206            - description: BCDMA Control /Status Registers region
207            - description: RX Channel Realtime Registers region
208            - description: TX Channel Realtime Registers region
209            - description: Ring Realtime Registers region
210
211        reg-names:
212          items:
213            - const: gcfg
214            - const: rchanrt
215            - const: tchanrt
216            - const: ringrt
217
218      required:
219        - ti,sci-rm-range-tchan
220
221unevaluatedProperties: false
222
223examples:
224  - |+
225    cbass_main {
226        #address-cells = <2>;
227        #size-cells = <2>;
228
229        main_dmss {
230            compatible = "simple-mfd";
231            #address-cells = <2>;
232            #size-cells = <2>;
233            dma-ranges;
234            ranges;
235
236            ti,sci-dev-id = <25>;
237
238            main_bcdma: dma-controller@485c0100 {
239                compatible = "ti,am64-dmss-bcdma";
240
241                reg = <0x0 0x485c0100 0x0 0x100>,
242                      <0x0 0x4c000000 0x0 0x20000>,
243                      <0x0 0x4a820000 0x0 0x20000>,
244                      <0x0 0x4aa40000 0x0 0x20000>,
245                      <0x0 0x4bc00000 0x0 0x100000>,
246                      <0x0 0x48600000 0x0 0x8000>,
247                      <0x0 0x484a4000 0x0 0x2000>,
248                      <0x0 0x484c2000 0x0 0x2000>,
249                      <0x0 0x48420000 0x0 0x2000>;
250                reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt", "ringrt",
251                            "ring", "tchan", "rchan", "bchan";
252                msi-parent = <&inta_main_dmss>;
253                #dma-cells = <3>;
254
255                ti,sci = <&dmsc>;
256                ti,sci-dev-id = <26>;
257
258                ti,sci-rm-range-bchan = <0x20>; /* BLOCK_COPY_CHAN */
259                ti,sci-rm-range-rchan = <0x21>; /* SPLIT_TR_RX_CHAN */
260                ti,sci-rm-range-tchan = <0x22>; /* SPLIT_TR_TX_CHAN */
261            };
262        };
263    };
264