Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 1 | * ARM System MMU Architecture Implementation |
| 2 | |
| 3 | ARM SoCs may contain an implementation of the ARM System Memory |
| 4 | Management Unit Architecture, which can be used to provide 1 or 2 stages |
| 5 | of address translation to bus masters external to the CPU. |
| 6 | |
| 7 | The SMMU may also raise interrupts in response to various fault |
| 8 | conditions. |
| 9 | |
| 10 | ** System MMU required properties: |
| 11 | |
| 12 | - compatible : Should be one of: |
| 13 | |
| 14 | "arm,smmu-v1" |
| 15 | "arm,smmu-v2" |
| 16 | "arm,mmu-400" |
Robin Murphy | d3aba04 | 2014-08-28 17:52:00 +0100 | [diff] [blame] | 17 | "arm,mmu-401" |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 18 | "arm,mmu-500" |
Tirumalesh Chalamarla | 1bd37a6 | 2016-03-04 13:56:09 -0800 | [diff] [blame] | 19 | "cavium,smmu-v2" |
Patrick Daly | f0d4e21 | 2016-06-20 15:50:14 -0700 | [diff] [blame] | 20 | "qcom,smmu-v2" |
Patrick Daly | 1f8a288 | 2016-09-12 17:32:05 -0700 | [diff] [blame] | 21 | "qcom,qsmmu-v500" |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 22 | |
| 23 | depending on the particular implementation and/or the |
| 24 | version of the architecture implemented. |
| 25 | |
| 26 | - reg : Base address and size of the SMMU. |
| 27 | |
Patrick Daly | a0fddb6 | 2017-03-27 19:26:59 -0700 | [diff] [blame] | 28 | - reg-names : For the "qcom,qsmmu-v500" device "tcu-base" is expected. |
| 29 | |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 30 | - #global-interrupts : The number of global interrupts exposed by the |
| 31 | device. |
| 32 | |
| 33 | - interrupts : Interrupt list, with the first #global-irqs entries |
| 34 | corresponding to the global interrupts and any |
| 35 | following entries corresponding to context interrupts, |
| 36 | specified in order of their indexing by the SMMU. |
| 37 | |
| 38 | For SMMUv2 implementations, there must be exactly one |
| 39 | interrupt per context bank. In the case of a single, |
| 40 | combined interrupt, it must be listed multiple times. |
| 41 | |
Robin Murphy | b79802e | 2016-09-12 17:13:56 +0100 | [diff] [blame] | 42 | - #iommu-cells : See Documentation/devicetree/bindings/iommu/iommu.txt |
| 43 | for details. With a value of 1, each "iommus" entry |
| 44 | represents a distinct stream ID emitted by that device |
| 45 | into the relevant SMMU. |
| 46 | |
| 47 | SMMUs with stream matching support and complex masters |
| 48 | may use a value of 2, where the second cell represents |
| 49 | an SMR mask to combine with the ID in the first cell. |
| 50 | Care must be taken to ensure the set of matched IDs |
| 51 | does not result in conflicts. |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 52 | |
| 53 | ** System MMU optional properties: |
| 54 | |
Robin Murphy | bae2c2d | 2015-07-29 19:46:05 +0100 | [diff] [blame] | 55 | - dma-coherent : Present if page table walks made by the SMMU are |
| 56 | cache coherent with the CPU. |
| 57 | |
| 58 | NOTE: this only applies to the SMMU itself, not |
| 59 | masters connected upstream of the SMMU. |
| 60 | |
Andreas Herrmann | 0c9d70d | 2014-01-30 20:17:52 +0000 | [diff] [blame] | 61 | - calxeda,smmu-secure-config-access : Enable proper handling of buggy |
| 62 | implementations that always use secure access to |
| 63 | SMMU configuration registers. In this case non-secure |
| 64 | aliases of secure registers have to be used during |
| 65 | SMMU configuration. |
| 66 | |
Mitchel Humpherys | 5494a5e | 2014-08-14 17:44:49 -0700 | [diff] [blame] | 67 | - attach-impl-defs : global registers to program at device attach |
| 68 | time. This should be a list of 2-tuples of the format: |
| 69 | <offset reg_value>. |
| 70 | |
Mitchel Humpherys | 07ba44b | 2015-01-30 14:58:52 -0800 | [diff] [blame] | 71 | - qcom,fatal-asf : Enable BUG_ON for address size faults. Some hardware |
| 72 | requires special fixups to recover from address size |
| 73 | faults. Rather than applying the fixups just BUG since |
| 74 | address size faults are due to a fundamental programming |
| 75 | error from which we don't care about recovering anyways. |
| 76 | |
Patrick Daly | 59b6d20 | 2017-06-12 13:12:15 -0700 | [diff] [blame] | 77 | - qcom,skip-init : Disable resetting configuration for all context banks |
| 78 | during device reset. This is useful for targets where |
| 79 | some context banks are dedicated to other execution |
| 80 | environments outside of Linux and those other EEs are |
| 81 | programming their own stream match tables, SCTLR, etc. |
| 82 | Without setting this option we will trample on their |
| 83 | configuration. |
| 84 | |
Patrick Daly | c190d93 | 2016-08-30 17:23:28 -0700 | [diff] [blame] | 85 | - qcom,dynamic : Allow dynamic domains to be attached. This is only |
| 86 | useful if the upstream hardware is capable of switching |
| 87 | between multiple domains within a single context bank. |
| 88 | |
Patrick Daly | 4423d3e | 2017-05-04 18:17:51 -0700 | [diff] [blame] | 89 | - qcom,use-3-lvl-tables: |
| 90 | Some hardware configurations may not be optimized for using |
| 91 | a four level page table configuration. Set to use a three |
| 92 | level page table instead. |
| 93 | |
Patrick Daly | e706934 | 2017-07-11 12:35:55 -0700 | [diff] [blame] | 94 | - qcom,no-asid-retention: |
| 95 | Some hardware may lose internal state for asid after |
| 96 | retention. No cache invalidation operations involving asid |
| 97 | may be used. |
| 98 | |
Prakash Gupta | fad87ca | 2017-05-16 12:13:02 +0530 | [diff] [blame] | 99 | - qcom,deferred-regulator-disable-delay : The time delay for deferred regulator |
| 100 | disable in ms. In case of unmap call, regulator is |
| 101 | enabled/disabled. This may introduce additional delay. For |
| 102 | clients who do not detach, it's not possible to keep regulator |
| 103 | vote while smmu is attached. Type is <u32>. |
| 104 | |
Patrick Daly | 3a8a88a | 2016-07-22 12:24:05 -0700 | [diff] [blame] | 105 | - clocks : List of clocks to be used during SMMU register access. See |
| 106 | Documentation/devicetree/bindings/clock/clock-bindings.txt |
| 107 | for information about the format. For each clock specified |
| 108 | here, there must be a corresponding entry in clock-names |
| 109 | (see below). |
| 110 | |
| 111 | - clock-names : List of clock names corresponding to the clocks specified in |
| 112 | the "clocks" property (above). See |
| 113 | Documentation/devicetree/bindings/clock/clock-bindings.txt |
| 114 | for more info. |
| 115 | |
Patrick Daly | 5b3d8c6 | 2016-11-01 15:34:11 -0700 | [diff] [blame] | 116 | - (%s)-supply : Phandle of the regulator that should be powered on during |
| 117 | SMMU register access. (%s) is a string from the |
| 118 | qcom,regulator-names property. |
| 119 | |
| 120 | - qcom,regulator-names : |
| 121 | List of strings to use with the (%s)-supply property. |
Mitchel Humpherys | f7666ae | 2014-07-23 17:35:07 -0700 | [diff] [blame] | 122 | |
Patrick Daly | cf7b0de | 2016-10-06 17:04:49 -0700 | [diff] [blame] | 123 | - qcom,msm-bus,name |
| 124 | - qcom,msm-bus,num-cases |
| 125 | - qcom,msm-bus,num-paths |
| 126 | - qcom,msm-bus,vectors-KBps |
| 127 | : Refer to devicetree/bindings/arm/msm/msm_bus.txt |
Patrick Daly | 2764f95 | 2016-09-06 19:22:44 -0700 | [diff] [blame] | 128 | |
Robin Murphy | b79802e | 2016-09-12 17:13:56 +0100 | [diff] [blame] | 129 | ** Deprecated properties: |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 130 | |
Robin Murphy | b79802e | 2016-09-12 17:13:56 +0100 | [diff] [blame] | 131 | - mmu-masters (deprecated in favour of the generic "iommus" binding) : |
| 132 | A list of phandles to device nodes representing bus |
| 133 | masters for which the SMMU can provide a translation |
| 134 | and their corresponding Stream IDs. Each device node |
| 135 | linked from this list must have a "#stream-id-cells" |
| 136 | property, indicating the number of Stream ID |
| 137 | arguments associated with its phandle. |
| 138 | |
| 139 | ** Examples: |
| 140 | |
| 141 | /* SMMU with stream matching or stream indexing */ |
| 142 | smmu1: iommu { |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 143 | compatible = "arm,smmu-v1"; |
| 144 | reg = <0xba5e0000 0x10000>; |
| 145 | #global-interrupts = <2>; |
| 146 | interrupts = <0 32 4>, |
| 147 | <0 33 4>, |
| 148 | <0 34 4>, /* This is the first context interrupt */ |
| 149 | <0 35 4>, |
| 150 | <0 36 4>, |
| 151 | <0 37 4>; |
Robin Murphy | b79802e | 2016-09-12 17:13:56 +0100 | [diff] [blame] | 152 | #iommu-cells = <1>; |
| 153 | }; |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 154 | |
Robin Murphy | b79802e | 2016-09-12 17:13:56 +0100 | [diff] [blame] | 155 | /* device with two stream IDs, 0 and 7 */ |
| 156 | master1 { |
| 157 | iommus = <&smmu1 0>, |
| 158 | <&smmu1 7>; |
| 159 | }; |
Mitchel Humpherys | 5494a5e | 2014-08-14 17:44:49 -0700 | [diff] [blame] | 160 | |
Robin Murphy | b79802e | 2016-09-12 17:13:56 +0100 | [diff] [blame] | 161 | |
| 162 | /* SMMU with stream matching */ |
| 163 | smmu2: iommu { |
| 164 | ... |
| 165 | #iommu-cells = <2>; |
| 166 | }; |
| 167 | |
| 168 | /* device with stream IDs 0 and 7 */ |
| 169 | master2 { |
| 170 | iommus = <&smmu2 0 0>, |
| 171 | <&smmu2 7 0>; |
| 172 | }; |
| 173 | |
| 174 | /* device with stream IDs 1, 17, 33 and 49 */ |
| 175 | master3 { |
| 176 | iommus = <&smmu2 1 0x30>; |
Will Deacon | 98c33c5 | 2013-06-24 18:31:24 +0100 | [diff] [blame] | 177 | }; |
Patrick Daly | 1f8a288 | 2016-09-12 17:32:05 -0700 | [diff] [blame] | 178 | |
| 179 | |
| 180 | * Qualcomm MMU-500 TBU Device |
| 181 | |
| 182 | The qcom,qsmmu-v500 device implements a number of register regions containing |
| 183 | debug functionality. Each register region maps to a separate tbu from the |
| 184 | arm mmu-500 implementation. |
| 185 | |
| 186 | ** TBU required properties: |
| 187 | |
| 188 | - compatible : Should be one of: |
| 189 | "qcom,qsmmuv500-tbu" |
| 190 | |
| 191 | - reg : Base address and size. |
| 192 | |
| 193 | - reg-names : "base" and "status-reg" are expected |
| 194 | "base" is the main TBU register region. |
| 195 | "status-reg" indicates whether hw can process a new request. |
| 196 | |
Patrick Daly | 63b0e2c | 2016-11-01 16:58:57 -0700 | [diff] [blame] | 197 | -qcom,stream-id-range: |
| 198 | Pair of values describing the smallest supported stream-id |
| 199 | and the size of the entire set. |
Patrick Daly | 1f8a288 | 2016-09-12 17:32:05 -0700 | [diff] [blame] | 200 | |
| 201 | Example: |
| 202 | smmu { |
| 203 | compatible = "qcom,qsmmu-v500"; |
| 204 | tbu@0x1000 { |
| 205 | compatible = "qcom,qsmmuv500-tbu"; |
| 206 | regs = <0x1000 0x1000>, |
| 207 | <0x2000 0x8>; |
| 208 | reg-names = "base", |
| 209 | "status-reg"; |
Patrick Daly | 63b0e2c | 2016-11-01 16:58:57 -0700 | [diff] [blame] | 210 | qcom,stream-id-range = <0x800 0x400>; |
Patrick Daly | 1f8a288 | 2016-09-12 17:32:05 -0700 | [diff] [blame] | 211 | }; |
| 212 | }; |