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