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