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
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,ipq5018-apcs-apps-global
22              - qcom,ipq5332-apcs-apps-global
23              - qcom,ipq5424-apcs-apps-global
24              - qcom,ipq8074-apcs-apps-global
25              - qcom,ipq9574-apcs-apps-global
26          - const: qcom,ipq6018-apcs-apps-global
27      - items:
28          - enum:
29              - qcom,msm8226-apcs-kpss-global
30              - qcom,qcs404-apcs-apps-global
31          - const: qcom,msm8916-apcs-kpss-global
32          - const: syscon
33      - items:
34          - enum:
35              - qcom,msm8974-apcs-kpss-global
36              - qcom,msm8976-apcs-kpss-global
37          - const: qcom,msm8994-apcs-kpss-global
38          - const: syscon
39      - items:
40          - enum:
41              - qcom,msm8998-apcs-hmss-global
42              - qcom,sdm660-apcs-hmss-global
43              - qcom,sm4250-apcs-hmss-global
44              - qcom,sm6115-apcs-hmss-global
45              - qcom,sm6125-apcs-hmss-global
46          - const: qcom,msm8994-apcs-kpss-global
47      - items:
48          - enum:
49              - qcom,qcs615-apss-shared
50              - qcom,sc7180-apss-shared
51              - qcom,sc8180x-apss-shared
52              - qcom,sm8150-apss-shared
53          - const: qcom,sdm845-apss-shared
54      - items:
55          - enum:
56              - qcom,msm8916-apcs-kpss-global
57              - qcom,msm8939-apcs-kpss-global
58              - qcom,msm8953-apcs-kpss-global
59              - qcom,msm8994-apcs-kpss-global
60              - qcom,sdx55-apcs-gcc
61          - const: syscon
62      - enum:
63          - qcom,ipq6018-apcs-apps-global
64          - qcom,msm8996-apcs-hmss-global
65          - qcom,qcm2290-apcs-hmss-global
66          - qcom,sdm845-apss-shared
67
68  reg:
69    maxItems: 1
70
71  clocks:
72    description: phandles to the parent clocks of the clock driver
73    minItems: 2
74    maxItems: 3
75
76  '#mbox-cells':
77    const: 1
78
79  '#clock-cells':
80    enum: [0, 1]
81
82  clock-names:
83    minItems: 2
84    maxItems: 3
85
86required:
87  - compatible
88  - reg
89  - '#mbox-cells'
90
91additionalProperties: false
92
93allOf:
94  - if:
95      properties:
96        compatible:
97          contains:
98            enum:
99              - qcom,msm8916-apcs-kpss-global
100    then:
101      properties:
102        clocks:
103          items:
104            - description: primary pll parent of the clock driver
105            - description: auxiliary parent
106        clock-names:
107          items:
108            - const: pll
109            - const: aux
110
111  - if:
112      properties:
113        compatible:
114          contains:
115            enum:
116              - qcom,msm8939-apcs-kpss-global
117    then:
118      properties:
119        clocks:
120          items:
121            - description: primary pll parent of the clock driver
122            - description: auxiliary parent
123            - description: reference clock
124        clock-names:
125          items:
126            - const: pll
127            - const: aux
128            - const: ref
129
130  - if:
131      properties:
132        compatible:
133          contains:
134            enum:
135              - qcom,sdx55-apcs-gcc
136    then:
137      properties:
138        clocks:
139          items:
140            - description: reference clock
141            - description: primary pll parent of the clock driver
142            - description: auxiliary parent
143        clock-names:
144          items:
145            - const: ref
146            - const: pll
147            - const: aux
148
149  - if:
150      properties:
151        compatible:
152          contains:
153            enum:
154              - qcom,ipq6018-apcs-apps-global
155    then:
156      properties:
157        clocks:
158          items:
159            - description: primary pll parent of the clock driver
160            - description: XO clock
161            - description: GCC GPLL0 clock source
162        clock-names:
163          items:
164            - const: pll
165            - const: xo
166            - const: gpll0
167
168  - if:
169      properties:
170        compatible:
171          contains:
172            enum:
173              - qcom,msm8953-apcs-kpss-global
174              - qcom,msm8994-apcs-kpss-global
175              - qcom,msm8996-apcs-hmss-global
176              - qcom,qcm2290-apcs-hmss-global
177              - qcom,sdm845-apss-shared
178    then:
179      properties:
180        clocks: false
181        clock-names: false
182
183  - if:
184      properties:
185        compatible:
186          contains:
187            enum:
188              - qcom,ipq6018-apcs-apps-global
189    then:
190      properties:
191        '#clock-cells':
192          const: 1
193    else:
194      properties:
195        '#clock-cells':
196          const: 0
197
198examples:
199
200  # Example apcs with msm8996
201  - |
202    #include <dt-bindings/interrupt-controller/arm-gic.h>
203    apcs_glb: mailbox@9820000 {
204        compatible = "qcom,msm8996-apcs-hmss-global";
205        reg = <0x9820000 0x1000>;
206
207        #mbox-cells = <1>;
208        #clock-cells = <0>;
209    };
210
211    rpm-glink {
212        compatible = "qcom,glink-rpm";
213        interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
214        qcom,rpm-msg-ram = <&rpm_msg_ram>;
215        mboxes = <&apcs_glb 0>;
216    };
217
218  # Example apcs with qcs404
219  - |
220    #define GCC_APSS_AHB_CLK_SRC  1
221    #define GCC_GPLL0_AO_OUT_MAIN 123
222    apcs: mailbox@b011000 {
223        compatible = "qcom,qcs404-apcs-apps-global",
224                     "qcom,msm8916-apcs-kpss-global", "syscon";
225        reg = <0x0b011000 0x1000>;
226        #mbox-cells = <1>;
227        clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>;
228        clock-names = "pll", "aux";
229        #clock-cells = <0>;
230    };
231