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