xref: /linux/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml (revision 1aca5ce036e3499336d1a2ace3070f908381c055)
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    items:
62      - const: apr_audio_svc
63
64  qcom,intents:
65    $ref: /schemas/types.yaml#/definitions/uint32-array
66    description:
67      List of (size, amount) pairs describing what intents should be
68      preallocated for this virtual channel. This can be used to tweak the
69      default intents available for the channel to meet expectations of the
70      remote.
71
72  qcom,smd-channels:
73    $ref: /schemas/types.yaml#/definitions/string-array
74    description: Channel name used for the communication
75    items:
76      - const: apr_audio_svc
77
78  '#address-cells':
79    const: 1
80
81  '#size-cells':
82    const: 0
83
84#APR/GPR Services
85patternProperties:
86  "^service@[1-9a-d]$":
87    type: object
88    description:
89      APR/GPR node's client devices use subnodes for desired static port services.
90
91    properties:
92      compatible:
93        enum:
94          - qcom,q6core
95          - qcom,q6asm
96          - qcom,q6afe
97          - qcom,q6adm
98          - qcom,q6apm
99          - qcom,q6prm
100
101      reg:
102        minimum: 1
103        maximum: 13
104        description:
105          APR Service ID
106            3 = DSP Core Service
107            4 = Audio  Front End Service.
108            5 = Voice Stream Manager Service.
109            6 = Voice processing manager.
110            7 = Audio Stream Manager Service.
111            8 = Audio Device Manager Service.
112            9 = Multimode voice manager.
113            10 = Core voice stream.
114            11 = Core voice processor.
115            12 = Ultrasound stream manager.
116            13 = Listen stream manager.
117          GPR Service ID
118            1 = Audio Process Manager Service
119            2 = Proxy Resource Manager Service.
120            3 = AMDB Service.
121            4 = Voice processing manager.
122
123      clock-controller:
124        $ref: /schemas/sound/qcom,q6dsp-lpass-clocks.yaml#
125        description: Qualcomm DSP LPASS clock controller
126        unevaluatedProperties: false
127
128      dais:
129        type: object
130        oneOf:
131          - $ref: /schemas/sound/qcom,q6apm-dai.yaml#
132          - $ref: /schemas/sound/qcom,q6dsp-lpass-ports.yaml#
133          - $ref: /schemas/sound/qcom,q6asm-dais.yaml#
134        unevaluatedProperties: false
135        description: Qualcomm DSP audio ports
136
137      routing:
138        type: object
139        $ref: /schemas/sound/qcom,q6adm-routing.yaml#
140        unevaluatedProperties: false
141        description: Qualcomm DSP LPASS audio routing
142
143      qcom,protection-domain:
144        $ref: /schemas/types.yaml#/definitions/string-array
145        description: protection domain service name and path for apr service
146          possible values are
147          "avs/audio", "msm/adsp/audio_pd".
148          "kernel/elf_loader", "msm/modem/wlan_pd".
149          "tms/servreg", "msm/adsp/audio_pd".
150          "tms/servreg", "msm/modem/wlan_pd".
151          "tms/servreg", "msm/slpi/sensor_pd".
152
153    allOf:
154      - if:
155          properties:
156            compatible:
157              enum:
158                - qcom,q6afe
159        then:
160          properties:
161            dais:
162              properties:
163                compatible:
164                  const: qcom,q6afe-dais
165
166      - if:
167          properties:
168            compatible:
169              enum:
170                - qcom,q6apm
171        then:
172          properties:
173            dais:
174              properties:
175                compatible:
176                  enum:
177                    - qcom,q6apm-dais
178                    - qcom,q6apm-lpass-dais
179
180      - if:
181          properties:
182            compatible:
183              enum:
184                - qcom,q6asm
185        then:
186          properties:
187            dais:
188              properties:
189                compatible:
190                  const: qcom,q6asm-dais
191
192    additionalProperties: false
193
194required:
195  - compatible
196  - qcom,domain
197
198allOf:
199  - if:
200      properties:
201        compatible:
202          enum:
203            - qcom,gpr
204    then:
205      properties:
206        power-domains: false
207
208  - if:
209      required:
210        - qcom,glink-channels
211    then:
212      properties:
213        qcom,smd-channels: false
214
215  - if:
216      required:
217        - qcom,smd-channels
218    then:
219      properties:
220        qcom,glink-channels: false
221
222additionalProperties: false
223
224examples:
225  - |
226    #include <dt-bindings/soc/qcom,apr.h>
227    apr {
228        compatible = "qcom,apr-v2";
229        qcom,domain = <APR_DOMAIN_ADSP>;
230        #address-cells = <1>;
231        #size-cells = <0>;
232
233        q6core: service@3 {
234          compatible = "qcom,q6core";
235          reg = <APR_SVC_ADSP_CORE>;
236          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
237        };
238
239        q6afe: service@4 {
240          compatible = "qcom,q6afe";
241          reg = <APR_SVC_AFE>;
242          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
243        };
244
245        q6asm: service@7 {
246          compatible = "qcom,q6asm";
247          reg = <APR_SVC_ASM>;
248          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
249        };
250
251        q6adm: service@8 {
252          compatible = "qcom,q6adm";
253          reg = <APR_SVC_ADM>;
254          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
255        };
256    };
257
258  - |
259    #include <dt-bindings/soc/qcom,gpr.h>
260    gpr {
261        compatible = "qcom,gpr";
262        qcom,domain = <GPR_DOMAIN_ID_ADSP>;
263        #address-cells = <1>;
264        #size-cells = <0>;
265
266        service@1 {
267          compatible = "qcom,q6apm";
268          reg = <GPR_APM_MODULE_IID>;
269          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
270        };
271    };
272