Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 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 | |
Alex Elder | 8456c54 | 2020-05-04 12:58:56 -0500 | [diff] [blame] | 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 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 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: |
Alex Elder | 15c88e1 | 2021-04-13 11:38:25 -0500 | [diff] [blame] | 46 | enum: |
Alex Elder | 2afd6c8 | 2021-06-21 12:56:22 -0500 | [diff] [blame] | 47 | - qcom,msm8998-ipa |
Alex Elder | 15c88e1 | 2021-04-13 11:38:25 -0500 | [diff] [blame] | 48 | - qcom,sc7180-ipa |
| 49 | - qcom,sc7280-ipa |
| 50 | - qcom,sdm845-ipa |
| 51 | - qcom,sdx55-ipa |
| 52 | - qcom,sm8350-ipa |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 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 | |
Alex Elder | 8456c54 | 2020-05-04 12:58:56 -0500 | [diff] [blame] | 66 | iommus: |
David Heidelberg | 950d566 | 2021-10-26 18:32:40 +0200 | [diff] [blame] | 67 | minItems: 1 |
| 68 | maxItems: 2 |
Alex Elder | 8456c54 | 2020-05-04 12:58:56 -0500 | [diff] [blame] | 69 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 70 | clocks: |
| 71 | maxItems: 1 |
| 72 | |
| 73 | clock-names: |
Rob Herring | f516fb7 | 2020-04-20 21:24:47 -0500 | [diff] [blame] | 74 | const: core |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 75 | |
| 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 Elder | b769cf4 | 2021-08-11 09:18:02 -0500 | [diff] [blame] | 91 | 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 Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 99 | |
| 100 | interconnect-names: |
Alex Elder | b769cf4 | 2021-08-11 09:18:02 -0500 | [diff] [blame] | 101 | oneOf: |
| 102 | - items: |
| 103 | - const: memory |
| 104 | - const: config |
| 105 | - items: |
| 106 | - const: memory |
| 107 | - const: imem |
| 108 | - const: config |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 109 | |
Alex Elder | ac62a01 | 2022-02-01 09:02:04 -0600 | [diff] [blame] | 110 | qcom,qmp: |
| 111 | $ref: /schemas/types.yaml#/definitions/phandle |
| 112 | description: phandle to the AOSS side-channel message RAM |
| 113 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 114 | qcom,smem-states: |
Rob Herring | 3d21a46 | 2020-04-15 19:55:49 -0500 | [diff] [blame] | 115 | $ref: /schemas/types.yaml#/definitions/phandle-array |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 116 | description: State bits used in by the AP to signal the modem. |
| 117 | items: |
Rob Herring | f516fb7 | 2020-04-20 21:24:47 -0500 | [diff] [blame] | 118 | - description: Whether the "ipa-clock-enabled" state bit is valid |
| 119 | - description: Whether the IPA clock is enabled (if valid) |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 120 | |
| 121 | qcom,smem-state-names: |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 122 | description: The names of the state bits used for SMP2P output |
| 123 | items: |
| 124 | - const: ipa-clock-enabled-valid |
| 125 | - const: ipa-clock-enabled |
| 126 | |
| 127 | modem-init: |
| 128 | type: boolean |
| 129 | description: |
| 130 | If present, it indicates that the modem is responsible for |
| 131 | performing early IPA initialization, including loading and |
| 132 | validating firwmare used by the GSI. |
| 133 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 134 | memory-region: |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 135 | maxItems: 1 |
| 136 | description: |
| 137 | If present, a phandle for a reserved memory area that holds |
| 138 | the firmware passed to Trust Zone for authentication. Required |
| 139 | when Trust Zone (not the modem) performs early initialization. |
| 140 | |
Alex Elder | d8604b2 | 2021-04-16 08:08:49 -0500 | [diff] [blame] | 141 | firmware-name: |
| 142 | $ref: /schemas/types.yaml#/definitions/string |
| 143 | description: |
| 144 | If present, name (or relative path) of the file within the |
| 145 | firmware search path containing the firmware image used when |
| 146 | initializing IPA hardware. Optional, and only used when |
| 147 | Trust Zone performs early initialization. |
| 148 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 149 | required: |
| 150 | - compatible |
Alex Elder | 8456c54 | 2020-05-04 12:58:56 -0500 | [diff] [blame] | 151 | - iommus |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 152 | - reg |
| 153 | - clocks |
| 154 | - interrupts |
| 155 | - interconnects |
| 156 | - qcom,smem-states |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 157 | |
Alex Elder | d8604b2 | 2021-04-16 08:08:49 -0500 | [diff] [blame] | 158 | # Either modem-init is present, or memory-region must be present. |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 159 | oneOf: |
| 160 | - required: |
Rob Herring | f516fb7 | 2020-04-20 21:24:47 -0500 | [diff] [blame] | 161 | - modem-init |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 162 | - required: |
Rob Herring | f516fb7 | 2020-04-20 21:24:47 -0500 | [diff] [blame] | 163 | - memory-region |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 164 | |
Alex Elder | d8604b2 | 2021-04-16 08:08:49 -0500 | [diff] [blame] | 165 | # If memory-region is present, firmware-name may optionally be present. |
| 166 | # But if modem-init is present, firmware-name must not be present. |
| 167 | if: |
| 168 | required: |
| 169 | - modem-init |
| 170 | then: |
| 171 | not: |
| 172 | required: |
| 173 | - firmware-name |
| 174 | |
Rob Herring | 5be478f | 2020-10-02 18:41:43 -0500 | [diff] [blame] | 175 | additionalProperties: false |
| 176 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 177 | examples: |
| 178 | - | |
Alex Elder | 27bb36e | 2021-01-20 15:26:04 -0600 | [diff] [blame] | 179 | #include <dt-bindings/interrupt-controller/arm-gic.h> |
Alex Elder | e6e0f09 | 2020-03-11 16:47:00 -0500 | [diff] [blame] | 180 | #include <dt-bindings/clock/qcom,rpmh.h> |
| 181 | #include <dt-bindings/interconnect/qcom,sdm845.h> |
| 182 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 183 | smp2p-mpss { |
| 184 | compatible = "qcom,smp2p"; |
| 185 | ipa_smp2p_out: ipa-ap-to-modem { |
| 186 | qcom,entry-name = "ipa"; |
| 187 | #qcom,smem-state-cells = <1>; |
| 188 | }; |
| 189 | |
| 190 | ipa_smp2p_in: ipa-modem-to-ap { |
| 191 | qcom,entry-name = "ipa"; |
| 192 | interrupt-controller; |
| 193 | #interrupt-cells = <2>; |
| 194 | }; |
| 195 | }; |
| 196 | ipa@1e40000 { |
| 197 | compatible = "qcom,sdm845-ipa"; |
| 198 | |
| 199 | modem-init; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 200 | |
Alex Elder | 8456c54 | 2020-05-04 12:58:56 -0500 | [diff] [blame] | 201 | iommus = <&apps_smmu 0x720 0x3>; |
Rob Herring | fba5618 | 2020-05-12 15:45:43 -0500 | [diff] [blame] | 202 | reg = <0x1e40000 0x7000>, |
| 203 | <0x1e47000 0x2000>, |
| 204 | <0x1e04000 0x2c000>; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 205 | reg-names = "ipa-reg", |
Alex Elder | e6e0f09 | 2020-03-11 16:47:00 -0500 | [diff] [blame] | 206 | "ipa-shared", |
| 207 | "gsi"; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 208 | |
Alex Elder | 27bb36e | 2021-01-20 15:26:04 -0600 | [diff] [blame] | 209 | interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>, |
| 210 | <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>, |
Alex Elder | e6e0f09 | 2020-03-11 16:47:00 -0500 | [diff] [blame] | 211 | <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>, |
| 212 | <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 213 | interrupt-names = "ipa", |
Alex Elder | e6e0f09 | 2020-03-11 16:47:00 -0500 | [diff] [blame] | 214 | "gsi", |
| 215 | "ipa-clock-query", |
| 216 | "ipa-setup-ready"; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 217 | |
| 218 | clocks = <&rpmhcc RPMH_IPA_CLK>; |
| 219 | clock-names = "core"; |
| 220 | |
| 221 | interconnects = |
| 222 | <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_EBI1>, |
Alex Elder | a0221a0 | 2021-08-02 18:30:19 -0500 | [diff] [blame] | 223 | <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_IMEM>, |
| 224 | <&rsc_hlos MASTER_APPSS_PROC &rsc_hlos SLAVE_IPA_CFG>; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 225 | interconnect-names = "memory", |
Alex Elder | a0221a0 | 2021-08-02 18:30:19 -0500 | [diff] [blame] | 226 | "imem", |
| 227 | "config"; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 228 | |
Alex Elder | ac62a01 | 2022-02-01 09:02:04 -0600 | [diff] [blame] | 229 | qcom,qmp = <&aoss_qmp>; |
| 230 | |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 231 | qcom,smem-states = <&ipa_smp2p_out 0>, |
Alex Elder | e6e0f09 | 2020-03-11 16:47:00 -0500 | [diff] [blame] | 232 | <&ipa_smp2p_out 1>; |
Alex Elder | fc39c40 | 2020-03-05 22:28:16 -0600 | [diff] [blame] | 233 | qcom,smem-state-names = "ipa-clock-enabled-valid", |
| 234 | "ipa-clock-enabled"; |
| 235 | }; |