xref: /linux/Documentation/devicetree/bindings/net/qcom,ipa.yaml (revision 53597deca0e38c30e6cd4ba2114fa42d2bcd85bb)
1# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/net/qcom,ipa.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm IP Accelerator (IPA)
8
9maintainers:
10  - Alex Elder <elder@kernel.org>
11
12description:
13  This binding describes the Qualcomm IPA.  The IPA is capable of offloading
14  certain network processing tasks (e.g. filtering, routing, and NAT) from
15  the main processor.
16
17  The IPA sits between multiple independent "execution environments,"
18  including the Application Processor (AP) and the modem.  The IPA presents
19  a Generic Software Interface (GSI) to each execution environment.
20  The GSI is an integral part of the IPA, but it is logically isolated
21  and has a distinct interrupt and a separately-defined address space.
22
23  See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt.  See
24  iommu/iommu.txt and iommu/arm,smmu.yaml for more information about SMMU
25  bindings.
26
27  - |
28    --------             ---------
29    |      |             |       |
30    |  AP  +<---.   .----+ Modem |
31    |      +--. |   | .->+       |
32    |      |  | |   | |  |       |
33    --------  | |   | |  ---------
34              v |   v |
35            --+-+---+-+--
36            |    GSI    |
37            |-----------|
38            |           |
39            |    IPA    |
40            |           |
41            -------------
42
43properties:
44  compatible:
45    oneOf:
46      - enum:
47          - qcom,milos-ipa
48          - qcom,msm8998-ipa
49          - qcom,sc7180-ipa
50          - qcom,sc7280-ipa
51          - qcom,sdm845-ipa
52          - qcom,sdx55-ipa
53          - qcom,sdx65-ipa
54          - qcom,sm6350-ipa
55          - qcom,sm8350-ipa
56          - qcom,sm8550-ipa
57      - items:
58          - enum:
59              - qcom,qcm2290-ipa
60          - const: qcom,sc7180-ipa
61      - items:
62          - enum:
63              - qcom,sm8650-ipa
64          - const: qcom,sm8550-ipa
65
66  reg:
67    items:
68      - description: IPA registers
69      - description: IPA shared memory
70      - description: GSI registers
71
72  reg-names:
73    items:
74      - const: ipa-reg
75      - const: ipa-shared
76      - const: gsi
77
78  iommus:
79    minItems: 1
80    maxItems: 2
81
82  clocks:
83    maxItems: 1
84
85  clock-names:
86    const: core
87
88  interrupts:
89    items:
90      - description: IPA interrupt (hardware IRQ)
91      - description: GSI interrupt (hardware IRQ)
92      - description: Modem clock query interrupt (smp2p interrupt)
93      - description: Modem setup ready interrupt (smp2p interrupt)
94
95  interrupt-names:
96    items:
97      - const: ipa
98      - const: gsi
99      - const: ipa-clock-query
100      - const: ipa-setup-ready
101
102  interconnects:
103    oneOf:
104      - items:
105          - description: Path leading to system memory
106          - description: Path between the AP and IPA config space
107      - items:
108          - description: Path leading to system memory
109          - description: Path leading to internal memory
110          - description: Path between the AP and IPA config space
111
112  interconnect-names:
113    oneOf:
114      - items:
115          - const: memory
116          - const: config
117      - items:
118          - const: memory
119          - const: imem
120          - const: config
121
122  qcom,qmp:
123    $ref: /schemas/types.yaml#/definitions/phandle
124    description: phandle to the AOSS side-channel message RAM
125
126  qcom,smem-states:
127    $ref: /schemas/types.yaml#/definitions/phandle-array
128    description: State bits used in by the AP to signal the modem.
129    items:
130      - description: Whether the "ipa-clock-enabled" state bit is valid
131      - description: Whether the IPA clock is enabled (if valid)
132
133  qcom,smem-state-names:
134    description: The names of the state bits used for SMP2P output
135    items:
136      - const: ipa-clock-enabled-valid
137      - const: ipa-clock-enabled
138
139  qcom,gsi-loader:
140    enum:
141      - self
142      - modem
143      - skip
144    description:
145      Indicates how GSI firmware should be loaded.  If the AP loads
146      and validates GSI firmware, this property has value "self".
147      If the modem does this, this property has value "modem".
148      Otherwise, "skip" means GSI firmware loading is not required.
149
150  modem-init:
151    deprecated: true
152    type: boolean
153    description:
154      This is the older (deprecated) way of indicating how GSI firmware
155      should be loaded.  If present, the modem loads GSI firmware; if
156      absent, the AP loads GSI firmware.
157
158  memory-region:
159    maxItems: 1
160    description:
161      If present, a phandle for a reserved memory area that holds
162      the firmware passed to Trust Zone for authentication.  Required
163      when the AP (not the modem) performs early initialization.
164
165  firmware-name:
166    maxItems: 1
167    description:
168      If present, name (or relative path) of the file within the
169      firmware search path containing the firmware image used when
170      initializing IPA hardware.  Optional, and only used when
171      Trust Zone performs early initialization.
172
173  sram:
174    maxItems: 1
175    description:
176      A reference to an additional region residing in IMEM (special
177      on-chip SRAM), which is accessed by the IPA firmware and needs
178      to be IOMMU-mapped from the OS.
179
180required:
181  - compatible
182  - iommus
183  - reg
184  - clocks
185  - interrupts
186  - interconnects
187  - qcom,smem-states
188
189allOf:
190  # If qcom,gsi-loader is present, modem-init must not be present
191  - if:
192      required:
193        - qcom,gsi-loader
194    then:
195      properties:
196        modem-init: false
197
198      # If qcom,gsi-loader is "self", the AP loads GSI firmware, and
199      # memory-region must be specified
200      if:
201        properties:
202          qcom,gsi-loader:
203            contains:
204              const: self
205      then:
206        required:
207          - memory-region
208    else:
209      # If qcom,gsi-loader is not present, we use deprecated behavior.
210      # If modem-init is not present, the AP loads GSI firmware, and
211      # memory-region must be specified.
212      if:
213        not:
214          required:
215            - modem-init
216      then:
217        required:
218          - memory-region
219
220additionalProperties: false
221
222examples:
223  - |
224    #include <dt-bindings/interrupt-controller/arm-gic.h>
225    #include <dt-bindings/clock/qcom,rpmh.h>
226    #include <dt-bindings/interconnect/qcom,sdm845.h>
227
228    smp2p-mpss {
229        compatible = "qcom,smp2p";
230        interrupts = <GIC_SPI 576 IRQ_TYPE_EDGE_RISING>;
231        mboxes = <&apss_shared 6>;
232        qcom,smem = <94>, <432>;
233        qcom,local-pid = <0>;
234        qcom,remote-pid = <5>;
235
236        ipa_smp2p_out: ipa-ap-to-modem {
237                qcom,entry-name = "ipa";
238                #qcom,smem-state-cells = <1>;
239        };
240
241        ipa_smp2p_in: ipa-modem-to-ap {
242                qcom,entry-name = "ipa";
243                interrupt-controller;
244                #interrupt-cells = <2>;
245        };
246    };
247
248    ipa@1e40000 {
249        compatible = "qcom,sc7180-ipa";
250
251        qcom,gsi-loader = "self";
252        memory-region = <&ipa_fw_mem>;
253        firmware-name = "qcom/sc7180-trogdor/modem/modem.mbn";
254
255        iommus = <&apps_smmu 0x440 0x0>,
256                 <&apps_smmu 0x442 0x0>;
257        reg = <0x1e40000 0x7000>,
258              <0x1e47000 0x2000>,
259              <0x1e04000 0x2c000>;
260        reg-names = "ipa-reg",
261                    "ipa-shared",
262                    "gsi";
263
264        interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
265                              <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
266                              <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
267                              <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
268        interrupt-names = "ipa",
269                          "gsi",
270                          "ipa-clock-query",
271                          "ipa-setup-ready";
272
273        clocks = <&rpmhcc RPMH_IPA_CLK>;
274        clock-names = "core";
275
276        interconnects =
277                <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>,
278                <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>,
279                <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>;
280        interconnect-names = "memory",
281                             "imem",
282                             "config";
283
284        qcom,qmp = <&aoss_qmp>;
285
286        qcom,smem-states = <&ipa_smp2p_out 0>,
287                           <&ipa_smp2p_out 1>;
288        qcom,smem-state-names = "ipa-clock-enabled-valid",
289                                "ipa-clock-enabled";
290    };
291