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