xref: /openbmc/linux/Documentation/devicetree/bindings/iommu/arm,smmu.yaml (revision 8f1b4600373f9da2afc124f31788b16f47eb950c)
1d27bd6b9SRob Herring# SPDX-License-Identifier: GPL-2.0-only
2d27bd6b9SRob Herring%YAML 1.2
3d27bd6b9SRob Herring---
4d27bd6b9SRob Herring$id: http://devicetree.org/schemas/iommu/arm,smmu.yaml#
5d27bd6b9SRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6d27bd6b9SRob Herring
7d27bd6b9SRob Herringtitle: ARM System MMU Architecture Implementation
8d27bd6b9SRob Herring
9d27bd6b9SRob Herringmaintainers:
10d27bd6b9SRob Herring  - Will Deacon <will@kernel.org>
11d27bd6b9SRob Herring  - Robin Murphy <Robin.Murphy@arm.com>
12d27bd6b9SRob Herring
13d27bd6b9SRob Herringdescription: |+
14d27bd6b9SRob Herring  ARM SoCs may contain an implementation of the ARM System Memory
15d27bd6b9SRob Herring  Management Unit Architecture, which can be used to provide 1 or 2 stages
16d27bd6b9SRob Herring  of address translation to bus masters external to the CPU.
17d27bd6b9SRob Herring
18d27bd6b9SRob Herring  The SMMU may also raise interrupts in response to various fault
19d27bd6b9SRob Herring  conditions.
20d27bd6b9SRob Herring
21d27bd6b9SRob Herringproperties:
22d27bd6b9SRob Herring  $nodename:
23d27bd6b9SRob Herring    pattern: "^iommu@[0-9a-f]*"
24d27bd6b9SRob Herring  compatible:
25d27bd6b9SRob Herring    oneOf:
26d27bd6b9SRob Herring      - description: Qcom SoCs implementing "arm,smmu-v2"
27d27bd6b9SRob Herring        items:
28d27bd6b9SRob Herring          - enum:
29d27bd6b9SRob Herring              - qcom,msm8996-smmu-v2
30d27bd6b9SRob Herring              - qcom,msm8998-smmu-v2
31dbf88f74SDmitry Baryshkov              - qcom,sdm630-smmu-v2
3244984d56SKonrad Dybcio              - qcom,sm6375-smmu-v2
33d27bd6b9SRob Herring          - const: qcom,smmu-v2
34d27bd6b9SRob Herring
356c84bbd1SDmitry Baryshkov      - description: Qcom SoCs implementing "qcom,smmu-500" and "arm,mmu-500"
36d27bd6b9SRob Herring        items:
37d27bd6b9SRob Herring          - enum:
38f1edce3dSLoic Poulain              - qcom,qcm2290-smmu-500
396313f4b5SMelody Olvera              - qcom,qdu1000-smmu-500
400802999cSBartosz Golaszewski              - qcom,sa8775p-smmu-500
41f0d83c66SRajendra Nayak              - qcom,sc7180-smmu-500
42a9aa2bb1SSai Prakash Ranjan              - qcom,sc7280-smmu-500
439cde12baSBjorn Andersson              - qcom,sc8180x-smmu-500
4438db6b41SBjorn Andersson              - qcom,sc8280xp-smmu-500
458d3a9ec6SRichard Acayan              - qcom,sdm670-smmu-500
46d27bd6b9SRob Herring              - qcom,sdm845-smmu-500
47eb9181a3SManivannan Sadhasivam              - qcom,sdx55-smmu-500
48eb9181a3SManivannan Sadhasivam              - qcom,sdx65-smmu-500
4948989c0bSRohit Agarwal              - qcom,sdx75-smmu-500
506c84bbd1SDmitry Baryshkov              - qcom,sm6115-smmu-500
51822765f4SMartin Botka              - qcom,sm6125-smmu-500
526c84bbd1SDmitry Baryshkov              - qcom,sm6350-smmu-500
536c84bbd1SDmitry Baryshkov              - qcom,sm6375-smmu-500
546c84bbd1SDmitry Baryshkov              - qcom,sm8150-smmu-500
556c84bbd1SDmitry Baryshkov              - qcom,sm8250-smmu-500
566c84bbd1SDmitry Baryshkov              - qcom,sm8350-smmu-500
576c84bbd1SDmitry Baryshkov              - qcom,sm8450-smmu-500
587f061c19SAbel Vesa              - qcom,sm8550-smmu-500
596c84bbd1SDmitry Baryshkov          - const: qcom,smmu-500
606c84bbd1SDmitry Baryshkov          - const: arm,mmu-500
616c84bbd1SDmitry Baryshkov
626c84bbd1SDmitry Baryshkov      - description: Qcom SoCs implementing "arm,mmu-500" (legacy binding)
636c84bbd1SDmitry Baryshkov        deprecated: true
646c84bbd1SDmitry Baryshkov        items:
656c84bbd1SDmitry Baryshkov          # Do not add additional SoC to this list. Instead use two previous lists.
666c84bbd1SDmitry Baryshkov          - enum:
676c84bbd1SDmitry Baryshkov              - qcom,qcm2290-smmu-500
686c84bbd1SDmitry Baryshkov              - qcom,sc7180-smmu-500
696c84bbd1SDmitry Baryshkov              - qcom,sc7280-smmu-500
706c84bbd1SDmitry Baryshkov              - qcom,sc8180x-smmu-500
716c84bbd1SDmitry Baryshkov              - qcom,sc8280xp-smmu-500
726c84bbd1SDmitry Baryshkov              - qcom,sdm845-smmu-500
73728b22a5SAdam Skladowski              - qcom,sm6115-smmu-500
74e4a40f15SKonrad Dybcio              - qcom,sm6350-smmu-500
75743302d4SKonrad Dybcio              - qcom,sm6375-smmu-500
767b6b70d8SJonathan Marek              - qcom,sm8150-smmu-500
777b6b70d8SJonathan Marek              - qcom,sm8250-smmu-500
7870b5b6a6SVinod Koul              - qcom,sm8350-smmu-500
79810d8cabSVinod Koul              - qcom,sm8450-smmu-500
80d27bd6b9SRob Herring          - const: arm,mmu-500
815c368661SKonrad Dybcio      - description: Qcom Adreno GPUs implementing "qcom,smmu-500" and "arm,mmu-500"
82dbf88f74SDmitry Baryshkov        items:
83dbf88f74SDmitry Baryshkov          - enum:
84387a80a7SBartosz Golaszewski              - qcom,sa8775p-smmu-500
85dbf88f74SDmitry Baryshkov              - qcom,sc7280-smmu-500
8684b8a7feSBjorn Andersson              - qcom,sc8280xp-smmu-500
873ad65855SKonrad Dybcio              - qcom,sm6115-smmu-500
883ad65855SKonrad Dybcio              - qcom,sm6125-smmu-500
8911321f77SMarijn Suijten              - qcom,sm8150-smmu-500
90dbf88f74SDmitry Baryshkov              - qcom,sm8250-smmu-500
9116d16468SKonrad Dybcio              - qcom,sm8350-smmu-500
92dbf88f74SDmitry Baryshkov          - const: qcom,adreno-smmu
935c368661SKonrad Dybcio          - const: qcom,smmu-500
945c368661SKonrad Dybcio          - const: arm,mmu-500
955c368661SKonrad Dybcio      - description: Qcom Adreno GPUs implementing "arm,mmu-500" (legacy binding)
965c368661SKonrad Dybcio        deprecated: true
975c368661SKonrad Dybcio        items:
985c368661SKonrad Dybcio          # Do not add additional SoC to this list. Instead use previous list.
995c368661SKonrad Dybcio          - enum:
1005c368661SKonrad Dybcio              - qcom,sc7280-smmu-500
1015c368661SKonrad Dybcio              - qcom,sm8150-smmu-500
1025c368661SKonrad Dybcio              - qcom,sm8250-smmu-500
1035c368661SKonrad Dybcio          - const: qcom,adreno-smmu
104dbf88f74SDmitry Baryshkov          - const: arm,mmu-500
105a29bbb08SJordan Crouse      - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
106a29bbb08SJordan Crouse        items:
107a29bbb08SJordan Crouse          - enum:
108dbf88f74SDmitry Baryshkov              - qcom,msm8996-smmu-v2
109a29bbb08SJordan Crouse              - qcom,sc7180-smmu-v2
110dbf88f74SDmitry Baryshkov              - qcom,sdm630-smmu-v2
111a29bbb08SJordan Crouse              - qcom,sdm845-smmu-v2
1125a47cb4dSKonrad Dybcio              - qcom,sm6350-smmu-v2
113a29bbb08SJordan Crouse          - const: qcom,adreno-smmu
114a29bbb08SJordan Crouse          - const: qcom,smmu-v2
1153a12e8c0SDmitry Baryshkov      - description: Qcom Adreno GPUs on Google Cheza platform
1163a12e8c0SDmitry Baryshkov        items:
1173a12e8c0SDmitry Baryshkov          - const: qcom,sdm845-smmu-v2
1183a12e8c0SDmitry Baryshkov          - const: qcom,smmu-v2
119e85e84d1STomasz Nowicki      - description: Marvell SoCs implementing "arm,mmu-500"
120e85e84d1STomasz Nowicki        items:
121e85e84d1STomasz Nowicki          - const: marvell,ap806-smmu-500
122e85e84d1STomasz Nowicki          - const: arm,mmu-500
1234287861dSThierry Reding      - description: NVIDIA SoCs that require memory controller interaction
1244287861dSThierry Reding          and may program multiple ARM MMU-500s identically with the memory
1254287861dSThierry Reding          controller interleaving translations between multiple instances
1264287861dSThierry Reding          for improved performance.
1274287861dSThierry Reding        items:
1283d2deb0cSKrishna Reddy          - enum:
129bf3ec9deSThierry Reding              - nvidia,tegra186-smmu
13095d5aeabSThierry Reding              - nvidia,tegra194-smmu
13195d5aeabSThierry Reding              - nvidia,tegra234-smmu
1323d2deb0cSKrishna Reddy          - const: nvidia,smmu-500
133d27bd6b9SRob Herring      - items:
134d27bd6b9SRob Herring          - const: arm,mmu-500
135d27bd6b9SRob Herring          - const: arm,smmu-v2
136d27bd6b9SRob Herring      - items:
137bd0d6960SAndre Przywara          - enum:
138bd0d6960SAndre Przywara              - arm,mmu-400
139bd0d6960SAndre Przywara              - arm,mmu-401
140d27bd6b9SRob Herring          - const: arm,smmu-v1
141d27bd6b9SRob Herring      - enum:
142d27bd6b9SRob Herring          - arm,smmu-v1
143d27bd6b9SRob Herring          - arm,smmu-v2
144d27bd6b9SRob Herring          - arm,mmu-400
145d27bd6b9SRob Herring          - arm,mmu-401
146d27bd6b9SRob Herring          - arm,mmu-500
147d27bd6b9SRob Herring          - cavium,smmu-v2
148d27bd6b9SRob Herring
149d27bd6b9SRob Herring  reg:
1503d2deb0cSKrishna Reddy    minItems: 1
1513d2deb0cSKrishna Reddy    maxItems: 2
152d27bd6b9SRob Herring
153d27bd6b9SRob Herring  '#global-interrupts':
154d27bd6b9SRob Herring    description: The number of global interrupts exposed by the device.
1553d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
156d27bd6b9SRob Herring    minimum: 0
157d27bd6b9SRob Herring    maximum: 260   # 2 secure, 2 non-secure, and up to 256 perf counters
158d27bd6b9SRob Herring
159d27bd6b9SRob Herring  '#iommu-cells':
160d27bd6b9SRob Herring    enum: [ 1, 2 ]
161d27bd6b9SRob Herring    description: |
162d27bd6b9SRob Herring      See Documentation/devicetree/bindings/iommu/iommu.txt for details. With a
163d27bd6b9SRob Herring      value of 1, each IOMMU specifier represents a distinct stream ID emitted
164d27bd6b9SRob Herring      by that device into the relevant SMMU.
165d27bd6b9SRob Herring
166d27bd6b9SRob Herring      SMMUs with stream matching support and complex masters may use a value of
167d27bd6b9SRob Herring      2, where the second cell of the IOMMU specifier represents an SMR mask to
168d27bd6b9SRob Herring      combine with the ID in the first cell.  Care must be taken to ensure the
169d27bd6b9SRob Herring      set of matched IDs does not result in conflicts.
170d27bd6b9SRob Herring
171d27bd6b9SRob Herring  interrupts:
172d27bd6b9SRob Herring    minItems: 1
173d27bd6b9SRob Herring    maxItems: 388   # 260 plus 128 contexts
174d27bd6b9SRob Herring    description: |
175d27bd6b9SRob Herring      Interrupt list, with the first #global-interrupts entries corresponding to
176d27bd6b9SRob Herring      the global interrupts and any following entries corresponding to context
177d27bd6b9SRob Herring      interrupts, specified in order of their indexing by the SMMU.
178d27bd6b9SRob Herring
179d27bd6b9SRob Herring      For SMMUv2 implementations, there must be exactly one interrupt per
180d27bd6b9SRob Herring      context bank. In the case of a single, combined interrupt, it must be
181d27bd6b9SRob Herring      listed multiple times.
182d27bd6b9SRob Herring
183d27bd6b9SRob Herring  dma-coherent:
184d27bd6b9SRob Herring    description: |
185d27bd6b9SRob Herring      Present if page table walks made by the SMMU are cache coherent with the
186d27bd6b9SRob Herring      CPU.
187d27bd6b9SRob Herring
188d27bd6b9SRob Herring      NOTE: this only applies to the SMMU itself, not masters connected
189d27bd6b9SRob Herring      upstream of the SMMU.
190d27bd6b9SRob Herring
191d27bd6b9SRob Herring  calxeda,smmu-secure-config-access:
192d27bd6b9SRob Herring    type: boolean
193d27bd6b9SRob Herring    description:
194d27bd6b9SRob Herring      Enable proper handling of buggy implementations that always use secure
195d27bd6b9SRob Herring      access to SMMU configuration registers. In this case non-secure aliases of
196d27bd6b9SRob Herring      secure registers have to be used during SMMU configuration.
197d27bd6b9SRob Herring
198d27bd6b9SRob Herring  stream-match-mask:
199d27bd6b9SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
200d27bd6b9SRob Herring    description: |
201d27bd6b9SRob Herring      For SMMUs supporting stream matching and using #iommu-cells = <1>,
202d27bd6b9SRob Herring      specifies a mask of bits to ignore when matching stream IDs (e.g. this may
203d27bd6b9SRob Herring      be programmed into the SMRn.MASK field of every stream match register
204d27bd6b9SRob Herring      used). For cases where it is desirable to ignore some portion of every
205d27bd6b9SRob Herring      Stream ID (e.g. for certain MMU-500 configurations given globally unique
206d27bd6b9SRob Herring      input IDs). This property is not valid for SMMUs using stream indexing, or
207d27bd6b9SRob Herring      using stream matching with #iommu-cells = <2>, and may be ignored if
208d27bd6b9SRob Herring      present in such cases.
209d27bd6b9SRob Herring
210d27bd6b9SRob Herring  clock-names:
211982295bfSDmitry Baryshkov    minItems: 1
212982295bfSDmitry Baryshkov    maxItems: 7
213d27bd6b9SRob Herring
214d27bd6b9SRob Herring  clocks:
215982295bfSDmitry Baryshkov    minItems: 1
216982295bfSDmitry Baryshkov    maxItems: 7
217d27bd6b9SRob Herring
218d27bd6b9SRob Herring  power-domains:
2196bc6af37SKonrad Dybcio    minItems: 1
2206bc6af37SKonrad Dybcio    maxItems: 3
221d27bd6b9SRob Herring
222c02bda09SThierry Reding  nvidia,memory-controller:
223c02bda09SThierry Reding    description: |
224c02bda09SThierry Reding      A phandle to the memory controller on NVIDIA Tegra186 and later SoCs.
225c02bda09SThierry Reding      The memory controller needs to be programmed with a mapping of memory
226c02bda09SThierry Reding      client IDs to ARM SMMU stream IDs.
227c02bda09SThierry Reding
228c02bda09SThierry Reding      If this property is absent, the mapping programmed by early firmware
229c02bda09SThierry Reding      will be used and it is not guaranteed that IOMMU translations will be
230c02bda09SThierry Reding      enabled for any given device.
231c02bda09SThierry Reding    $ref: /schemas/types.yaml#/definitions/phandle
232c02bda09SThierry Reding
233d27bd6b9SRob Herringrequired:
234d27bd6b9SRob Herring  - compatible
235d27bd6b9SRob Herring  - reg
236d27bd6b9SRob Herring  - '#global-interrupts'
237d27bd6b9SRob Herring  - '#iommu-cells'
238d27bd6b9SRob Herring  - interrupts
239d27bd6b9SRob Herring
240d27bd6b9SRob HerringadditionalProperties: false
241d27bd6b9SRob Herring
2423d2deb0cSKrishna ReddyallOf:
2433d2deb0cSKrishna Reddy  - if:
2443d2deb0cSKrishna Reddy      properties:
2453d2deb0cSKrishna Reddy        compatible:
2463d2deb0cSKrishna Reddy          contains:
2473d2deb0cSKrishna Reddy            enum:
2484287861dSThierry Reding              - nvidia,tegra186-smmu
24995d5aeabSThierry Reding              - nvidia,tegra194-smmu
25095d5aeabSThierry Reding              - nvidia,tegra234-smmu
2513d2deb0cSKrishna Reddy    then:
2523d2deb0cSKrishna Reddy      properties:
2533d2deb0cSKrishna Reddy        reg:
2544287861dSThierry Reding          minItems: 1
2553d2deb0cSKrishna Reddy          maxItems: 2
256c02bda09SThierry Reding
257c02bda09SThierry Reding      # The reference to the memory controller is required to ensure that the
258c02bda09SThierry Reding      # memory client to stream ID mapping can be done synchronously with the
259c02bda09SThierry Reding      # IOMMU attachment.
260c02bda09SThierry Reding      required:
261c02bda09SThierry Reding        - nvidia,memory-controller
2623d2deb0cSKrishna Reddy    else:
2633d2deb0cSKrishna Reddy      properties:
2643d2deb0cSKrishna Reddy        reg:
2653d2deb0cSKrishna Reddy          maxItems: 1
2663d2deb0cSKrishna Reddy
267982295bfSDmitry Baryshkov  - if:
268982295bfSDmitry Baryshkov      properties:
269982295bfSDmitry Baryshkov        compatible:
270982295bfSDmitry Baryshkov          contains:
271982295bfSDmitry Baryshkov            enum:
272982295bfSDmitry Baryshkov              - qcom,msm8998-smmu-v2
273*938ba2f2SKonrad Dybcio              - qcom,sdm630-smmu-v2
274b606e2e8SKonrad Dybcio    then:
275b606e2e8SKonrad Dybcio      anyOf:
276b606e2e8SKonrad Dybcio        - properties:
277b606e2e8SKonrad Dybcio            clock-names:
278b606e2e8SKonrad Dybcio              items:
279b606e2e8SKonrad Dybcio                - const: bus
280b606e2e8SKonrad Dybcio            clocks:
281b606e2e8SKonrad Dybcio              items:
282b606e2e8SKonrad Dybcio                - description: bus clock required for downstream bus access and for
283b606e2e8SKonrad Dybcio                    the smmu ptw
284b606e2e8SKonrad Dybcio        - properties:
285b606e2e8SKonrad Dybcio            clock-names:
286b606e2e8SKonrad Dybcio              items:
287b606e2e8SKonrad Dybcio                - const: iface
288b606e2e8SKonrad Dybcio                - const: mem
289b606e2e8SKonrad Dybcio                - const: mem_iface
290b606e2e8SKonrad Dybcio            clocks:
291b606e2e8SKonrad Dybcio              items:
292b606e2e8SKonrad Dybcio                - description: interface clock required to access smmu's registers
293b606e2e8SKonrad Dybcio                    through the TCU's programming interface.
294b606e2e8SKonrad Dybcio                - description: bus clock required for memory access
295b606e2e8SKonrad Dybcio                - description: bus clock required for GPU memory access
296b606e2e8SKonrad Dybcio        - properties:
297b606e2e8SKonrad Dybcio            clock-names:
298b606e2e8SKonrad Dybcio              items:
299b606e2e8SKonrad Dybcio                - const: iface-mm
300b606e2e8SKonrad Dybcio                - const: iface-smmu
301b606e2e8SKonrad Dybcio                - const: bus-smmu
302b606e2e8SKonrad Dybcio            clocks:
303b606e2e8SKonrad Dybcio              items:
304b606e2e8SKonrad Dybcio                - description: interface clock required to access mnoc's registers
305b606e2e8SKonrad Dybcio                    through the TCU's programming interface.
306b606e2e8SKonrad Dybcio                - description: interface clock required to access smmu's registers
307b606e2e8SKonrad Dybcio                    through the TCU's programming interface.
308b606e2e8SKonrad Dybcio                - description: bus clock required for the smmu ptw
309b606e2e8SKonrad Dybcio
310b606e2e8SKonrad Dybcio  - if:
311b606e2e8SKonrad Dybcio      properties:
312b606e2e8SKonrad Dybcio        compatible:
313b606e2e8SKonrad Dybcio          contains:
314b606e2e8SKonrad Dybcio            enum:
31544984d56SKonrad Dybcio              - qcom,sm6375-smmu-v2
316982295bfSDmitry Baryshkov    then:
317982295bfSDmitry Baryshkov      anyOf:
318982295bfSDmitry Baryshkov        - properties:
319982295bfSDmitry Baryshkov            clock-names:
320982295bfSDmitry Baryshkov              items:
321982295bfSDmitry Baryshkov                - const: bus
322982295bfSDmitry Baryshkov            clocks:
323982295bfSDmitry Baryshkov              items:
324982295bfSDmitry Baryshkov                - description: bus clock required for downstream bus access and for
325982295bfSDmitry Baryshkov                    the smmu ptw
326982295bfSDmitry Baryshkov        - properties:
327982295bfSDmitry Baryshkov            clock-names:
328982295bfSDmitry Baryshkov              items:
329982295bfSDmitry Baryshkov                - const: iface
330982295bfSDmitry Baryshkov                - const: mem
331982295bfSDmitry Baryshkov                - const: mem_iface
332982295bfSDmitry Baryshkov            clocks:
333982295bfSDmitry Baryshkov              items:
334982295bfSDmitry Baryshkov                - description: interface clock required to access smmu's registers
335982295bfSDmitry Baryshkov                    through the TCU's programming interface.
336982295bfSDmitry Baryshkov                - description: bus clock required for memory access
337982295bfSDmitry Baryshkov                - description: bus clock required for GPU memory access
338982295bfSDmitry Baryshkov        - properties:
339982295bfSDmitry Baryshkov            clock-names:
340982295bfSDmitry Baryshkov              items:
341982295bfSDmitry Baryshkov                - const: iface-mm
342982295bfSDmitry Baryshkov                - const: iface-smmu
343982295bfSDmitry Baryshkov                - const: bus-mm
344982295bfSDmitry Baryshkov                - const: bus-smmu
345982295bfSDmitry Baryshkov            clocks:
346982295bfSDmitry Baryshkov              items:
347982295bfSDmitry Baryshkov                - description: interface clock required to access mnoc's registers
348982295bfSDmitry Baryshkov                    through the TCU's programming interface.
349982295bfSDmitry Baryshkov                - description: interface clock required to access smmu's registers
350982295bfSDmitry Baryshkov                    through the TCU's programming interface.
351982295bfSDmitry Baryshkov                - description: bus clock required for downstream bus access
352982295bfSDmitry Baryshkov                - description: bus clock required for the smmu ptw
353982295bfSDmitry Baryshkov
354982295bfSDmitry Baryshkov  - if:
355982295bfSDmitry Baryshkov      properties:
356982295bfSDmitry Baryshkov        compatible:
357982295bfSDmitry Baryshkov          contains:
358982295bfSDmitry Baryshkov            enum:
359982295bfSDmitry Baryshkov              - qcom,msm8996-smmu-v2
360982295bfSDmitry Baryshkov              - qcom,sc7180-smmu-v2
361982295bfSDmitry Baryshkov              - qcom,sdm845-smmu-v2
362982295bfSDmitry Baryshkov    then:
363982295bfSDmitry Baryshkov      properties:
364982295bfSDmitry Baryshkov        clock-names:
365982295bfSDmitry Baryshkov          items:
366982295bfSDmitry Baryshkov            - const: bus
367982295bfSDmitry Baryshkov            - const: iface
368982295bfSDmitry Baryshkov
369982295bfSDmitry Baryshkov        clocks:
370982295bfSDmitry Baryshkov          items:
371982295bfSDmitry Baryshkov            - description: bus clock required for downstream bus access and for
372982295bfSDmitry Baryshkov                the smmu ptw
373982295bfSDmitry Baryshkov            - description: interface clock required to access smmu's registers
374982295bfSDmitry Baryshkov                through the TCU's programming interface.
375982295bfSDmitry Baryshkov
376982295bfSDmitry Baryshkov  - if:
377982295bfSDmitry Baryshkov      properties:
378982295bfSDmitry Baryshkov        compatible:
379982295bfSDmitry Baryshkov          contains:
38084b8a7feSBjorn Andersson            enum:
381387a80a7SBartosz Golaszewski              - qcom,sa8775p-smmu-500
38284b8a7feSBjorn Andersson              - qcom,sc7280-smmu-500
38384b8a7feSBjorn Andersson              - qcom,sc8280xp-smmu-500
384982295bfSDmitry Baryshkov    then:
385982295bfSDmitry Baryshkov      properties:
386982295bfSDmitry Baryshkov        clock-names:
387982295bfSDmitry Baryshkov          items:
388982295bfSDmitry Baryshkov            - const: gcc_gpu_memnoc_gfx_clk
389982295bfSDmitry Baryshkov            - const: gcc_gpu_snoc_dvm_gfx_clk
390982295bfSDmitry Baryshkov            - const: gpu_cc_ahb_clk
391982295bfSDmitry Baryshkov            - const: gpu_cc_hlos1_vote_gpu_smmu_clk
392982295bfSDmitry Baryshkov            - const: gpu_cc_cx_gmu_clk
393982295bfSDmitry Baryshkov            - const: gpu_cc_hub_cx_int_clk
394982295bfSDmitry Baryshkov            - const: gpu_cc_hub_aon_clk
395982295bfSDmitry Baryshkov
396982295bfSDmitry Baryshkov        clocks:
397982295bfSDmitry Baryshkov          items:
398982295bfSDmitry Baryshkov            - description: GPU memnoc_gfx clock
399982295bfSDmitry Baryshkov            - description: GPU snoc_dvm_gfx clock
400982295bfSDmitry Baryshkov            - description: GPU ahb clock
401982295bfSDmitry Baryshkov            - description: GPU hlos1_vote_GPU smmu clock
402982295bfSDmitry Baryshkov            - description: GPU cx_gmu clock
403982295bfSDmitry Baryshkov            - description: GPU hub_cx_int clock
404982295bfSDmitry Baryshkov            - description: GPU hub_aon clock
405982295bfSDmitry Baryshkov
406982295bfSDmitry Baryshkov  - if:
407982295bfSDmitry Baryshkov      properties:
408982295bfSDmitry Baryshkov        compatible:
409982295bfSDmitry Baryshkov          contains:
410982295bfSDmitry Baryshkov            enum:
4115a47cb4dSKonrad Dybcio              - qcom,sm6350-smmu-v2
412982295bfSDmitry Baryshkov              - qcom,sm8150-smmu-500
413982295bfSDmitry Baryshkov              - qcom,sm8250-smmu-500
414982295bfSDmitry Baryshkov    then:
415982295bfSDmitry Baryshkov      properties:
416982295bfSDmitry Baryshkov        clock-names:
417982295bfSDmitry Baryshkov          items:
418982295bfSDmitry Baryshkov            - const: ahb
419982295bfSDmitry Baryshkov            - const: bus
420982295bfSDmitry Baryshkov            - const: iface
421982295bfSDmitry Baryshkov
422982295bfSDmitry Baryshkov        clocks:
423982295bfSDmitry Baryshkov          items:
424982295bfSDmitry Baryshkov            - description: bus clock required for AHB bus access
425982295bfSDmitry Baryshkov            - description: bus clock required for downstream bus access and for
426982295bfSDmitry Baryshkov                the smmu ptw
427982295bfSDmitry Baryshkov            - description: interface clock required to access smmu's registers
428982295bfSDmitry Baryshkov                through the TCU's programming interface.
429982295bfSDmitry Baryshkov
4303ad65855SKonrad Dybcio  - if:
4313ad65855SKonrad Dybcio      properties:
4323ad65855SKonrad Dybcio        compatible:
4333ad65855SKonrad Dybcio          items:
4343ad65855SKonrad Dybcio            - enum:
4353ad65855SKonrad Dybcio                - qcom,sm6115-smmu-500
4363ad65855SKonrad Dybcio                - qcom,sm6125-smmu-500
4373ad65855SKonrad Dybcio            - const: qcom,adreno-smmu
4383ad65855SKonrad Dybcio            - const: qcom,smmu-500
4393ad65855SKonrad Dybcio            - const: arm,mmu-500
4403ad65855SKonrad Dybcio    then:
4413ad65855SKonrad Dybcio      properties:
4423ad65855SKonrad Dybcio        clock-names:
4433ad65855SKonrad Dybcio          items:
4443ad65855SKonrad Dybcio            - const: mem
4453ad65855SKonrad Dybcio            - const: hlos
4463ad65855SKonrad Dybcio            - const: iface
4473ad65855SKonrad Dybcio
4483ad65855SKonrad Dybcio        clocks:
4493ad65855SKonrad Dybcio          items:
4503ad65855SKonrad Dybcio            - description: GPU memory bus clock
4513ad65855SKonrad Dybcio            - description: Voter clock required for HLOS SMMU access
4523ad65855SKonrad Dybcio            - description: Interface clock required for register access
4533ad65855SKonrad Dybcio
454d565d60dSKrzysztof Kozlowski  # Disallow clocks for all other platforms with specific compatibles
455d565d60dSKrzysztof Kozlowski  - if:
456d565d60dSKrzysztof Kozlowski      properties:
457d565d60dSKrzysztof Kozlowski        compatible:
458d565d60dSKrzysztof Kozlowski          contains:
459d565d60dSKrzysztof Kozlowski            enum:
460d565d60dSKrzysztof Kozlowski              - cavium,smmu-v2
461d565d60dSKrzysztof Kozlowski              - marvell,ap806-smmu-500
462d565d60dSKrzysztof Kozlowski              - nvidia,smmu-500
463d565d60dSKrzysztof Kozlowski              - qcom,qcm2290-smmu-500
464d565d60dSKrzysztof Kozlowski              - qcom,qdu1000-smmu-500
465d565d60dSKrzysztof Kozlowski              - qcom,sc7180-smmu-500
466d565d60dSKrzysztof Kozlowski              - qcom,sc8180x-smmu-500
467d565d60dSKrzysztof Kozlowski              - qcom,sdm670-smmu-500
468d565d60dSKrzysztof Kozlowski              - qcom,sdm845-smmu-500
469d565d60dSKrzysztof Kozlowski              - qcom,sdx55-smmu-500
470d565d60dSKrzysztof Kozlowski              - qcom,sdx65-smmu-500
471d565d60dSKrzysztof Kozlowski              - qcom,sm6350-smmu-500
472d565d60dSKrzysztof Kozlowski              - qcom,sm6375-smmu-500
473d565d60dSKrzysztof Kozlowski              - qcom,sm8350-smmu-500
474d565d60dSKrzysztof Kozlowski              - qcom,sm8450-smmu-500
4757f061c19SAbel Vesa              - qcom,sm8550-smmu-500
476d565d60dSKrzysztof Kozlowski    then:
477d565d60dSKrzysztof Kozlowski      properties:
478d565d60dSKrzysztof Kozlowski        clock-names: false
479d565d60dSKrzysztof Kozlowski        clocks: false
480d565d60dSKrzysztof Kozlowski
4816bc6af37SKonrad Dybcio  - if:
4826bc6af37SKonrad Dybcio      properties:
4836bc6af37SKonrad Dybcio        compatible:
4846bc6af37SKonrad Dybcio          contains:
4856bc6af37SKonrad Dybcio            const: qcom,sm6375-smmu-500
4866bc6af37SKonrad Dybcio    then:
4876bc6af37SKonrad Dybcio      properties:
4886bc6af37SKonrad Dybcio        power-domains:
4896bc6af37SKonrad Dybcio          items:
4906bc6af37SKonrad Dybcio            - description: SNoC MMU TBU RT GDSC
4916bc6af37SKonrad Dybcio            - description: SNoC MMU TBU NRT GDSC
4926bc6af37SKonrad Dybcio            - description: SNoC TURING MMU TBU0 GDSC
4936bc6af37SKonrad Dybcio
4946bc6af37SKonrad Dybcio      required:
4956bc6af37SKonrad Dybcio        - power-domains
4966bc6af37SKonrad Dybcio    else:
4976bc6af37SKonrad Dybcio      properties:
4986bc6af37SKonrad Dybcio        power-domains:
4996bc6af37SKonrad Dybcio          maxItems: 1
5006bc6af37SKonrad Dybcio
501d27bd6b9SRob Herringexamples:
502d27bd6b9SRob Herring  - |+
503d27bd6b9SRob Herring    /* SMMU with stream matching or stream indexing */
504d27bd6b9SRob Herring    smmu1: iommu@ba5e0000 {
505d27bd6b9SRob Herring            compatible = "arm,smmu-v1";
506d27bd6b9SRob Herring            reg = <0xba5e0000 0x10000>;
507d27bd6b9SRob Herring            #global-interrupts = <2>;
508d27bd6b9SRob Herring            interrupts = <0 32 4>,
509d27bd6b9SRob Herring                         <0 33 4>,
510d27bd6b9SRob Herring                         <0 34 4>, /* This is the first context interrupt */
511d27bd6b9SRob Herring                         <0 35 4>,
512d27bd6b9SRob Herring                         <0 36 4>,
513d27bd6b9SRob Herring                         <0 37 4>;
514d27bd6b9SRob Herring            #iommu-cells = <1>;
515d27bd6b9SRob Herring    };
516d27bd6b9SRob Herring
517d27bd6b9SRob Herring    /* device with two stream IDs, 0 and 7 */
518d27bd6b9SRob Herring    master1 {
519d27bd6b9SRob Herring            iommus = <&smmu1 0>,
520d27bd6b9SRob Herring                     <&smmu1 7>;
521d27bd6b9SRob Herring    };
522d27bd6b9SRob Herring
523d27bd6b9SRob Herring
524d27bd6b9SRob Herring    /* SMMU with stream matching */
525d27bd6b9SRob Herring    smmu2: iommu@ba5f0000 {
526d27bd6b9SRob Herring            compatible = "arm,smmu-v1";
527d27bd6b9SRob Herring            reg = <0xba5f0000 0x10000>;
528d27bd6b9SRob Herring            #global-interrupts = <2>;
529d27bd6b9SRob Herring            interrupts = <0 38 4>,
530d27bd6b9SRob Herring                         <0 39 4>,
531d27bd6b9SRob Herring                         <0 40 4>, /* This is the first context interrupt */
532d27bd6b9SRob Herring                         <0 41 4>,
533d27bd6b9SRob Herring                         <0 42 4>,
534d27bd6b9SRob Herring                         <0 43 4>;
535d27bd6b9SRob Herring            #iommu-cells = <2>;
536d27bd6b9SRob Herring    };
537d27bd6b9SRob Herring
538d27bd6b9SRob Herring    /* device with stream IDs 0 and 7 */
539d27bd6b9SRob Herring    master2 {
540d27bd6b9SRob Herring            iommus = <&smmu2 0 0>,
541d27bd6b9SRob Herring                     <&smmu2 7 0>;
542d27bd6b9SRob Herring    };
543d27bd6b9SRob Herring
544d27bd6b9SRob Herring    /* device with stream IDs 1, 17, 33 and 49 */
545d27bd6b9SRob Herring    master3 {
546d27bd6b9SRob Herring            iommus = <&smmu2 1 0x30>;
547d27bd6b9SRob Herring    };
548d27bd6b9SRob Herring
549d27bd6b9SRob Herring
550d27bd6b9SRob Herring    /* ARM MMU-500 with 10-bit stream ID input configuration */
551d27bd6b9SRob Herring    smmu3: iommu@ba600000 {
552d27bd6b9SRob Herring            compatible = "arm,mmu-500", "arm,smmu-v2";
553d27bd6b9SRob Herring            reg = <0xba600000 0x10000>;
554d27bd6b9SRob Herring            #global-interrupts = <2>;
555d27bd6b9SRob Herring            interrupts = <0 44 4>,
556d27bd6b9SRob Herring                         <0 45 4>,
557d27bd6b9SRob Herring                         <0 46 4>, /* This is the first context interrupt */
558d27bd6b9SRob Herring                         <0 47 4>,
559d27bd6b9SRob Herring                         <0 48 4>,
560d27bd6b9SRob Herring                         <0 49 4>;
561d27bd6b9SRob Herring            #iommu-cells = <1>;
562d27bd6b9SRob Herring            /* always ignore appended 5-bit TBU number */
563d27bd6b9SRob Herring            stream-match-mask = <0x7c00>;
564d27bd6b9SRob Herring    };
565d27bd6b9SRob Herring
566d27bd6b9SRob Herring    bus {
567d27bd6b9SRob Herring            /* bus whose child devices emit one unique 10-bit stream
568d27bd6b9SRob Herring               ID each, but may master through multiple SMMU TBUs */
569d27bd6b9SRob Herring            iommu-map = <0 &smmu3 0 0x400>;
570d27bd6b9SRob Herring
571d27bd6b9SRob Herring
572d27bd6b9SRob Herring    };
573d27bd6b9SRob Herring
574d27bd6b9SRob Herring  - |+
575d27bd6b9SRob Herring    /* Qcom's arm,smmu-v2 implementation */
576d27bd6b9SRob Herring    #include <dt-bindings/interrupt-controller/arm-gic.h>
577d27bd6b9SRob Herring    #include <dt-bindings/interrupt-controller/irq.h>
578d27bd6b9SRob Herring    smmu4: iommu@d00000 {
579d27bd6b9SRob Herring      compatible = "qcom,msm8996-smmu-v2", "qcom,smmu-v2";
580d27bd6b9SRob Herring      reg = <0xd00000 0x10000>;
581d27bd6b9SRob Herring
582d27bd6b9SRob Herring      #global-interrupts = <1>;
583d27bd6b9SRob Herring      interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
584d27bd6b9SRob Herring             <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>,
585d27bd6b9SRob Herring             <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>;
586d27bd6b9SRob Herring      #iommu-cells = <1>;
587d27bd6b9SRob Herring      power-domains = <&mmcc 0>;
588d27bd6b9SRob Herring
589d27bd6b9SRob Herring      clocks = <&mmcc 123>,
590d27bd6b9SRob Herring        <&mmcc 124>;
591d27bd6b9SRob Herring      clock-names = "bus", "iface";
592d27bd6b9SRob Herring    };
593