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