blob: b86edf67ce626abe07e0cb124c2bd38828412550 [file] [log] [blame]
Alex Elderfc39c402020-03-05 22:28:16 -06001# 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
Alex Elder8456c542020-05-04 12:58:56 -050023 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
Alex Elderfc39c402020-03-05 22:28:16 -060027
28 - |
29 -------- ---------
30 | | | |
31 | AP +<---. .----+ Modem |
32 | +--. | | .->+ |
33 | | | | | | | |
34 -------- | | | | ---------
35 v | v |
36 --+-+---+-+--
37 | GSI |
38 |-----------|
39 | |
40 | IPA |
41 | |
42 -------------
43
44properties:
45 compatible:
Alex Elder15c88e12021-04-13 11:38:25 -050046 enum:
Alex Elder2afd6c82021-06-21 12:56:22 -050047 - qcom,msm8998-ipa
Alex Elder15c88e12021-04-13 11:38:25 -050048 - qcom,sc7180-ipa
49 - qcom,sc7280-ipa
50 - qcom,sdm845-ipa
51 - qcom,sdx55-ipa
52 - qcom,sm8350-ipa
Alex Elderfc39c402020-03-05 22:28:16 -060053
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
Alex Elder8456c542020-05-04 12:58:56 -050066 iommus:
David Heidelberg950d5662021-10-26 18:32:40 +020067 minItems: 1
68 maxItems: 2
Alex Elder8456c542020-05-04 12:58:56 -050069
Alex Elderfc39c402020-03-05 22:28:16 -060070 clocks:
71 maxItems: 1
72
73 clock-names:
Rob Herringf516fb72020-04-20 21:24:47 -050074 const: core
Alex Elderfc39c402020-03-05 22:28:16 -060075
76 interrupts:
77 items:
78 - description: IPA interrupt (hardware IRQ)
79 - description: GSI interrupt (hardware IRQ)
80 - description: Modem clock query interrupt (smp2p interrupt)
81 - description: Modem setup ready interrupt (smp2p interrupt)
82
83 interrupt-names:
84 items:
85 - const: ipa
86 - const: gsi
87 - const: ipa-clock-query
88 - const: ipa-setup-ready
89
90 interconnects:
Alex Elderb769cf42021-08-11 09:18:02 -050091 oneOf:
92 - items:
93 - description: Path leading to system memory
94 - description: Path between the AP and IPA config space
95 - items:
96 - description: Path leading to system memory
97 - description: Path leading to internal memory
98 - description: Path between the AP and IPA config space
Alex Elderfc39c402020-03-05 22:28:16 -060099
100 interconnect-names:
Alex Elderb769cf42021-08-11 09:18:02 -0500101 oneOf:
102 - items:
103 - const: memory
104 - const: config
105 - items:
106 - const: memory
107 - const: imem
108 - const: config
Alex Elderfc39c402020-03-05 22:28:16 -0600109
110 qcom,smem-states:
Rob Herring3d21a462020-04-15 19:55:49 -0500111 $ref: /schemas/types.yaml#/definitions/phandle-array
Alex Elderfc39c402020-03-05 22:28:16 -0600112 description: State bits used in by the AP to signal the modem.
113 items:
Rob Herringf516fb72020-04-20 21:24:47 -0500114 - description: Whether the "ipa-clock-enabled" state bit is valid
115 - description: Whether the IPA clock is enabled (if valid)
Alex Elderfc39c402020-03-05 22:28:16 -0600116
117 qcom,smem-state-names:
Alex Elderfc39c402020-03-05 22:28:16 -0600118 description: The names of the state bits used for SMP2P output
119 items:
120 - const: ipa-clock-enabled-valid
121 - const: ipa-clock-enabled
122
123 modem-init:
124 type: boolean
125 description:
126 If present, it indicates that the modem is responsible for
127 performing early IPA initialization, including loading and
128 validating firwmare used by the GSI.
129
Alex Elderfc39c402020-03-05 22:28:16 -0600130 memory-region:
Alex Elderfc39c402020-03-05 22:28:16 -0600131 maxItems: 1
132 description:
133 If present, a phandle for a reserved memory area that holds
134 the firmware passed to Trust Zone for authentication. Required
135 when Trust Zone (not the modem) performs early initialization.
136
Alex Elderd8604b22021-04-16 08:08:49 -0500137 firmware-name:
138 $ref: /schemas/types.yaml#/definitions/string
139 description:
140 If present, name (or relative path) of the file within the
141 firmware search path containing the firmware image used when
142 initializing IPA hardware. Optional, and only used when
143 Trust Zone performs early initialization.
144
Alex Elderfc39c402020-03-05 22:28:16 -0600145required:
146 - compatible
Alex Elder8456c542020-05-04 12:58:56 -0500147 - iommus
Alex Elderfc39c402020-03-05 22:28:16 -0600148 - reg
149 - clocks
150 - interrupts
151 - interconnects
152 - qcom,smem-states
Alex Elderfc39c402020-03-05 22:28:16 -0600153
Alex Elderd8604b22021-04-16 08:08:49 -0500154# Either modem-init is present, or memory-region must be present.
Alex Elderfc39c402020-03-05 22:28:16 -0600155oneOf:
156 - required:
Rob Herringf516fb72020-04-20 21:24:47 -0500157 - modem-init
Alex Elderfc39c402020-03-05 22:28:16 -0600158 - required:
Rob Herringf516fb72020-04-20 21:24:47 -0500159 - memory-region
Alex Elderfc39c402020-03-05 22:28:16 -0600160
Alex Elderd8604b22021-04-16 08:08:49 -0500161# If memory-region is present, firmware-name may optionally be present.
162# But if modem-init is present, firmware-name must not be present.
163if:
164 required:
165 - modem-init
166then:
167 not:
168 required:
169 - firmware-name
170
Rob Herring5be478f2020-10-02 18:41:43 -0500171additionalProperties: false
172
Alex Elderfc39c402020-03-05 22:28:16 -0600173examples:
174 - |
Alex Elder27bb36e2021-01-20 15:26:04 -0600175 #include <dt-bindings/interrupt-controller/arm-gic.h>
Alex Eldere6e0f092020-03-11 16:47:00 -0500176 #include <dt-bindings/clock/qcom,rpmh.h>
177 #include <dt-bindings/interconnect/qcom,sdm845.h>
178
Alex Elderfc39c402020-03-05 22:28:16 -0600179 smp2p-mpss {
180 compatible = "qcom,smp2p";
181 ipa_smp2p_out: ipa-ap-to-modem {
182 qcom,entry-name = "ipa";
183 #qcom,smem-state-cells = <1>;
184 };
185
186 ipa_smp2p_in: ipa-modem-to-ap {
187 qcom,entry-name = "ipa";
188 interrupt-controller;
189 #interrupt-cells = <2>;
190 };
191 };
192 ipa@1e40000 {
193 compatible = "qcom,sdm845-ipa";
194
195 modem-init;
Alex Elderfc39c402020-03-05 22:28:16 -0600196
Alex Elder8456c542020-05-04 12:58:56 -0500197 iommus = <&apps_smmu 0x720 0x3>;
Rob Herringfba56182020-05-12 15:45:43 -0500198 reg = <0x1e40000 0x7000>,
199 <0x1e47000 0x2000>,
200 <0x1e04000 0x2c000>;
Alex Elderfc39c402020-03-05 22:28:16 -0600201 reg-names = "ipa-reg",
Alex Eldere6e0f092020-03-11 16:47:00 -0500202 "ipa-shared",
203 "gsi";
Alex Elderfc39c402020-03-05 22:28:16 -0600204
Alex Elder27bb36e2021-01-20 15:26:04 -0600205 interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
206 <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
Alex Eldere6e0f092020-03-11 16:47:00 -0500207 <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
208 <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
Alex Elderfc39c402020-03-05 22:28:16 -0600209 interrupt-names = "ipa",
Alex Eldere6e0f092020-03-11 16:47:00 -0500210 "gsi",
211 "ipa-clock-query",
212 "ipa-setup-ready";
Alex Elderfc39c402020-03-05 22:28:16 -0600213
214 clocks = <&rpmhcc RPMH_IPA_CLK>;
215 clock-names = "core";
216
217 interconnects =
218 <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_EBI1>,
Alex Eldera0221a02021-08-02 18:30:19 -0500219 <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_IMEM>,
220 <&rsc_hlos MASTER_APPSS_PROC &rsc_hlos SLAVE_IPA_CFG>;
Alex Elderfc39c402020-03-05 22:28:16 -0600221 interconnect-names = "memory",
Alex Eldera0221a02021-08-02 18:30:19 -0500222 "imem",
223 "config";
Alex Elderfc39c402020-03-05 22:28:16 -0600224
225 qcom,smem-states = <&ipa_smp2p_out 0>,
Alex Eldere6e0f092020-03-11 16:47:00 -0500226 <&ipa_smp2p_out 1>;
Alex Elderfc39c402020-03-05 22:28:16 -0600227 qcom,smem-state-names = "ipa-clock-enabled-valid",
228 "ipa-clock-enabled";
229 };