xref: /linux/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml (revision 0dd3618e06f86bbdacad3a40b25bf79b8917000c)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/soc/qcom/qcom,apr.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: Qualcomm APR/GPR (Asynchronous/Generic Packet Router) binding
8
9maintainers:
10  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11
12description: |
13  This binding describes the Qualcomm APR/GPR, APR/GPR is a IPC protocol for
14  communication between Application processor and QDSP. APR/GPR is mainly
15  used for audio/voice services on the QDSP.
16
17properties:
18  compatible:
19    enum:
20      - qcom,apr-v2
21      - qcom,gpr
22
23  power-domains:
24    maxItems: 1
25
26  qcom,apr-domain:
27    $ref: /schemas/types.yaml#/definitions/uint32
28    enum: [1, 2, 3, 4, 5, 6, 7]
29    description:
30      Selects the processor domain for apr
31        1 = APR simulator
32        2 = PC Domain
33        3 = Modem Domain
34        4 = ADSP Domain
35        5 = Application processor Domain
36        6 = Modem2 Domain
37        7 = Application Processor2 Domain
38    deprecated: true
39
40  qcom,domain:
41    $ref: /schemas/types.yaml#/definitions/uint32
42    minimum: 1
43    maximum: 7
44    description:
45      Selects the processor domain for apr
46        1 = APR simulator
47        2 = PC Domain
48        3 = Modem Domain
49        4 = ADSP Domain
50        5 = Application processor Domain
51        6 = Modem2 Domain
52        7 = Application Processor2 Domain
53      Selects the processor domain for gpr
54        1 = Modem Domain
55        2 = Audio DSP Domain
56        3 = Application Processor Domain
57
58  qcom,glink-channels:
59    $ref: /schemas/types.yaml#/definitions/string-array
60    description: Channel name used for the communication
61    maxItems: 1
62
63  qcom,intents:
64    $ref: /schemas/types.yaml#/definitions/uint32-array
65    description:
66      List of (size, amount) pairs describing what intents should be
67      preallocated for this virtual channel. This can be used to tweak the
68      default intents available for the channel to meet expectations of the
69      remote.
70
71  qcom,smd-channels:
72    $ref: /schemas/types.yaml#/definitions/string-array
73    description: Channel name used for the communication
74    items:
75      - const: apr_audio_svc
76
77  '#address-cells':
78    const: 1
79
80  '#size-cells':
81    const: 0
82
83#APR/GPR Services
84patternProperties:
85  "^service@[1-9a-d]$":
86    type: object
87    description:
88      APR/GPR node's client devices use subnodes for desired static port services.
89
90    properties:
91      compatible:
92        enum:
93          - qcom,q6core
94          - qcom,q6asm
95          - qcom,q6afe
96          - qcom,q6adm
97          - qcom,q6apm
98          - qcom,q6prm
99
100      reg:
101        minimum: 1
102        maximum: 13
103        description:
104          APR Service ID
105            3 = DSP Core Service
106            4 = Audio  Front End Service.
107            5 = Voice Stream Manager Service.
108            6 = Voice processing manager.
109            7 = Audio Stream Manager Service.
110            8 = Audio Device Manager Service.
111            9 = Multimode voice manager.
112            10 = Core voice stream.
113            11 = Core voice processor.
114            12 = Ultrasound stream manager.
115            13 = Listen stream manager.
116          GPR Service ID
117            1 = Audio Process Manager Service
118            2 = Proxy Resource Manager Service.
119            3 = AMDB Service.
120            4 = Voice processing manager.
121
122      clock-controller:
123        $ref: /schemas/sound/qcom,q6dsp-lpass-clocks.yaml#
124        description: Qualcomm DSP LPASS clock controller
125        unevaluatedProperties: false
126
127      dais:
128        type: object
129        oneOf:
130          - $ref: /schemas/sound/qcom,q6apm-dai.yaml#
131          - $ref: /schemas/sound/qcom,q6dsp-lpass-ports.yaml#
132          - $ref: /schemas/sound/qcom,q6asm-dais.yaml#
133        unevaluatedProperties: false
134        description: Qualcomm DSP audio ports
135
136      routing:
137        type: object
138        $ref: /schemas/sound/qcom,q6adm-routing.yaml#
139        unevaluatedProperties: false
140        description: Qualcomm DSP LPASS audio routing
141
142      qcom,protection-domain:
143        $ref: /schemas/types.yaml#/definitions/string-array
144        description: protection domain service name and path for apr service
145          possible values are
146          "avs/audio", "msm/adsp/audio_pd".
147          "kernel/elf_loader", "msm/modem/wlan_pd".
148          "tms/servreg", "msm/adsp/audio_pd".
149          "tms/servreg", "msm/modem/wlan_pd".
150          "tms/servreg", "msm/slpi/sensor_pd".
151
152    allOf:
153      - if:
154          properties:
155            compatible:
156              enum:
157                - qcom,q6afe
158        then:
159          properties:
160            dais:
161              properties:
162                compatible:
163                  const: qcom,q6afe-dais
164
165      - if:
166          properties:
167            compatible:
168              enum:
169                - qcom,q6apm
170        then:
171          properties:
172            dais:
173              properties:
174                compatible:
175                  enum:
176                    - qcom,q6apm-dais
177                    - qcom,q6apm-lpass-dais
178
179      - if:
180          properties:
181            compatible:
182              enum:
183                - qcom,q6asm
184        then:
185          properties:
186            dais:
187              properties:
188                compatible:
189                  const: qcom,q6asm-dais
190
191    additionalProperties: false
192
193required:
194  - compatible
195  - qcom,domain
196
197allOf:
198  - if:
199      properties:
200        compatible:
201          enum:
202            - qcom,gpr
203    then:
204      properties:
205        qcom,glink-channels:
206          items:
207            - const: adsp_apps
208        power-domains: false
209    else:
210      properties:
211        qcom,glink-channels:
212          items:
213            - const: apr_audio_svc
214
215  - if:
216      required:
217        - qcom,glink-channels
218    then:
219      properties:
220        qcom,smd-channels: false
221
222  - if:
223      required:
224        - qcom,smd-channels
225    then:
226      properties:
227        qcom,glink-channels: false
228
229additionalProperties: false
230
231examples:
232  - |
233    #include <dt-bindings/soc/qcom,apr.h>
234    apr {
235        compatible = "qcom,apr-v2";
236        qcom,domain = <APR_DOMAIN_ADSP>;
237        #address-cells = <1>;
238        #size-cells = <0>;
239
240        q6core: service@3 {
241          compatible = "qcom,q6core";
242          reg = <APR_SVC_ADSP_CORE>;
243          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
244        };
245
246        q6afe: service@4 {
247          compatible = "qcom,q6afe";
248          reg = <APR_SVC_AFE>;
249          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
250        };
251
252        q6asm: service@7 {
253          compatible = "qcom,q6asm";
254          reg = <APR_SVC_ASM>;
255          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
256        };
257
258        q6adm: service@8 {
259          compatible = "qcom,q6adm";
260          reg = <APR_SVC_ADM>;
261          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
262        };
263    };
264
265  - |
266    #include <dt-bindings/soc/qcom,gpr.h>
267    gpr {
268        compatible = "qcom,gpr";
269        qcom,domain = <GPR_DOMAIN_ID_ADSP>;
270        #address-cells = <1>;
271        #size-cells = <0>;
272
273        service@1 {
274          compatible = "qcom,q6apm";
275          reg = <GPR_APM_MODULE_IID>;
276          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
277        };
278    };
279