xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/qcom,ipa.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/net/qcom,ipa.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: Qualcomm IP Accelerator (IPA)
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Alex Elder <elder@kernel.org>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyundescription:
13*4882a593Smuzhiyun  This binding describes the Qualcomm IPA.  The IPA is capable of offloading
14*4882a593Smuzhiyun  certain network processing tasks (e.g. filtering, routing, and NAT) from
15*4882a593Smuzhiyun  the main processor.
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun  The IPA sits between multiple independent "execution environments,"
18*4882a593Smuzhiyun  including the Application Processor (AP) and the modem.  The IPA presents
19*4882a593Smuzhiyun  a Generic Software Interface (GSI) to each execution environment.
20*4882a593Smuzhiyun  The GSI is an integral part of the IPA, but it is logically isolated
21*4882a593Smuzhiyun  and has a distinct interrupt and a separately-defined address space.
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun  See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt.  See
24*4882a593Smuzhiyun  iommu/iommu.txt and iommu/arm,smmu.yaml for more information about SMMU
25*4882a593Smuzhiyun  bindings.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun  - |
29*4882a593Smuzhiyun    --------             ---------
30*4882a593Smuzhiyun    |      |             |       |
31*4882a593Smuzhiyun    |  AP  +<---.   .----+ Modem |
32*4882a593Smuzhiyun    |      +--. |   | .->+       |
33*4882a593Smuzhiyun    |      |  | |   | |  |       |
34*4882a593Smuzhiyun    --------  | |   | |  ---------
35*4882a593Smuzhiyun              v |   v |
36*4882a593Smuzhiyun            --+-+---+-+--
37*4882a593Smuzhiyun            |    GSI    |
38*4882a593Smuzhiyun            |-----------|
39*4882a593Smuzhiyun            |           |
40*4882a593Smuzhiyun            |    IPA    |
41*4882a593Smuzhiyun            |           |
42*4882a593Smuzhiyun            -------------
43*4882a593Smuzhiyun
44*4882a593Smuzhiyunproperties:
45*4882a593Smuzhiyun  compatible:
46*4882a593Smuzhiyun    const: "qcom,sdm845-ipa"
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun  reg:
49*4882a593Smuzhiyun    items:
50*4882a593Smuzhiyun      - description: IPA registers
51*4882a593Smuzhiyun      - description: IPA shared memory
52*4882a593Smuzhiyun      - description: GSI registers
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun  reg-names:
55*4882a593Smuzhiyun    items:
56*4882a593Smuzhiyun      - const: ipa-reg
57*4882a593Smuzhiyun      - const: ipa-shared
58*4882a593Smuzhiyun      - const: gsi
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun  iommus:
61*4882a593Smuzhiyun    maxItems: 1
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun  clocks:
64*4882a593Smuzhiyun    maxItems: 1
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun  clock-names:
67*4882a593Smuzhiyun    const: core
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun  interrupts:
70*4882a593Smuzhiyun    items:
71*4882a593Smuzhiyun      - description: IPA interrupt (hardware IRQ)
72*4882a593Smuzhiyun      - description: GSI interrupt (hardware IRQ)
73*4882a593Smuzhiyun      - description: Modem clock query interrupt (smp2p interrupt)
74*4882a593Smuzhiyun      - description: Modem setup ready interrupt (smp2p interrupt)
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun  interrupt-names:
77*4882a593Smuzhiyun    items:
78*4882a593Smuzhiyun      - const: ipa
79*4882a593Smuzhiyun      - const: gsi
80*4882a593Smuzhiyun      - const: ipa-clock-query
81*4882a593Smuzhiyun      - const: ipa-setup-ready
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun  interconnects:
84*4882a593Smuzhiyun    items:
85*4882a593Smuzhiyun      - description: Interconnect path between IPA and main memory
86*4882a593Smuzhiyun      - description: Interconnect path between IPA and internal memory
87*4882a593Smuzhiyun      - description: Interconnect path between IPA and the AP subsystem
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun  interconnect-names:
90*4882a593Smuzhiyun    items:
91*4882a593Smuzhiyun      - const: memory
92*4882a593Smuzhiyun      - const: imem
93*4882a593Smuzhiyun      - const: config
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun  qcom,smem-states:
96*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/phandle-array
97*4882a593Smuzhiyun    description: State bits used in by the AP to signal the modem.
98*4882a593Smuzhiyun    items:
99*4882a593Smuzhiyun      - description: Whether the "ipa-clock-enabled" state bit is valid
100*4882a593Smuzhiyun      - description: Whether the IPA clock is enabled (if valid)
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun  qcom,smem-state-names:
103*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/string-array
104*4882a593Smuzhiyun    description: The names of the state bits used for SMP2P output
105*4882a593Smuzhiyun    items:
106*4882a593Smuzhiyun      - const: ipa-clock-enabled-valid
107*4882a593Smuzhiyun      - const: ipa-clock-enabled
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun  modem-init:
110*4882a593Smuzhiyun    type: boolean
111*4882a593Smuzhiyun    description:
112*4882a593Smuzhiyun      If present, it indicates that the modem is responsible for
113*4882a593Smuzhiyun      performing early IPA initialization, including loading and
114*4882a593Smuzhiyun      validating firwmare used by the GSI.
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun  modem-remoteproc:
117*4882a593Smuzhiyun    $ref: /schemas/types.yaml#definitions/phandle
118*4882a593Smuzhiyun    description:
119*4882a593Smuzhiyun      This defines the phandle to the remoteproc node representing
120*4882a593Smuzhiyun      the modem subsystem.  This is requied so the IPA driver can
121*4882a593Smuzhiyun      receive and act on notifications of modem up/down events.
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun  memory-region:
124*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/phandle-array
125*4882a593Smuzhiyun    maxItems: 1
126*4882a593Smuzhiyun    description:
127*4882a593Smuzhiyun      If present, a phandle for a reserved memory area that holds
128*4882a593Smuzhiyun      the firmware passed to Trust Zone for authentication.  Required
129*4882a593Smuzhiyun      when Trust Zone (not the modem) performs early initialization.
130*4882a593Smuzhiyun
131*4882a593Smuzhiyunrequired:
132*4882a593Smuzhiyun  - compatible
133*4882a593Smuzhiyun  - iommus
134*4882a593Smuzhiyun  - reg
135*4882a593Smuzhiyun  - clocks
136*4882a593Smuzhiyun  - interrupts
137*4882a593Smuzhiyun  - interconnects
138*4882a593Smuzhiyun  - qcom,smem-states
139*4882a593Smuzhiyun  - modem-remoteproc
140*4882a593Smuzhiyun
141*4882a593SmuzhiyunoneOf:
142*4882a593Smuzhiyun  - required:
143*4882a593Smuzhiyun      - modem-init
144*4882a593Smuzhiyun  - required:
145*4882a593Smuzhiyun      - memory-region
146*4882a593Smuzhiyun
147*4882a593SmuzhiyunadditionalProperties: false
148*4882a593Smuzhiyun
149*4882a593Smuzhiyunexamples:
150*4882a593Smuzhiyun  - |
151*4882a593Smuzhiyun        #include <dt-bindings/interrupt-controller/irq.h>
152*4882a593Smuzhiyun        #include <dt-bindings/clock/qcom,rpmh.h>
153*4882a593Smuzhiyun        #include <dt-bindings/interconnect/qcom,sdm845.h>
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun        smp2p-mpss {
156*4882a593Smuzhiyun                compatible = "qcom,smp2p";
157*4882a593Smuzhiyun                ipa_smp2p_out: ipa-ap-to-modem {
158*4882a593Smuzhiyun                        qcom,entry-name = "ipa";
159*4882a593Smuzhiyun                        #qcom,smem-state-cells = <1>;
160*4882a593Smuzhiyun                };
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun                ipa_smp2p_in: ipa-modem-to-ap {
163*4882a593Smuzhiyun                        qcom,entry-name = "ipa";
164*4882a593Smuzhiyun                        interrupt-controller;
165*4882a593Smuzhiyun                        #interrupt-cells = <2>;
166*4882a593Smuzhiyun                };
167*4882a593Smuzhiyun        };
168*4882a593Smuzhiyun        ipa@1e40000 {
169*4882a593Smuzhiyun                compatible = "qcom,sdm845-ipa";
170*4882a593Smuzhiyun
171*4882a593Smuzhiyun                modem-init;
172*4882a593Smuzhiyun                modem-remoteproc = <&mss_pil>;
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun                iommus = <&apps_smmu 0x720 0x3>;
175*4882a593Smuzhiyun                reg = <0x1e40000 0x7000>,
176*4882a593Smuzhiyun                        <0x1e47000 0x2000>,
177*4882a593Smuzhiyun                        <0x1e04000 0x2c000>;
178*4882a593Smuzhiyun                reg-names = "ipa-reg",
179*4882a593Smuzhiyun                            "ipa-shared",
180*4882a593Smuzhiyun                            "gsi";
181*4882a593Smuzhiyun
182*4882a593Smuzhiyun                interrupts-extended = <&intc 0 311 IRQ_TYPE_EDGE_RISING>,
183*4882a593Smuzhiyun                                      <&intc 0 432 IRQ_TYPE_LEVEL_HIGH>,
184*4882a593Smuzhiyun                                      <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
185*4882a593Smuzhiyun                                      <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
186*4882a593Smuzhiyun                interrupt-names = "ipa",
187*4882a593Smuzhiyun                                  "gsi",
188*4882a593Smuzhiyun                                  "ipa-clock-query",
189*4882a593Smuzhiyun                                  "ipa-setup-ready";
190*4882a593Smuzhiyun
191*4882a593Smuzhiyun                clocks = <&rpmhcc RPMH_IPA_CLK>;
192*4882a593Smuzhiyun                clock-names = "core";
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun                interconnects =
195*4882a593Smuzhiyun                        <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_EBI1>,
196*4882a593Smuzhiyun                        <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_IMEM>,
197*4882a593Smuzhiyun                        <&rsc_hlos MASTER_APPSS_PROC &rsc_hlos SLAVE_IPA_CFG>;
198*4882a593Smuzhiyun                interconnect-names = "memory",
199*4882a593Smuzhiyun                                     "imem",
200*4882a593Smuzhiyun                                     "config";
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun                qcom,smem-states = <&ipa_smp2p_out 0>,
203*4882a593Smuzhiyun                                   <&ipa_smp2p_out 1>;
204*4882a593Smuzhiyun                qcom,smem-state-names = "ipa-clock-enabled-valid",
205*4882a593Smuzhiyun                                        "ipa-clock-enabled";
206*4882a593Smuzhiyun        };
207