# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/hisilicon,k3-dma-1.0.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Hisilicon K3 DMA controller

maintainers:
  - Wei Xu <xuwei5@hisilicon.com>

properties:
  compatible:
    items:
      - enum:
          - hisilicon,k3-dma-1.0
          - hisilicon,hisi-pcm-asp-dma-1.0

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  interrupts:
    maxItems: 1

  '#dma-cells':
    const: 1

  dma-channels:
    description: Number of physical DMA channels supported.
    maximum: 32

  dma-requests:
    description: Number of virtual DMA request lines supported.
    maximum: 32

  dma-channel-mask:
    description: Bitmask of usable DMA channels.

  dma-no-cci:
    type: boolean
    description: DMA is not coherent with the CCI.

  dma-type:
    $ref: /schemas/types.yaml#/definitions/string
    description: SoC-specific DMA type name.
    enum:
      - hi3660_dma
      - hi6220_dma

  interrupt-names:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - '#dma-cells'
  - dma-channels
  - dma-requests

allOf:
  - $ref: dma-controller.yaml#
  - if:
      properties:
        compatible:
          contains:
            const: hisilicon,k3-dma-1.0
    then:
      required:
        - clocks

additionalProperties: false

examples:
  - |
    dma-controller@fcd02000 {
        compatible = "hisilicon,k3-dma-1.0";
        reg = <0xfcd02000 0x1000>;
        #dma-cells = <1>;
        dma-channels = <16>;
        dma-requests = <27>;
        interrupts = <0 12 4>;
        clocks = <&pclk>;
    };