xref: /freebsd/sys/contrib/device-tree/Bindings/dma/ti/k3-bcdma.yaml (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
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
37  reg:
38    minItems: 3
39    maxItems: 5
40
41  reg-names:
42    minItems: 3
43    maxItems: 5
44
45  "#dma-cells":
46    const: 3
47    description: |
48      cell 1: type of the BCDMA channel to be used to service the peripheral:
49        0 - split channel
50        1 - block copy channel using global trigger 1
51        2 - block copy channel using global trigger 2
52        3 - block copy channel using local trigger
53
54      cell 2: parameter for the channel:
55        if cell 1 is 0 (split channel):
56          PSI-L thread ID of the remote (to BCDMA) end.
57          Valid ranges for thread ID depends on the data movement direction:
58          for source thread IDs (rx): 0 - 0x7fff
59          for destination thread IDs (tx): 0x8000 - 0xffff
60
61          Please refer to the device documentation for the PSI-L thread map and
62          also the PSI-L peripheral chapter for the correct thread ID.
63        if cell 1 is 1 or 2 (block copy channel using global trigger):
64          Unused, ignored
65
66          The trigger must be configured for the channel externally to BCDMA,
67          channels using global triggers should not be requested directly, but
68          via DMA event router.
69        if cell 1 is 3 (block copy channel using local trigger):
70          bchan number of the locally triggered channel
71
72      cell 3: ASEL value for the channel
73
74  msi-parent: true
75
76  power-domains:
77    description:
78      Power domain if available
79    maxItems: 1
80
81  ti,asel:
82    $ref: /schemas/types.yaml#/definitions/uint32
83    description: ASEL value for non slave channels
84
85  ti,sci-rm-range-bchan:
86    $ref: /schemas/types.yaml#/definitions/uint32-array
87    description: |
88      Array of BCDMA block-copy channel resource subtypes for resource
89      allocation for this host
90    minItems: 1
91    # Should be enough
92    maxItems: 255
93    items:
94      maximum: 0x3f
95
96  ti,sci-rm-range-tchan:
97    $ref: /schemas/types.yaml#/definitions/uint32-array
98    description: |
99      Array of BCDMA split tx channel resource subtypes for resource allocation
100      for this host
101    minItems: 1
102    # Should be enough
103    maxItems: 255
104    items:
105      maximum: 0x3f
106
107  ti,sci-rm-range-rchan:
108    $ref: /schemas/types.yaml#/definitions/uint32-array
109    description: |
110      Array of BCDMA split rx channel resource subtypes for resource allocation
111      for this host
112    minItems: 1
113    # Should be enough
114    maxItems: 255
115    items:
116      maximum: 0x3f
117
118required:
119  - compatible
120  - "#dma-cells"
121  - reg
122  - reg-names
123  - msi-parent
124  - ti,sci
125  - ti,sci-dev-id
126  - ti,sci-rm-range-rchan
127
128allOf:
129  - $ref: /schemas/dma/dma-controller.yaml#
130  - $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml#
131
132  - if:
133      properties:
134        compatible:
135          contains:
136            const: ti,am62a-dmss-bcdma-csirx
137    then:
138      properties:
139        ti,sci-rm-range-bchan: false
140        ti,sci-rm-range-tchan: false
141
142        reg:
143          maxItems: 3
144
145        reg-names:
146          items:
147            - const: gcfg
148            - const: rchanrt
149            - const: ringrt
150
151      required:
152        - power-domains
153
154    else:
155      properties:
156        reg:
157          minItems: 5
158
159        reg-names:
160          items:
161            - const: gcfg
162            - const: bchanrt
163            - const: rchanrt
164            - const: tchanrt
165            - const: ringrt
166
167      required:
168        - ti,sci-rm-range-bchan
169        - ti,sci-rm-range-tchan
170
171unevaluatedProperties: false
172
173examples:
174  - |+
175    cbass_main {
176        #address-cells = <2>;
177        #size-cells = <2>;
178
179        main_dmss {
180            compatible = "simple-mfd";
181            #address-cells = <2>;
182            #size-cells = <2>;
183            dma-ranges;
184            ranges;
185
186            ti,sci-dev-id = <25>;
187
188            main_bcdma: dma-controller@485c0100 {
189                compatible = "ti,am64-dmss-bcdma";
190
191                reg = <0x0 0x485c0100 0x0 0x100>,
192                      <0x0 0x4c000000 0x0 0x20000>,
193                      <0x0 0x4a820000 0x0 0x20000>,
194                      <0x0 0x4aa40000 0x0 0x20000>,
195                      <0x0 0x4bc00000 0x0 0x100000>;
196                reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt", "ringrt";
197                msi-parent = <&inta_main_dmss>;
198                #dma-cells = <3>;
199
200                ti,sci = <&dmsc>;
201                ti,sci-dev-id = <26>;
202
203                ti,sci-rm-range-bchan = <0x20>; /* BLOCK_COPY_CHAN */
204                ti,sci-rm-range-rchan = <0x21>; /* SPLIT_TR_RX_CHAN */
205                ti,sci-rm-range-tchan = <0x22>; /* SPLIT_TR_TX_CHAN */
206            };
207        };
208    };
209