1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/mailbox/qcom,apcs-kpss-global.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: Qualcomm APCS global block bindings
8
9description:
10  This binding describes the APCS "global" block found in various Qualcomm
11  platforms.
12
13maintainers:
14  - Jassi Brar <jassisinghbrar@gmail.com>
15
16properties:
17  compatible:
18    oneOf:
19      - items:
20          - enum:
21              - qcom,ipq6018-apcs-apps-global
22              - qcom,ipq8074-apcs-apps-global
23              - qcom,msm8976-apcs-kpss-global
24              - qcom,msm8996-apcs-hmss-global
25              - qcom,msm8998-apcs-hmss-global
26              - qcom,qcm2290-apcs-hmss-global
27              - qcom,sc7180-apss-shared
28              - qcom,sc8180x-apss-shared
29              - qcom,sdm660-apcs-hmss-global
30              - qcom,sdm845-apss-shared
31              - qcom,sm6125-apcs-hmss-global
32              - qcom,sm6115-apcs-hmss-global
33              - qcom,sm8150-apss-shared
34      - items:
35          - enum:
36              - qcom,msm8916-apcs-kpss-global
37              - qcom,msm8939-apcs-kpss-global
38              - qcom,msm8953-apcs-kpss-global
39              - qcom,msm8994-apcs-kpss-global
40              - qcom,qcs404-apcs-apps-global
41          - const: syscon
42  reg:
43    maxItems: 1
44
45  clocks:
46    description: phandles to the parent clocks of the clock driver
47    minItems: 2
48    maxItems: 3
49
50  '#mbox-cells':
51    const: 1
52
53  '#clock-cells':
54    enum: [0, 1]
55
56  clock-names:
57    minItems: 2
58    maxItems: 3
59
60required:
61  - compatible
62  - reg
63  - '#mbox-cells'
64
65additionalProperties: false
66
67allOf:
68  - if:
69      properties:
70        compatible:
71          enum:
72            - qcom,msm8916-apcs-kpss-global
73            - qcom,msm8994-apcs-kpss-global
74            - qcom,msm8996-apcs-hmss-global
75            - qcom,msm8998-apcs-hmss-global
76            - qcom,qcs404-apcs-apps-global
77            - qcom,sc7180-apss-shared
78            - qcom,sdm660-apcs-hmss-global
79            - qcom,sdm845-apss-shared
80            - qcom,sm6125-apcs-hmss-global
81            - qcom,sm8150-apss-shared
82    then:
83      properties:
84        clocks:
85          items:
86            - description: primary pll parent of the clock driver
87            - description: auxiliary parent
88        clock-names:
89          items:
90            - const: pll
91            - const: aux
92  - if:
93      properties:
94        compatible:
95          enum:
96            - qcom,sdx55-apcs-gcc
97    then:
98      properties:
99        clocks:
100          items:
101            - description: primary pll parent of the clock driver
102            - description: auxiliary parent
103            - description: reference clock
104        clock-names:
105          items:
106            - const: pll
107            - const: aux
108            - const: ref
109  - if:
110      properties:
111        compatible:
112          enum:
113            - qcom,ipq6018-apcs-apps-global
114            - qcom,ipq8074-apcs-apps-global
115    then:
116      properties:
117        clocks:
118          items:
119            - description: primary pll parent of the clock driver
120            - description: XO clock
121        clock-names:
122          items:
123            - const: pll
124            - const: xo
125  - if:
126      properties:
127        compatible:
128          enum:
129            - qcom,ipq6018-apcs-apps-global
130            - qcom,ipq8074-apcs-apps-global
131    then:
132      properties:
133        '#clock-cells':
134          const: 1
135    else:
136      properties:
137        '#clock-cells':
138          const: 0
139
140examples:
141
142  # Example apcs with msm8996
143  - |
144    #include <dt-bindings/interrupt-controller/arm-gic.h>
145    apcs_glb: mailbox@9820000 {
146        compatible = "qcom,msm8996-apcs-hmss-global";
147        reg = <0x9820000 0x1000>;
148
149        #mbox-cells = <1>;
150    };
151
152    rpm-glink {
153        compatible = "qcom,glink-rpm";
154        interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
155        qcom,rpm-msg-ram = <&rpm_msg_ram>;
156        mboxes = <&apcs_glb 0>;
157        mbox-names = "rpm_hlos";
158    };
159
160  # Example apcs with qcs404
161  - |
162    #define GCC_APSS_AHB_CLK_SRC  1
163    #define GCC_GPLL0_AO_OUT_MAIN 123
164    apcs: mailbox@b011000 {
165        compatible = "qcom,qcs404-apcs-apps-global", "syscon";
166        reg = <0x0b011000 0x1000>;
167        #mbox-cells = <1>;
168        clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>;
169        clock-names = "pll", "aux";
170        #clock-cells = <0>;
171    };
172