xref: /linux/Documentation/devicetree/bindings/net/qcom,ipa.yaml (revision 2cddfc2e8fc78c13b0f5286ea5dd48cdf527ad41)
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,msm8998-ipa
48          - qcom,sc7180-ipa
49          - qcom,sc7280-ipa
50          - qcom,sdm845-ipa
51          - qcom,sdx55-ipa
52          - qcom,sdx65-ipa
53          - qcom,sm6350-ipa
54          - qcom,sm8350-ipa
55          - qcom,sm8550-ipa
56      - items:
57          - enum:
58              - qcom,sm8650-ipa
59          - const: qcom,sm8550-ipa
60
61  reg:
62    items:
63      - description: IPA registers
64      - description: IPA shared memory
65      - description: GSI registers
66
67  reg-names:
68    items:
69      - const: ipa-reg
70      - const: ipa-shared
71      - const: gsi
72
73  iommus:
74    minItems: 1
75    maxItems: 2
76
77  clocks:
78    maxItems: 1
79
80  clock-names:
81    const: core
82
83  interrupts:
84    items:
85      - description: IPA interrupt (hardware IRQ)
86      - description: GSI interrupt (hardware IRQ)
87      - description: Modem clock query interrupt (smp2p interrupt)
88      - description: Modem setup ready interrupt (smp2p interrupt)
89
90  interrupt-names:
91    items:
92      - const: ipa
93      - const: gsi
94      - const: ipa-clock-query
95      - const: ipa-setup-ready
96
97  interconnects:
98    oneOf:
99      - items:
100          - description: Path leading to system memory
101          - description: Path between the AP and IPA config space
102      - items:
103          - description: Path leading to system memory
104          - description: Path leading to internal memory
105          - description: Path between the AP and IPA config space
106
107  interconnect-names:
108    oneOf:
109      - items:
110          - const: memory
111          - const: config
112      - items:
113          - const: memory
114          - const: imem
115          - const: config
116
117  qcom,qmp:
118    $ref: /schemas/types.yaml#/definitions/phandle
119    description: phandle to the AOSS side-channel message RAM
120
121  qcom,smem-states:
122    $ref: /schemas/types.yaml#/definitions/phandle-array
123    description: State bits used in by the AP to signal the modem.
124    items:
125      - description: Whether the "ipa-clock-enabled" state bit is valid
126      - description: Whether the IPA clock is enabled (if valid)
127
128  qcom,smem-state-names:
129    description: The names of the state bits used for SMP2P output
130    items:
131      - const: ipa-clock-enabled-valid
132      - const: ipa-clock-enabled
133
134  qcom,gsi-loader:
135    enum:
136      - self
137      - modem
138      - skip
139    description:
140      Indicates how GSI firmware should be loaded.  If the AP loads
141      and validates GSI firmware, this property has value "self".
142      If the modem does this, this property has value "modem".
143      Otherwise, "skip" means GSI firmware loading is not required.
144
145  modem-init:
146    deprecated: true
147    type: boolean
148    description:
149      This is the older (deprecated) way of indicating how GSI firmware
150      should be loaded.  If present, the modem loads GSI firmware; if
151      absent, the AP loads GSI firmware.
152
153  memory-region:
154    maxItems: 1
155    description:
156      If present, a phandle for a reserved memory area that holds
157      the firmware passed to Trust Zone for authentication.  Required
158      when the AP (not the modem) performs early initialization.
159
160  firmware-name:
161    maxItems: 1
162    description:
163      If present, name (or relative path) of the file within the
164      firmware search path containing the firmware image used when
165      initializing IPA hardware.  Optional, and only used when
166      Trust Zone performs early initialization.
167
168required:
169  - compatible
170  - iommus
171  - reg
172  - clocks
173  - interrupts
174  - interconnects
175  - qcom,smem-states
176
177allOf:
178  # If qcom,gsi-loader is present, modem-init must not be present
179  - if:
180      required:
181        - qcom,gsi-loader
182    then:
183      properties:
184        modem-init: false
185
186      # If qcom,gsi-loader is "self", the AP loads GSI firmware, and
187      # memory-region must be specified
188      if:
189        properties:
190          qcom,gsi-loader:
191            contains:
192              const: self
193      then:
194        required:
195          - memory-region
196    else:
197      # If qcom,gsi-loader is not present, we use deprecated behavior.
198      # If modem-init is not present, the AP loads GSI firmware, and
199      # memory-region must be specified.
200      if:
201        not:
202          required:
203            - modem-init
204      then:
205        required:
206          - memory-region
207
208additionalProperties: false
209
210examples:
211  - |
212    #include <dt-bindings/interrupt-controller/arm-gic.h>
213    #include <dt-bindings/clock/qcom,rpmh.h>
214    #include <dt-bindings/interconnect/qcom,sdm845.h>
215
216    smp2p-mpss {
217        compatible = "qcom,smp2p";
218        interrupts = <GIC_SPI 576 IRQ_TYPE_EDGE_RISING>;
219        mboxes = <&apss_shared 6>;
220        qcom,smem = <94>, <432>;
221        qcom,local-pid = <0>;
222        qcom,remote-pid = <5>;
223
224        ipa_smp2p_out: ipa-ap-to-modem {
225                qcom,entry-name = "ipa";
226                #qcom,smem-state-cells = <1>;
227        };
228
229        ipa_smp2p_in: ipa-modem-to-ap {
230                qcom,entry-name = "ipa";
231                interrupt-controller;
232                #interrupt-cells = <2>;
233        };
234    };
235
236    ipa@1e40000 {
237        compatible = "qcom,sc7180-ipa";
238
239        qcom,gsi-loader = "self";
240        memory-region = <&ipa_fw_mem>;
241        firmware-name = "qcom/sc7180-trogdor/modem/modem.mbn";
242
243        iommus = <&apps_smmu 0x440 0x0>,
244                 <&apps_smmu 0x442 0x0>;
245        reg = <0x1e40000 0x7000>,
246              <0x1e47000 0x2000>,
247              <0x1e04000 0x2c000>;
248        reg-names = "ipa-reg",
249                    "ipa-shared",
250                    "gsi";
251
252        interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
253                              <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
254                              <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
255                              <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
256        interrupt-names = "ipa",
257                          "gsi",
258                          "ipa-clock-query",
259                          "ipa-setup-ready";
260
261        clocks = <&rpmhcc RPMH_IPA_CLK>;
262        clock-names = "core";
263
264        interconnects =
265                <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>,
266                <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>,
267                <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>;
268        interconnect-names = "memory",
269                             "imem",
270                             "config";
271
272        qcom,qmp = <&aoss_qmp>;
273
274        qcom,smem-states = <&ipa_smp2p_out 0>,
275                           <&ipa_smp2p_out 1>;
276        qcom,smem-state-names = "ipa-clock-enabled-valid",
277                                "ipa-clock-enabled";
278    };
279