119370Spst# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
219370Spst%YAML 1.2
319370Spst---
419370Spst$id: http://devicetree.org/schemas/mailbox/qcom,apcs-kpss-global.yaml#
519370Spst$schema: http://devicetree.org/meta-schemas/core.yaml#
619370Spst
746283Sdfrtitle: Qualcomm APCS global block
819370Spst
919370Spstdescription:
1019370Spst  This binding describes the APCS "global" block found in various Qualcomm
1119370Spst  platforms.
1219370Spst
1319370Spstmaintainers:
1419370Spst  - Jassi Brar <jassisinghbrar@gmail.com>
1519370Spst
1619370Spstproperties:
1719370Spst  compatible:
1819370Spst    oneOf:
1919370Spst      - items:
2019370Spst          - enum:
2119370Spst              - qcom,ipq5018-apcs-apps-global
2246283Sdfr              - qcom,ipq5332-apcs-apps-global
2319370Spst              - qcom,ipq8074-apcs-apps-global
2419370Spst              - qcom,ipq9574-apcs-apps-global
2519370Spst          - const: qcom,ipq6018-apcs-apps-global
2619370Spst      - items:
2719370Spst          - enum:
2819370Spst              - qcom,qcs404-apcs-apps-global
2919370Spst          - const: qcom,msm8916-apcs-kpss-global
3019370Spst          - const: syscon
3119370Spst      - items:
3219370Spst          - enum:
3346283Sdfr              - qcom,msm8976-apcs-kpss-global
3419370Spst          - const: qcom,msm8994-apcs-kpss-global
3519370Spst          - const: syscon
3619370Spst      - items:
3719370Spst          - enum:
3819370Spst              - qcom,msm8998-apcs-hmss-global
3946283Sdfr              - qcom,sdm660-apcs-hmss-global
4019370Spst              - qcom,sm4250-apcs-hmss-global
4119370Spst              - qcom,sm6115-apcs-hmss-global
4219370Spst              - qcom,sm6125-apcs-hmss-global
4319370Spst          - const: qcom,msm8994-apcs-kpss-global
4419370Spst      - items:
4519370Spst          - enum:
4646283Sdfr              - qcom,sc7180-apss-shared
4746283Sdfr              - qcom,sc8180x-apss-shared
48              - qcom,sm8150-apss-shared
49          - const: qcom,sdm845-apss-shared
50      - items:
51          - enum:
52              - qcom,msm8916-apcs-kpss-global
53              - qcom,msm8939-apcs-kpss-global
54              - qcom,msm8953-apcs-kpss-global
55              - qcom,msm8994-apcs-kpss-global
56              - qcom,sdx55-apcs-gcc
57          - const: syscon
58      - enum:
59          - qcom,ipq6018-apcs-apps-global
60          - qcom,msm8996-apcs-hmss-global
61          - qcom,qcm2290-apcs-hmss-global
62          - qcom,sdm845-apss-shared
63
64  reg:
65    maxItems: 1
66
67  clocks:
68    description: phandles to the parent clocks of the clock driver
69    minItems: 2
70    maxItems: 3
71
72  '#mbox-cells':
73    const: 1
74
75  '#clock-cells':
76    enum: [0, 1]
77
78  clock-names:
79    minItems: 2
80    maxItems: 3
81
82required:
83  - compatible
84  - reg
85  - '#mbox-cells'
86
87additionalProperties: false
88
89allOf:
90  - if:
91      properties:
92        compatible:
93          contains:
94            enum:
95              - qcom,msm8916-apcs-kpss-global
96    then:
97      properties:
98        clocks:
99          items:
100            - description: primary pll parent of the clock driver
101            - description: auxiliary parent
102        clock-names:
103          items:
104            - const: pll
105            - const: aux
106
107  - if:
108      properties:
109        compatible:
110          contains:
111            enum:
112              - qcom,msm8939-apcs-kpss-global
113    then:
114      properties:
115        clocks:
116          items:
117            - description: primary pll parent of the clock driver
118            - description: auxiliary parent
119            - description: reference clock
120        clock-names:
121          items:
122            - const: pll
123            - const: aux
124            - const: ref
125
126  - if:
127      properties:
128        compatible:
129          contains:
130            enum:
131              - qcom,sdx55-apcs-gcc
132    then:
133      properties:
134        clocks:
135          items:
136            - description: reference clock
137            - description: primary pll parent of the clock driver
138            - description: auxiliary parent
139        clock-names:
140          items:
141            - const: ref
142            - const: pll
143            - const: aux
144
145  - if:
146      properties:
147        compatible:
148          contains:
149            enum:
150              - qcom,ipq6018-apcs-apps-global
151    then:
152      properties:
153        clocks:
154          items:
155            - description: primary pll parent of the clock driver
156            - description: XO clock
157            - description: GCC GPLL0 clock source
158        clock-names:
159          items:
160            - const: pll
161            - const: xo
162            - const: gpll0
163
164  - if:
165      properties:
166        compatible:
167          enum:
168            - qcom,msm8953-apcs-kpss-global
169            - qcom,msm8994-apcs-kpss-global
170            - qcom,msm8996-apcs-hmss-global
171            - qcom,qcm2290-apcs-hmss-global
172            - qcom,sdm845-apss-shared
173    then:
174      properties:
175        clocks: false
176        clock-names: false
177
178  - if:
179      properties:
180        compatible:
181          contains:
182            enum:
183              - qcom,ipq6018-apcs-apps-global
184    then:
185      properties:
186        '#clock-cells':
187          const: 1
188    else:
189      properties:
190        '#clock-cells':
191          const: 0
192
193examples:
194
195  # Example apcs with msm8996
196  - |
197    #include <dt-bindings/interrupt-controller/arm-gic.h>
198    apcs_glb: mailbox@9820000 {
199        compatible = "qcom,msm8996-apcs-hmss-global";
200        reg = <0x9820000 0x1000>;
201
202        #mbox-cells = <1>;
203        #clock-cells = <0>;
204    };
205
206    rpm-glink {
207        compatible = "qcom,glink-rpm";
208        interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
209        qcom,rpm-msg-ram = <&rpm_msg_ram>;
210        mboxes = <&apcs_glb 0>;
211    };
212
213  # Example apcs with qcs404
214  - |
215    #define GCC_APSS_AHB_CLK_SRC  1
216    #define GCC_GPLL0_AO_OUT_MAIN 123
217    apcs: mailbox@b011000 {
218        compatible = "qcom,qcs404-apcs-apps-global",
219                     "qcom,msm8916-apcs-kpss-global", "syscon";
220        reg = <0x0b011000 0x1000>;
221        #mbox-cells = <1>;
222        clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>;
223        clock-names = "pll", "aux";
224        #clock-cells = <0>;
225    };
226