# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Secure AHB to IP Slave bus (AIPSTZ) bridge

description:
  The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters issuing
  transactions to IP Slave peripherals. Additionally, this module offers access
  control configurations meant to restrict which peripherals a master can
  access.

maintainers:
  - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

properties:
  compatible:
    const: fsl,imx8mp-aipstz

  reg:
    maxItems: 1

  power-domains:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  "#access-controller-cells":
    const: 3
    description:
      First cell - consumer ID
      Second cell - consumer type (master or peripheral)
      Third cell - configuration value

  ranges: true

# borrowed from simple-bus.yaml, no additional requirements for children
patternProperties:
  "@(0|[1-9a-f][0-9a-f]*)$":
    type: object
    additionalProperties: true
    properties:
      reg:
        items:
          minItems: 2
          maxItems: 4
        minItems: 1
        maxItems: 1024
      ranges:
        oneOf:
          - items:
              minItems: 3
              maxItems: 7
            minItems: 1
            maxItems: 1024
          - $ref: /schemas/types.yaml#/definitions/flag
    anyOf:
      - required:
          - reg
      - required:
          - ranges

required:
  - compatible
  - reg
  - power-domains
  - "#address-cells"
  - "#size-cells"
  - "#access-controller-cells"
  - ranges

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/imx8mp-clock.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    bus@30df0000 {
        compatible = "fsl,imx8mp-aipstz";
        reg = <0x30df0000 0x10000>;
        ranges = <0x30c00000 0x30c00000 0x400000>;
        power-domains = <&pgc_audio>;
        #address-cells = <1>;
        #size-cells = <1>;
        #access-controller-cells = <3>;

        dma-controller@30e00000 {
            compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
            reg = <0x30e00000 0x10000>;
            #dma-cells = <3>;
            clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
                     <&clk IMX8MP_CLK_AUDIO_ROOT>;
            clock-names = "ipg", "ahb";
            interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
            fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
        };
    };
