xref: /linux/Documentation/devicetree/bindings/net/qcom,ipa.yaml (revision bba2c3615bd6cfee7456d1130f2e6b01b3f4e9ba)
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        items:
132          - description: Phandle to the Shared Memory Point 2 Point device
133              handling the communication with a remote processor
134          - description: Single bit index to toggle in the value sent to
135              the remote processor
136            maximum: 32
137      - description: Whether the IPA clock is enabled (if valid)
138        items:
139          - description: Phandle to the Shared Memory Point 2 Point device
140              handling the communication with a remote processor
141          - description: Single bit index to toggle in the value sent to
142              the remote processor
143            maximum: 32
144
145  qcom,smem-state-names:
146    description: The names of the state bits used for SMP2P output
147    items:
148      - const: ipa-clock-enabled-valid
149      - const: ipa-clock-enabled
150
151  qcom,gsi-loader:
152    enum:
153      - self
154      - modem
155      - skip
156    description:
157      Indicates how GSI firmware should be loaded.  If the AP loads
158      and validates GSI firmware, this property has value "self".
159      If the modem does this, this property has value "modem".
160      Otherwise, "skip" means GSI firmware loading is not required.
161
162  modem-init:
163    deprecated: true
164    type: boolean
165    description:
166      This is the older (deprecated) way of indicating how GSI firmware
167      should be loaded.  If present, the modem loads GSI firmware; if
168      absent, the AP loads GSI firmware.
169
170  memory-region:
171    maxItems: 1
172    description:
173      If present, a phandle for a reserved memory area that holds
174      the firmware passed to Trust Zone for authentication.  Required
175      when the AP (not the modem) performs early initialization.
176
177  firmware-name:
178    maxItems: 1
179    description:
180      If present, name (or relative path) of the file within the
181      firmware search path containing the firmware image used when
182      initializing IPA hardware.  Optional, and only used when
183      Trust Zone performs early initialization.
184
185  sram:
186    maxItems: 1
187    description:
188      A reference to an additional region residing in IMEM (special
189      on-chip SRAM), which is accessed by the IPA firmware and needs
190      to be IOMMU-mapped from the OS.
191
192required:
193  - compatible
194  - iommus
195  - reg
196  - clocks
197  - interrupts
198  - interconnects
199  - qcom,smem-states
200
201allOf:
202  # If qcom,gsi-loader is present, modem-init must not be present
203  - if:
204      required:
205        - qcom,gsi-loader
206    then:
207      properties:
208        modem-init: false
209
210      # If qcom,gsi-loader is "self", the AP loads GSI firmware, and
211      # memory-region must be specified
212      if:
213        properties:
214          qcom,gsi-loader:
215            contains:
216              const: self
217      then:
218        required:
219          - memory-region
220    else:
221      # If qcom,gsi-loader is not present, we use deprecated behavior.
222      # If modem-init is not present, the AP loads GSI firmware, and
223      # memory-region must be specified.
224      if:
225        not:
226          required:
227            - modem-init
228      then:
229        required:
230          - memory-region
231
232additionalProperties: false
233
234examples:
235  - |
236    #include <dt-bindings/interrupt-controller/arm-gic.h>
237    #include <dt-bindings/clock/qcom,rpmh.h>
238    #include <dt-bindings/interconnect/qcom,sdm845.h>
239
240    smp2p-mpss {
241        compatible = "qcom,smp2p";
242        interrupts = <GIC_SPI 576 IRQ_TYPE_EDGE_RISING>;
243        mboxes = <&apss_shared 6>;
244        qcom,smem = <94>, <432>;
245        qcom,local-pid = <0>;
246        qcom,remote-pid = <5>;
247
248        ipa_smp2p_out: ipa-ap-to-modem {
249                qcom,entry-name = "ipa";
250                #qcom,smem-state-cells = <1>;
251        };
252
253        ipa_smp2p_in: ipa-modem-to-ap {
254                qcom,entry-name = "ipa";
255                interrupt-controller;
256                #interrupt-cells = <2>;
257        };
258    };
259
260    ipa@1e40000 {
261        compatible = "qcom,sc7180-ipa";
262
263        qcom,gsi-loader = "self";
264        memory-region = <&ipa_fw_mem>;
265        firmware-name = "qcom/sc7180-trogdor/modem/modem.mbn";
266
267        iommus = <&apps_smmu 0x440 0x0>,
268                 <&apps_smmu 0x442 0x0>;
269        reg = <0x1e40000 0x7000>,
270              <0x1e47000 0x2000>,
271              <0x1e04000 0x2c000>;
272        reg-names = "ipa-reg",
273                    "ipa-shared",
274                    "gsi";
275
276        interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
277                              <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
278                              <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
279                              <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
280        interrupt-names = "ipa",
281                          "gsi",
282                          "ipa-clock-query",
283                          "ipa-setup-ready";
284
285        clocks = <&rpmhcc RPMH_IPA_CLK>;
286        clock-names = "core";
287
288        interconnects =
289                <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>,
290                <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>,
291                <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>;
292        interconnect-names = "memory",
293                             "imem",
294                             "config";
295
296        qcom,qmp = <&aoss_qmp>;
297
298        qcom,smem-states = <&ipa_smp2p_out 0>,
299                           <&ipa_smp2p_out 1>;
300        qcom,smem-state-names = "ipa-clock-enabled-valid",
301                                "ipa-clock-enabled";
302    };
303