Commit | Line | Data |
---|---|---|
d27bd6b9 RH |
1 | # SPDX-License-Identifier: GPL-2.0-only |
2 | %YAML 1.2 | |
3 | --- | |
4 | $id: http://devicetree.org/schemas/iommu/arm,smmu.yaml# | |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | |
6 | ||
7 | title: ARM System MMU Architecture Implementation | |
8 | ||
9 | maintainers: | |
10 | - Will Deacon <will@kernel.org> | |
11 | - Robin Murphy <Robin.Murphy@arm.com> | |
12 | ||
13 | description: |+ | |
14 | ARM SoCs may contain an implementation of the ARM System Memory | |
15 | Management Unit Architecture, which can be used to provide 1 or 2 stages | |
16 | of address translation to bus masters external to the CPU. | |
17 | ||
18 | The SMMU may also raise interrupts in response to various fault | |
19 | conditions. | |
20 | ||
21 | properties: | |
22 | $nodename: | |
23 | pattern: "^iommu@[0-9a-f]*" | |
24 | compatible: | |
25 | oneOf: | |
26 | - description: Qcom SoCs implementing "arm,smmu-v2" | |
27 | items: | |
28 | - enum: | |
29 | - qcom,msm8996-smmu-v2 | |
30 | - qcom,msm8998-smmu-v2 | |
13c7a168 | 31 | - qcom,sc7180-smmu-v2 |
d27bd6b9 RH |
32 | - qcom,sdm845-smmu-v2 |
33 | - const: qcom,smmu-v2 | |
34 | ||
35 | - description: Qcom SoCs implementing "arm,mmu-500" | |
36 | items: | |
37 | - enum: | |
f0d83c66 | 38 | - qcom,sc7180-smmu-500 |
d27bd6b9 | 39 | - qcom,sdm845-smmu-500 |
7b6b70d8 JM |
40 | - qcom,sm8150-smmu-500 |
41 | - qcom,sm8250-smmu-500 | |
d27bd6b9 | 42 | - const: arm,mmu-500 |
e85e84d1 TN |
43 | - description: Marvell SoCs implementing "arm,mmu-500" |
44 | items: | |
45 | - const: marvell,ap806-smmu-500 | |
46 | - const: arm,mmu-500 | |
d27bd6b9 RH |
47 | - items: |
48 | - const: arm,mmu-500 | |
49 | - const: arm,smmu-v2 | |
50 | - items: | |
bd0d6960 AP |
51 | - enum: |
52 | - arm,mmu-400 | |
53 | - arm,mmu-401 | |
d27bd6b9 RH |
54 | - const: arm,smmu-v1 |
55 | - enum: | |
56 | - arm,smmu-v1 | |
57 | - arm,smmu-v2 | |
58 | - arm,mmu-400 | |
59 | - arm,mmu-401 | |
60 | - arm,mmu-500 | |
61 | - cavium,smmu-v2 | |
62 | ||
63 | reg: | |
64 | maxItems: 1 | |
65 | ||
66 | '#global-interrupts': | |
67 | description: The number of global interrupts exposed by the device. | |
3d21a460 | 68 | $ref: /schemas/types.yaml#/definitions/uint32 |
d27bd6b9 RH |
69 | minimum: 0 |
70 | maximum: 260 # 2 secure, 2 non-secure, and up to 256 perf counters | |
71 | ||
72 | '#iommu-cells': | |
73 | enum: [ 1, 2 ] | |
74 | description: | | |
75 | See Documentation/devicetree/bindings/iommu/iommu.txt for details. With a | |
76 | value of 1, each IOMMU specifier represents a distinct stream ID emitted | |
77 | by that device into the relevant SMMU. | |
78 | ||
79 | SMMUs with stream matching support and complex masters may use a value of | |
80 | 2, where the second cell of the IOMMU specifier represents an SMR mask to | |
81 | combine with the ID in the first cell. Care must be taken to ensure the | |
82 | set of matched IDs does not result in conflicts. | |
83 | ||
84 | interrupts: | |
85 | minItems: 1 | |
86 | maxItems: 388 # 260 plus 128 contexts | |
87 | description: | | |
88 | Interrupt list, with the first #global-interrupts entries corresponding to | |
89 | the global interrupts and any following entries corresponding to context | |
90 | interrupts, specified in order of their indexing by the SMMU. | |
91 | ||
92 | For SMMUv2 implementations, there must be exactly one interrupt per | |
93 | context bank. In the case of a single, combined interrupt, it must be | |
94 | listed multiple times. | |
95 | ||
96 | dma-coherent: | |
97 | description: | | |
98 | Present if page table walks made by the SMMU are cache coherent with the | |
99 | CPU. | |
100 | ||
101 | NOTE: this only applies to the SMMU itself, not masters connected | |
102 | upstream of the SMMU. | |
103 | ||
104 | calxeda,smmu-secure-config-access: | |
105 | type: boolean | |
106 | description: | |
107 | Enable proper handling of buggy implementations that always use secure | |
108 | access to SMMU configuration registers. In this case non-secure aliases of | |
109 | secure registers have to be used during SMMU configuration. | |
110 | ||
111 | stream-match-mask: | |
112 | $ref: /schemas/types.yaml#/definitions/uint32 | |
113 | description: | | |
114 | For SMMUs supporting stream matching and using #iommu-cells = <1>, | |
115 | specifies a mask of bits to ignore when matching stream IDs (e.g. this may | |
116 | be programmed into the SMRn.MASK field of every stream match register | |
117 | used). For cases where it is desirable to ignore some portion of every | |
118 | Stream ID (e.g. for certain MMU-500 configurations given globally unique | |
119 | input IDs). This property is not valid for SMMUs using stream indexing, or | |
120 | using stream matching with #iommu-cells = <2>, and may be ignored if | |
121 | present in such cases. | |
122 | ||
123 | clock-names: | |
124 | items: | |
125 | - const: bus | |
126 | - const: iface | |
127 | ||
128 | clocks: | |
129 | items: | |
130 | - description: bus clock required for downstream bus access and for the | |
131 | smmu ptw | |
132 | - description: interface clock required to access smmu's registers | |
133 | through the TCU's programming interface. | |
134 | ||
135 | power-domains: | |
136 | maxItems: 1 | |
137 | ||
138 | required: | |
139 | - compatible | |
140 | - reg | |
141 | - '#global-interrupts' | |
142 | - '#iommu-cells' | |
143 | - interrupts | |
144 | ||
145 | additionalProperties: false | |
146 | ||
147 | examples: | |
148 | - |+ | |
149 | /* SMMU with stream matching or stream indexing */ | |
150 | smmu1: iommu@ba5e0000 { | |
151 | compatible = "arm,smmu-v1"; | |
152 | reg = <0xba5e0000 0x10000>; | |
153 | #global-interrupts = <2>; | |
154 | interrupts = <0 32 4>, | |
155 | <0 33 4>, | |
156 | <0 34 4>, /* This is the first context interrupt */ | |
157 | <0 35 4>, | |
158 | <0 36 4>, | |
159 | <0 37 4>; | |
160 | #iommu-cells = <1>; | |
161 | }; | |
162 | ||
163 | /* device with two stream IDs, 0 and 7 */ | |
164 | master1 { | |
165 | iommus = <&smmu1 0>, | |
166 | <&smmu1 7>; | |
167 | }; | |
168 | ||
169 | ||
170 | /* SMMU with stream matching */ | |
171 | smmu2: iommu@ba5f0000 { | |
172 | compatible = "arm,smmu-v1"; | |
173 | reg = <0xba5f0000 0x10000>; | |
174 | #global-interrupts = <2>; | |
175 | interrupts = <0 38 4>, | |
176 | <0 39 4>, | |
177 | <0 40 4>, /* This is the first context interrupt */ | |
178 | <0 41 4>, | |
179 | <0 42 4>, | |
180 | <0 43 4>; | |
181 | #iommu-cells = <2>; | |
182 | }; | |
183 | ||
184 | /* device with stream IDs 0 and 7 */ | |
185 | master2 { | |
186 | iommus = <&smmu2 0 0>, | |
187 | <&smmu2 7 0>; | |
188 | }; | |
189 | ||
190 | /* device with stream IDs 1, 17, 33 and 49 */ | |
191 | master3 { | |
192 | iommus = <&smmu2 1 0x30>; | |
193 | }; | |
194 | ||
195 | ||
196 | /* ARM MMU-500 with 10-bit stream ID input configuration */ | |
197 | smmu3: iommu@ba600000 { | |
198 | compatible = "arm,mmu-500", "arm,smmu-v2"; | |
199 | reg = <0xba600000 0x10000>; | |
200 | #global-interrupts = <2>; | |
201 | interrupts = <0 44 4>, | |
202 | <0 45 4>, | |
203 | <0 46 4>, /* This is the first context interrupt */ | |
204 | <0 47 4>, | |
205 | <0 48 4>, | |
206 | <0 49 4>; | |
207 | #iommu-cells = <1>; | |
208 | /* always ignore appended 5-bit TBU number */ | |
209 | stream-match-mask = <0x7c00>; | |
210 | }; | |
211 | ||
212 | bus { | |
213 | /* bus whose child devices emit one unique 10-bit stream | |
214 | ID each, but may master through multiple SMMU TBUs */ | |
215 | iommu-map = <0 &smmu3 0 0x400>; | |
216 | ||
217 | ||
218 | }; | |
219 | ||
220 | - |+ | |
221 | /* Qcom's arm,smmu-v2 implementation */ | |
222 | #include <dt-bindings/interrupt-controller/arm-gic.h> | |
223 | #include <dt-bindings/interrupt-controller/irq.h> | |
224 | smmu4: iommu@d00000 { | |
225 | compatible = "qcom,msm8996-smmu-v2", "qcom,smmu-v2"; | |
226 | reg = <0xd00000 0x10000>; | |
227 | ||
228 | #global-interrupts = <1>; | |
229 | interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>, | |
230 | <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>, | |
231 | <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>; | |
232 | #iommu-cells = <1>; | |
233 | power-domains = <&mmcc 0>; | |
234 | ||
235 | clocks = <&mmcc 123>, | |
236 | <&mmcc 124>; | |
237 | clock-names = "bus", "iface"; | |
238 | }; |