18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/dma/ti/k3-udma.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Texas Instruments K3 NAVSS Unified DMA Device Tree Bindings
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Peter Ujfalusi <peter.ujfalusi@ti.com>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |
138c2ecf20Sopenharmony_ci  The UDMA-P is intended to perform similar (but significantly upgraded)
148c2ecf20Sopenharmony_ci  functions as the packet-oriented DMA used on previous SoC devices. The UDMA-P
158c2ecf20Sopenharmony_ci  module supports the transmission and reception of various packet types.
168c2ecf20Sopenharmony_ci  The UDMA-P architecture facilitates the segmentation and reassembly of SoC DMA
178c2ecf20Sopenharmony_ci  data structure compliant packets to/from smaller data blocks that are natively
188c2ecf20Sopenharmony_ci  compatible with the specific requirements of each connected peripheral.
198c2ecf20Sopenharmony_ci  Multiple Tx and Rx channels are provided within the DMA which allow multiple
208c2ecf20Sopenharmony_ci  segmentation or reassembly operations to be ongoing. The DMA controller
218c2ecf20Sopenharmony_ci  maintains state information for each of the channels which allows packet
228c2ecf20Sopenharmony_ci  segmentation and reassembly operations to be time division multiplexed between
238c2ecf20Sopenharmony_ci  channels in order to share the underlying DMA hardware. An external DMA
248c2ecf20Sopenharmony_ci  scheduler is used to control the ordering and rate at which this multiplexing
258c2ecf20Sopenharmony_ci  occurs for Transmit operations. The ordering and rate of Receive operations
268c2ecf20Sopenharmony_ci  is indirectly controlled by the order in which blocks are pushed into the DMA
278c2ecf20Sopenharmony_ci  on the Rx PSI-L interface.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci  The UDMA-P also supports acting as both a UTC and UDMA-C for its internal
308c2ecf20Sopenharmony_ci  channels. Channels in the UDMA-P can be configured to be either Packet-Based
318c2ecf20Sopenharmony_ci  or Third-Party channels on a channel by channel basis.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci  All transfers within NAVSS is done between PSI-L source and destination
348c2ecf20Sopenharmony_ci  threads.
358c2ecf20Sopenharmony_ci  The peripherals serviced by UDMA can be PSI-L native (sa2ul, cpsw, etc) or
368c2ecf20Sopenharmony_ci  legacy, non PSI-L native peripherals. In the later case a special, small PDMA
378c2ecf20Sopenharmony_ci  is tasked to act as a bridge between the PSI-L fabric and the legacy
388c2ecf20Sopenharmony_ci  peripheral.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci  PDMAs can be configured via UDMAP peer registers to match with the
418c2ecf20Sopenharmony_ci  configuration of the legacy peripheral.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciallOf:
448c2ecf20Sopenharmony_ci  - $ref: "../dma-controller.yaml#"
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciproperties:
478c2ecf20Sopenharmony_ci  "#dma-cells":
488c2ecf20Sopenharmony_ci    minimum: 1
498c2ecf20Sopenharmony_ci    maximum: 2
508c2ecf20Sopenharmony_ci    description: |
518c2ecf20Sopenharmony_ci      The cell is the PSI-L  thread ID of the remote (to UDMAP) end.
528c2ecf20Sopenharmony_ci      Valid ranges for thread ID depends on the data movement direction:
538c2ecf20Sopenharmony_ci      for source thread IDs (rx): 0 - 0x7fff
548c2ecf20Sopenharmony_ci      for destination thread IDs (tx): 0x8000 - 0xffff
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci      Please refer to the device documentation for the PSI-L thread map and also
578c2ecf20Sopenharmony_ci      the PSI-L peripheral chapter for the correct thread ID.
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci      When #dma-cells is 2, the second parameter is the channel ATYPE.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci  compatible:
628c2ecf20Sopenharmony_ci    enum:
638c2ecf20Sopenharmony_ci      - ti,am654-navss-main-udmap
648c2ecf20Sopenharmony_ci      - ti,am654-navss-mcu-udmap
658c2ecf20Sopenharmony_ci      - ti,j721e-navss-main-udmap
668c2ecf20Sopenharmony_ci      - ti,j721e-navss-mcu-udmap
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci  reg:
698c2ecf20Sopenharmony_ci    maxItems: 3
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci  reg-names:
728c2ecf20Sopenharmony_ci    items:
738c2ecf20Sopenharmony_ci      - const: gcfg
748c2ecf20Sopenharmony_ci      - const: rchanrt
758c2ecf20Sopenharmony_ci      - const: tchanrt
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci  msi-parent: true
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci  ti,sci:
808c2ecf20Sopenharmony_ci    description: phandle to TI-SCI compatible System controller node
818c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci  ti,sci-dev-id:
848c2ecf20Sopenharmony_ci    description: TI-SCI device id of UDMAP
858c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci  ti,ringacc:
888c2ecf20Sopenharmony_ci    description: phandle to the ring accelerator node
898c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci  ti,sci-rm-range-tchan:
928c2ecf20Sopenharmony_ci    description: |
938c2ecf20Sopenharmony_ci      Array of UDMA tchan resource subtypes for resource allocation for this
948c2ecf20Sopenharmony_ci      host
958c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-array
968c2ecf20Sopenharmony_ci    minItems: 1
978c2ecf20Sopenharmony_ci    # Should be enough
988c2ecf20Sopenharmony_ci    maxItems: 255
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci  ti,sci-rm-range-rchan:
1018c2ecf20Sopenharmony_ci    description: |
1028c2ecf20Sopenharmony_ci      Array of UDMA rchan resource subtypes for resource allocation for this
1038c2ecf20Sopenharmony_ci      host
1048c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-array
1058c2ecf20Sopenharmony_ci    minItems: 1
1068c2ecf20Sopenharmony_ci    # Should be enough
1078c2ecf20Sopenharmony_ci    maxItems: 255
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci  ti,sci-rm-range-rflow:
1108c2ecf20Sopenharmony_ci    description: |
1118c2ecf20Sopenharmony_ci      Array of UDMA rflow resource subtypes for resource allocation for this
1128c2ecf20Sopenharmony_ci      host
1138c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-array
1148c2ecf20Sopenharmony_ci    minItems: 1
1158c2ecf20Sopenharmony_ci    # Should be enough
1168c2ecf20Sopenharmony_ci    maxItems: 255
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_cirequired:
1198c2ecf20Sopenharmony_ci  - compatible
1208c2ecf20Sopenharmony_ci  - "#dma-cells"
1218c2ecf20Sopenharmony_ci  - reg
1228c2ecf20Sopenharmony_ci  - reg-names
1238c2ecf20Sopenharmony_ci  - msi-parent
1248c2ecf20Sopenharmony_ci  - ti,sci
1258c2ecf20Sopenharmony_ci  - ti,sci-dev-id
1268c2ecf20Sopenharmony_ci  - ti,ringacc
1278c2ecf20Sopenharmony_ci  - ti,sci-rm-range-tchan
1288c2ecf20Sopenharmony_ci  - ti,sci-rm-range-rchan
1298c2ecf20Sopenharmony_ci  - ti,sci-rm-range-rflow
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ciif:
1328c2ecf20Sopenharmony_ci  properties:
1338c2ecf20Sopenharmony_ci    "#dma-cells":
1348c2ecf20Sopenharmony_ci      const: 2
1358c2ecf20Sopenharmony_cithen:
1368c2ecf20Sopenharmony_ci  properties:
1378c2ecf20Sopenharmony_ci    ti,udma-atype:
1388c2ecf20Sopenharmony_ci      description: ATYPE value which should be used by non slave channels
1398c2ecf20Sopenharmony_ci      $ref: /schemas/types.yaml#/definitions/uint32
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci  required:
1428c2ecf20Sopenharmony_ci    - ti,udma-atype
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ciunevaluatedProperties: false
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ciexamples:
1478c2ecf20Sopenharmony_ci  - |+
1488c2ecf20Sopenharmony_ci    cbass_main {
1498c2ecf20Sopenharmony_ci        #address-cells = <2>;
1508c2ecf20Sopenharmony_ci        #size-cells = <2>;
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci        cbass_main_navss: navss@30800000 {
1538c2ecf20Sopenharmony_ci            compatible = "simple-mfd";
1548c2ecf20Sopenharmony_ci            #address-cells = <2>;
1558c2ecf20Sopenharmony_ci            #size-cells = <2>;
1568c2ecf20Sopenharmony_ci            dma-coherent;
1578c2ecf20Sopenharmony_ci            dma-ranges;
1588c2ecf20Sopenharmony_ci            ranges = <0x0 0x30800000 0x0 0x30800000 0x0 0x05000000>;
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci            ti,sci-dev-id = <118>;
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci            main_udmap: dma-controller@31150000 {
1638c2ecf20Sopenharmony_ci                compatible = "ti,am654-navss-main-udmap";
1648c2ecf20Sopenharmony_ci                reg = <0x0 0x31150000 0x0 0x100>,
1658c2ecf20Sopenharmony_ci                      <0x0 0x34000000 0x0 0x100000>,
1668c2ecf20Sopenharmony_ci                      <0x0 0x35000000 0x0 0x100000>;
1678c2ecf20Sopenharmony_ci                reg-names = "gcfg", "rchanrt", "tchanrt";
1688c2ecf20Sopenharmony_ci                #dma-cells = <1>;
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci                ti,ringacc = <&ringacc>;
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci                msi-parent = <&inta_main_udmass>;
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci                ti,sci = <&dmsc>;
1758c2ecf20Sopenharmony_ci                ti,sci-dev-id = <188>;
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci                ti,sci-rm-range-tchan = <0x1>, /* TX_HCHAN */
1788c2ecf20Sopenharmony_ci                                        <0x2>; /* TX_CHAN */
1798c2ecf20Sopenharmony_ci                ti,sci-rm-range-rchan = <0x4>, /* RX_HCHAN */
1808c2ecf20Sopenharmony_ci                                        <0x5>; /* RX_CHAN */
1818c2ecf20Sopenharmony_ci                ti,sci-rm-range-rflow = <0x6>; /* GP RFLOW */
1828c2ecf20Sopenharmony_ci            };
1838c2ecf20Sopenharmony_ci        };
1848c2ecf20Sopenharmony_ci    };
185