GNU Linux-libre 5.15.137-gnu
[releases.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,sm8350-ipa
53
54   reg:
55     items:
56       - description: IPA registers
57       - description: IPA shared memory
58       - description: GSI registers
59
60   reg-names:
61     items:
62       - const: ipa-reg
63       - const: ipa-shared
64       - const: gsi
65
66   iommus:
67     maxItems: 1
68
69   clocks:
70     maxItems: 1
71
72   clock-names:
73     const: core
74
75   interrupts:
76     items:
77       - description: IPA interrupt (hardware IRQ)
78       - description: GSI interrupt (hardware IRQ)
79       - description: Modem clock query interrupt (smp2p interrupt)
80       - description: Modem setup ready interrupt (smp2p interrupt)
81
82   interrupt-names:
83     items:
84       - const: ipa
85       - const: gsi
86       - const: ipa-clock-query
87       - const: ipa-setup-ready
88
89   interconnects:
90     oneOf:
91       - items:
92           - description: Path leading to system memory
93           - description: Path between the AP and IPA config space
94       - items:
95           - description: Path leading to system memory
96           - description: Path leading to internal memory
97           - description: Path between the AP and IPA config space
98
99   interconnect-names:
100     oneOf:
101       - items:
102           - const: memory
103           - const: config
104       - items:
105           - const: memory
106           - const: imem
107           - const: config
108
109   qcom,qmp:
110     $ref: /schemas/types.yaml#/definitions/phandle
111     description: phandle to the AOSS side-channel message RAM
112
113   qcom,smem-states:
114     $ref: /schemas/types.yaml#/definitions/phandle-array
115     description: State bits used in by the AP to signal the modem.
116     items:
117       - description: Whether the "ipa-clock-enabled" state bit is valid
118       - description: Whether the IPA clock is enabled (if valid)
119
120   qcom,smem-state-names:
121     description: The names of the state bits used for SMP2P output
122     items:
123       - const: ipa-clock-enabled-valid
124       - const: ipa-clock-enabled
125
126   modem-init:
127     type: boolean
128     description:
129       If present, it indicates that the modem is responsible for
130       performing early IPA initialization, including loading and
131       validating firwmare used by the GSI.
132
133   memory-region:
134     maxItems: 1
135     description:
136       If present, a phandle for a reserved memory area that holds
137       the firmware passed to Trust Zone for authentication.  Required
138       when Trust Zone (not the modem) performs early initialization.
139
140   firmware-name:
141     $ref: /schemas/types.yaml#/definitions/string
142     description:
143       If present, name (or relative path) of the file within the
144       firmware search path containing the firmware image used when
145       initializing IPA hardware.  Optional, and only used when
146       Trust Zone performs early initialization.
147
148 required:
149   - compatible
150   - iommus
151   - reg
152   - clocks
153   - interrupts
154   - interconnects
155   - qcom,smem-states
156
157 # Either modem-init is present, or memory-region must be present.
158 oneOf:
159   - required:
160       - modem-init
161   - required:
162       - memory-region
163
164 # If memory-region is present, firmware-name may optionally be present.
165 # But if modem-init is present, firmware-name must not be present.
166 if:
167   required:
168     - modem-init
169 then:
170   not:
171     required:
172       - firmware-name
173
174 additionalProperties: false
175
176 examples:
177   - |
178         #include <dt-bindings/interrupt-controller/arm-gic.h>
179         #include <dt-bindings/clock/qcom,rpmh.h>
180         #include <dt-bindings/interconnect/qcom,sdm845.h>
181
182         smp2p-mpss {
183                 compatible = "qcom,smp2p";
184                 ipa_smp2p_out: ipa-ap-to-modem {
185                         qcom,entry-name = "ipa";
186                         #qcom,smem-state-cells = <1>;
187                 };
188
189                 ipa_smp2p_in: ipa-modem-to-ap {
190                         qcom,entry-name = "ipa";
191                         interrupt-controller;
192                         #interrupt-cells = <2>;
193                 };
194         };
195         ipa@1e40000 {
196                 compatible = "qcom,sdm845-ipa";
197
198                 modem-init;
199
200                 iommus = <&apps_smmu 0x720 0x3>;
201                 reg = <0x1e40000 0x7000>,
202                         <0x1e47000 0x2000>,
203                         <0x1e04000 0x2c000>;
204                 reg-names = "ipa-reg",
205                             "ipa-shared",
206                             "gsi";
207
208                 interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
209                                       <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
210                                       <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
211                                       <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
212                 interrupt-names = "ipa",
213                                   "gsi",
214                                   "ipa-clock-query",
215                                   "ipa-setup-ready";
216
217                 clocks = <&rpmhcc RPMH_IPA_CLK>;
218                 clock-names = "core";
219
220                 interconnects =
221                         <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_EBI1>,
222                         <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_IMEM>,
223                         <&rsc_hlos MASTER_APPSS_PROC &rsc_hlos SLAVE_IPA_CFG>;
224                 interconnect-names = "memory",
225                                      "imem",
226                                      "config";
227
228                 qcom,qmp = <&aoss_qmp>;
229
230                 qcom,smem-states = <&ipa_smp2p_out 0>,
231                                    <&ipa_smp2p_out 1>;
232                 qcom,smem-state-names = "ipa-clock-enabled-valid",
233                                         "ipa-clock-enabled";
234         };