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