# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interconnect/qcom,kuno-rpmh.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm RPMh Network-On-Chip Interconnect on Kuno SoC

maintainers:
  - Hardeep Sharma <hardeep.sharma@oss.qualcomm.com>

description: |
  RPMh interconnect providers support system bandwidth requirements through
  RPMh hardware accelerators known as Bus Clock Manager (BCM). The provider is
  able to communicate with the BCM through the Resource State Coordinator (RSC)
  associated with each execution environment. Provider nodes must point to at
  least one RPMh device child node pertaining to their RSC and each provider
  can map to multiple RPMh resources.

  See also: include/dt-bindings/interconnect/qcom,kuno.h

properties:
  compatible:
    enum:
      - qcom,kuno-aggre-noc
      - qcom,kuno-clk-virt
      - qcom,kuno-cnoc-main
      - qcom,kuno-dc-noc
      - qcom,kuno-mc-virt
      - qcom,kuno-mem-noc
      - qcom,kuno-pcie-anoc
      - qcom,kuno-system-noc

  reg:
    maxItems: 1

  clocks:
    minItems: 1
    maxItems: 2

required:
  - compatible

allOf:
  - $ref: qcom,rpmh-common.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,kuno-clk-virt
              - qcom,kuno-mc-virt
    then:
      properties:
        reg: false
    else:
      required:
        - reg

  - if:
      properties:
        compatible:
          contains:
            const: qcom,kuno-aggre-noc
    then:
      properties:
        clocks:
          items:
            - description: System NoC USB SF AXI clock
            - description: IPA clock

  - if:
      properties:
        compatible:
          contains:
            const: qcom,kuno-system-noc
    then:
      properties:
        clocks:
          items:
            - description: IPA clock

  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,kuno-aggre-noc
              - qcom,kuno-system-noc
    then:
      required:
        - clocks
    else:
      properties:
        clocks: false

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/qcom,kuno-gcc.h>
    #include <dt-bindings/clock/qcom,rpmh.h>

    clk_virt: interconnect-0 {
        compatible = "qcom,kuno-clk-virt";
        #interconnect-cells = <1>;
        qcom,bcm-voters = <&apps_bcm_voter>;
    };

    aggre_noc: interconnect@1640000 {
        compatible = "qcom,kuno-aggre-noc";
        reg = <0x01640000 0x33400>;
        clocks = <&gcc GCC_SYS_NOC_USB_SF_AXI_CLK>,
                 <&rpmhcc RPMH_IPA_CLK>;
        #interconnect-cells = <1>;
        qcom,bcm-voters = <&apps_bcm_voter>;
    };
...