summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/qcom,ipa.yaml
blob: 53cae71d99572c65da90bf3ca9df1de9ede4b4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/qcom,ipa.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm IP Accelerator (IPA)

maintainers:
  - Alex Elder <elder@kernel.org>

description:
  This binding describes the Qualcomm IPA.  The IPA is capable of offloading
  certain network processing tasks (e.g. filtering, routing, and NAT) from
  the main processor.

  The IPA sits between multiple independent "execution environments,"
  including the Application Processor (AP) and the modem.  The IPA presents
  a Generic Software Interface (GSI) to each execution environment.
  The GSI is an integral part of the IPA, but it is logically isolated
  and has a distinct interrupt and a separately-defined address space.

  See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt.  See
  iommu/iommu.txt and iommu/arm,smmu.yaml for more information about SMMU
  bindings.


  - |
    --------             ---------
    |      |             |       |
    |  AP  +<---.   .----+ Modem |
    |      +--. |   | .->+       |
    |      |  | |   | |  |       |
    --------  | |   | |  ---------
              v |   v |
            --+-+---+-+--
            |    GSI    |
            |-----------|
            |           |
            |    IPA    |
            |           |
            -------------

properties:
  compatible:
    oneOf:
      - enum:
          - qcom,msm8998-ipa
          - qcom,sc7180-ipa
          - qcom,sc7280-ipa
          - qcom,sdm845-ipa
          - qcom,sdx55-ipa
          - qcom,sdx65-ipa
          - qcom,sm6350-ipa
          - qcom,sm8350-ipa
          - qcom,sm8550-ipa
      - items:
          - enum:
              - qcom,sm8650-ipa
          - const: qcom,sm8550-ipa

  reg:
    items:
      - description: IPA registers
      - description: IPA shared memory
      - description: GSI registers

  reg-names:
    items:
      - const: ipa-reg
      - const: ipa-shared
      - const: gsi

  iommus:
    minItems: 1
    maxItems: 2

  clocks:
    maxItems: 1

  clock-names:
    const: core

  interrupts:
    items:
      - description: IPA interrupt (hardware IRQ)
      - description: GSI interrupt (hardware IRQ)
      - description: Modem clock query interrupt (smp2p interrupt)
      - description: Modem setup ready interrupt (smp2p interrupt)

  interrupt-names:
    items:
      - const: ipa
      - const: gsi
      - const: ipa-clock-query
      - const: ipa-setup-ready

  interconnects:
    oneOf:
      - items:
          - description: Path leading to system memory
          - description: Path between the AP and IPA config space
      - items:
          - description: Path leading to system memory
          - description: Path leading to internal memory
          - description: Path between the AP and IPA config space

  interconnect-names:
    oneOf:
      - items:
          - const: memory
          - const: config
      - items:
          - const: memory
          - const: imem
          - const: config

  qcom,qmp:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to the AOSS side-channel message RAM

  qcom,smem-states:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    description: State bits used in by the AP to signal the modem.
    items:
      - description: Whether the "ipa-clock-enabled" state bit is valid
      - description: Whether the IPA clock is enabled (if valid)

  qcom,smem-state-names:
    description: The names of the state bits used for SMP2P output
    items:
      - const: ipa-clock-enabled-valid
      - const: ipa-clock-enabled

  qcom,gsi-loader:
    enum:
      - self
      - modem
      - skip
    description:
      Indicates how GSI firmware should be loaded.  If the AP loads
      and validates GSI firmware, this property has value "self".
      If the modem does this, this property has value "modem".
      Otherwise, "skip" means GSI firmware loading is not required.

  modem-init:
    deprecated: true
    type: boolean
    description:
      This is the older (deprecated) way of indicating how GSI firmware
      should be loaded.  If present, the modem loads GSI firmware; if
      absent, the AP loads GSI firmware.

  memory-region:
    maxItems: 1
    description:
      If present, a phandle for a reserved memory area that holds
      the firmware passed to Trust Zone for authentication.  Required
      when the AP (not the modem) performs early initialization.

  firmware-name:
    maxItems: 1
    description:
      If present, name (or relative path) of the file within the
      firmware search path containing the firmware image used when
      initializing IPA hardware.  Optional, and only used when
      Trust Zone performs early initialization.

required:
  - compatible
  - iommus
  - reg
  - clocks
  - interrupts
  - interconnects
  - qcom,smem-states

allOf:
  # If qcom,gsi-loader is present, modem-init must not be present
  - if:
      required:
        - qcom,gsi-loader
    then:
      properties:
        modem-init: false

      # If qcom,gsi-loader is "self", the AP loads GSI firmware, and
      # memory-region must be specified
      if:
        properties:
          qcom,gsi-loader:
            contains:
              const: self
      then:
        required:
          - memory-region
    else:
      # If qcom,gsi-loader is not present, we use deprecated behavior.
      # If modem-init is not present, the AP loads GSI firmware, and
      # memory-region must be specified.
      if:
        not:
          required:
            - modem-init
      then:
        required:
          - memory-region

additionalProperties: false

examples:
  - |
        #include <dt-bindings/interrupt-controller/arm-gic.h>
        #include <dt-bindings/clock/qcom,rpmh.h>
        #include <dt-bindings/interconnect/qcom,sdm845.h>

        smp2p-mpss {
                compatible = "qcom,smp2p";
                interrupts = <GIC_SPI 576 IRQ_TYPE_EDGE_RISING>;
                mboxes = <&apss_shared 6>;
                qcom,smem = <94>, <432>;
                qcom,local-pid = <0>;
                qcom,remote-pid = <5>;

                ipa_smp2p_out: ipa-ap-to-modem {
                        qcom,entry-name = "ipa";
                        #qcom,smem-state-cells = <1>;
                };

                ipa_smp2p_in: ipa-modem-to-ap {
                        qcom,entry-name = "ipa";
                        interrupt-controller;
                        #interrupt-cells = <2>;
                };
        };

        ipa@1e40000 {
                compatible = "qcom,sc7180-ipa";

                qcom,gsi-loader = "self";
                memory-region = <&ipa_fw_mem>;
                firmware-name = "qcom/sc7180-trogdor/modem/modem.mdt";

                iommus = <&apps_smmu 0x440 0x0>,
                         <&apps_smmu 0x442 0x0>;
                reg = <0x1e40000 0x7000>,
                      <0x1e47000 0x2000>,
                      <0x1e04000 0x2c000>;
                reg-names = "ipa-reg",
                            "ipa-shared",
                            "gsi";

                interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
                                      <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
                                      <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
                                      <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
                interrupt-names = "ipa",
                                  "gsi",
                                  "ipa-clock-query",
                                  "ipa-setup-ready";

                clocks = <&rpmhcc RPMH_IPA_CLK>;
                clock-names = "core";

                interconnects =
                        <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>,
                        <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>,
                        <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>;
                interconnect-names = "memory",
                                     "imem",
                                     "config";

                qcom,qmp = <&aoss_qmp>;

                qcom,smem-states = <&ipa_smp2p_out 0>,
                                   <&ipa_smp2p_out 1>;
                qcom,smem-state-names = "ipa-clock-enabled-valid",
                                        "ipa-clock-enabled";
        };