xref: /linux/Documentation/devicetree/bindings/net/qcom,ipa.yaml (revision 3f74d5bb807ee500cb68f167df7dc4e4252a42ec)
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
168  sram:
169    maxItems: 1
170    description:
171      A reference to an additional region residing in IMEM (special
172      on-chip SRAM), which is accessed by the IPA firmware and needs
173      to be IOMMU-mapped from the OS.
174
175required:
176  - compatible
177  - iommus
178  - reg
179  - clocks
180  - interrupts
181  - interconnects
182  - qcom,smem-states
183
184allOf:
185  # If qcom,gsi-loader is present, modem-init must not be present
186  - if:
187      required:
188        - qcom,gsi-loader
189    then:
190      properties:
191        modem-init: false
192
193      # If qcom,gsi-loader is "self", the AP loads GSI firmware, and
194      # memory-region must be specified
195      if:
196        properties:
197          qcom,gsi-loader:
198            contains:
199              const: self
200      then:
201        required:
202          - memory-region
203    else:
204      # If qcom,gsi-loader is not present, we use deprecated behavior.
205      # If modem-init is not present, the AP loads GSI firmware, and
206      # memory-region must be specified.
207      if:
208        not:
209          required:
210            - modem-init
211      then:
212        required:
213          - memory-region
214
215additionalProperties: false
216
217examples:
218  - |
219    #include <dt-bindings/interrupt-controller/arm-gic.h>
220    #include <dt-bindings/clock/qcom,rpmh.h>
221    #include <dt-bindings/interconnect/qcom,sdm845.h>
222
223    smp2p-mpss {
224        compatible = "qcom,smp2p";
225        interrupts = <GIC_SPI 576 IRQ_TYPE_EDGE_RISING>;
226        mboxes = <&apss_shared 6>;
227        qcom,smem = <94>, <432>;
228        qcom,local-pid = <0>;
229        qcom,remote-pid = <5>;
230
231        ipa_smp2p_out: ipa-ap-to-modem {
232                qcom,entry-name = "ipa";
233                #qcom,smem-state-cells = <1>;
234        };
235
236        ipa_smp2p_in: ipa-modem-to-ap {
237                qcom,entry-name = "ipa";
238                interrupt-controller;
239                #interrupt-cells = <2>;
240        };
241    };
242
243    ipa@1e40000 {
244        compatible = "qcom,sc7180-ipa";
245
246        qcom,gsi-loader = "self";
247        memory-region = <&ipa_fw_mem>;
248        firmware-name = "qcom/sc7180-trogdor/modem/modem.mbn";
249
250        iommus = <&apps_smmu 0x440 0x0>,
251                 <&apps_smmu 0x442 0x0>;
252        reg = <0x1e40000 0x7000>,
253              <0x1e47000 0x2000>,
254              <0x1e04000 0x2c000>;
255        reg-names = "ipa-reg",
256                    "ipa-shared",
257                    "gsi";
258
259        interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
260                              <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
261                              <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
262                              <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
263        interrupt-names = "ipa",
264                          "gsi",
265                          "ipa-clock-query",
266                          "ipa-setup-ready";
267
268        clocks = <&rpmhcc RPMH_IPA_CLK>;
269        clock-names = "core";
270
271        interconnects =
272                <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>,
273                <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>,
274                <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>;
275        interconnect-names = "memory",
276                             "imem",
277                             "config";
278
279        qcom,qmp = <&aoss_qmp>;
280
281        qcom,smem-states = <&ipa_smp2p_out 0>,
282                           <&ipa_smp2p_out 1>;
283        qcom,smem-state-names = "ipa-clock-enabled-valid",
284                                "ipa-clock-enabled";
285    };
286