xref: /linux/Documentation/devicetree/bindings/dma/ingenic,dma.yaml (revision a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0)
163d35f6cSPaul Cercueil# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
263d35f6cSPaul Cercueil%YAML 1.2
363d35f6cSPaul Cercueil---
463d35f6cSPaul Cercueil$id: http://devicetree.org/schemas/dma/ingenic,dma.yaml#
563d35f6cSPaul Cercueil$schema: http://devicetree.org/meta-schemas/core.yaml#
663d35f6cSPaul Cercueil
7a612130cSKrzysztof Kozlowskititle: Ingenic SoCs DMA Controller
863d35f6cSPaul Cercueil
963d35f6cSPaul Cercueilmaintainers:
1063d35f6cSPaul Cercueil  - Paul Cercueil <paul@crapouillou.net>
1163d35f6cSPaul Cercueil
1263d35f6cSPaul CercueilallOf:
1310cafa2dSKrzysztof Kozlowski  - $ref: dma-controller.yaml#
1463d35f6cSPaul Cercueil
1563d35f6cSPaul Cercueilproperties:
1663d35f6cSPaul Cercueil  compatible:
17e0699a75SPaul Cercueil    oneOf:
18e0699a75SPaul Cercueil      - enum:
1963d35f6cSPaul Cercueil          - ingenic,jz4740-dma
2063d35f6cSPaul Cercueil          - ingenic,jz4725b-dma
2197c4cf38SSiarhei Volkau          - ingenic,jz4755-dma
226ce6acf6SPaul Cercueil          - ingenic,jz4760-dma
23e0699a75SPaul Cercueil          - ingenic,jz4760-bdma
24e0699a75SPaul Cercueil          - ingenic,jz4760-mdma
256ce6acf6SPaul Cercueil          - ingenic,jz4760b-dma
26e0699a75SPaul Cercueil          - ingenic,jz4760b-bdma
27e0699a75SPaul Cercueil          - ingenic,jz4760b-mdma
2863d35f6cSPaul Cercueil          - ingenic,jz4770-dma
2963d35f6cSPaul Cercueil          - ingenic,jz4780-dma
3063d35f6cSPaul Cercueil          - ingenic,x1000-dma
3163d35f6cSPaul Cercueil          - ingenic,x1830-dma
32e0699a75SPaul Cercueil      - items:
33e0699a75SPaul Cercueil          - const: ingenic,jz4770-bdma
34e0699a75SPaul Cercueil          - const: ingenic,jz4760b-bdma
3563d35f6cSPaul Cercueil
3663d35f6cSPaul Cercueil  reg:
3763d35f6cSPaul Cercueil    items:
3863d35f6cSPaul Cercueil      - description: Channel-specific registers
3963d35f6cSPaul Cercueil      - description: System control registers
4063d35f6cSPaul Cercueil
4163d35f6cSPaul Cercueil  interrupts:
4263d35f6cSPaul Cercueil    maxItems: 1
4363d35f6cSPaul Cercueil
4463d35f6cSPaul Cercueil  clocks:
4563d35f6cSPaul Cercueil    maxItems: 1
4663d35f6cSPaul Cercueil
4763d35f6cSPaul Cercueil  "#dma-cells":
48dafa79a1SPaul Cercueil    enum: [2, 3]
4963d35f6cSPaul Cercueil    description: >
5063d35f6cSPaul Cercueil      DMA clients must use the format described in dma.txt, giving a phandle
51dafa79a1SPaul Cercueil      to the DMA controller plus the following integer cells:
5263d35f6cSPaul Cercueil
53dafa79a1SPaul Cercueil      - Request type: The DMA request type specifies the device endpoint that
54dafa79a1SPaul Cercueil        will be the source or destination of the DMA transfer.
55dafa79a1SPaul Cercueil        If "#dma-cells" is 2, the request type is a single cell, and the
56dafa79a1SPaul Cercueil        direction will be unidirectional (either RX or TX but not both).
57dafa79a1SPaul Cercueil        If "#dma-cells" is 3, the request type has two cells; the first
58dafa79a1SPaul Cercueil        one corresponds to the host to device direction (TX), the second one
59dafa79a1SPaul Cercueil        corresponds to the device to host direction (RX). The DMA channel is
60dafa79a1SPaul Cercueil        then bidirectional.
6163d35f6cSPaul Cercueil
6263d35f6cSPaul Cercueil      - Channel: If set to 0xffffffff, any available channel will be allocated
6363d35f6cSPaul Cercueil        for the client. Otherwise, the exact channel specified will be used.
6463d35f6cSPaul Cercueil        The channel should be reserved on the DMA controller using the
6563d35f6cSPaul Cercueil        ingenic,reserved-channels property.
6663d35f6cSPaul Cercueil
6763d35f6cSPaul Cercueil  ingenic,reserved-channels:
68d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
6963d35f6cSPaul Cercueil    description: >
7063d35f6cSPaul Cercueil      Bitmask of channels to reserve for devices that need a specific
71*47aab533SBjorn Helgaas      channel. These channels will only be assigned when explicitly
7263d35f6cSPaul Cercueil      requested by a client. The primary use for this is channels 0 and
7363d35f6cSPaul Cercueil      1, which can be configured to have special behaviour for NAND/BCH
7463d35f6cSPaul Cercueil      when using programmable firmware.
7563d35f6cSPaul Cercueil
7663d35f6cSPaul Cercueilrequired:
7763d35f6cSPaul Cercueil  - compatible
7863d35f6cSPaul Cercueil  - reg
7963d35f6cSPaul Cercueil  - interrupts
8063d35f6cSPaul Cercueil  - clocks
8163d35f6cSPaul Cercueil
826fdc6e23SRob HerringunevaluatedProperties: false
836fdc6e23SRob Herring
8463d35f6cSPaul Cercueilexamples:
8563d35f6cSPaul Cercueil  - |
86c4a11bf4SPaul Cercueil    #include <dt-bindings/clock/ingenic,jz4780-cgu.h>
8763d35f6cSPaul Cercueil    dma: dma-controller@13420000 {
8863d35f6cSPaul Cercueil      compatible = "ingenic,jz4780-dma";
8963d35f6cSPaul Cercueil      reg = <0x13420000 0x400>, <0x13421000 0x40>;
9063d35f6cSPaul Cercueil
9163d35f6cSPaul Cercueil      interrupt-parent = <&intc>;
9263d35f6cSPaul Cercueil      interrupts = <10>;
9363d35f6cSPaul Cercueil
9463d35f6cSPaul Cercueil      clocks = <&cgu JZ4780_CLK_PDMA>;
9563d35f6cSPaul Cercueil
9663d35f6cSPaul Cercueil      #dma-cells = <2>;
9763d35f6cSPaul Cercueil
9863d35f6cSPaul Cercueil      ingenic,reserved-channels = <0x3>;
9963d35f6cSPaul Cercueil    };
100