1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2c66ec88fSEmmanuel Vadot%YAML 1.2 3c66ec88fSEmmanuel Vadot--- 4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra186-mc.yaml# 5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c66ec88fSEmmanuel Vadot 7c66ec88fSEmmanuel Vadottitle: NVIDIA Tegra186 (and later) SoC Memory Controller 8c66ec88fSEmmanuel Vadot 9c66ec88fSEmmanuel Vadotmaintainers: 10c66ec88fSEmmanuel Vadot - Jon Hunter <jonathanh@nvidia.com> 11c66ec88fSEmmanuel Vadot - Thierry Reding <thierry.reding@gmail.com> 12c66ec88fSEmmanuel Vadot 13c66ec88fSEmmanuel Vadotdescription: | 14c66ec88fSEmmanuel Vadot The NVIDIA Tegra186 SoC features a 128 bit memory controller that is split 15c66ec88fSEmmanuel Vadot into four 32 bit channels to support LPDDR4 with x16 subpartitions. The MC 16c66ec88fSEmmanuel Vadot handles memory requests for 40-bit virtual addresses from internal clients 17c66ec88fSEmmanuel Vadot and arbitrates among them to allocate memory bandwidth. 18c66ec88fSEmmanuel Vadot 19c66ec88fSEmmanuel Vadot Up to 15 GiB of physical memory can be supported. Security features such as 20c66ec88fSEmmanuel Vadot encryption of traffic to and from DRAM via general security apertures are 21c66ec88fSEmmanuel Vadot available for video and other secure applications, as well as DRAM ECC for 22c66ec88fSEmmanuel Vadot automotive safety applications (single bit error correction and double bit 23c66ec88fSEmmanuel Vadot error detection). 24c66ec88fSEmmanuel Vadot 25c66ec88fSEmmanuel Vadotproperties: 26c66ec88fSEmmanuel Vadot $nodename: 27c66ec88fSEmmanuel Vadot pattern: "^memory-controller@[0-9a-f]+$" 28c66ec88fSEmmanuel Vadot 29c66ec88fSEmmanuel Vadot compatible: 30c66ec88fSEmmanuel Vadot items: 31c66ec88fSEmmanuel Vadot - enum: 32c66ec88fSEmmanuel Vadot - nvidia,tegra186-mc 33c66ec88fSEmmanuel Vadot - nvidia,tegra194-mc 34e67e8565SEmmanuel Vadot - nvidia,tegra234-mc 35c66ec88fSEmmanuel Vadot 36c66ec88fSEmmanuel Vadot reg: 37*d5b0e70fSEmmanuel Vadot minItems: 6 38*d5b0e70fSEmmanuel Vadot maxItems: 18 39*d5b0e70fSEmmanuel Vadot 40*d5b0e70fSEmmanuel Vadot reg-names: 41*d5b0e70fSEmmanuel Vadot minItems: 6 42*d5b0e70fSEmmanuel Vadot maxItems: 18 43c66ec88fSEmmanuel Vadot 44c66ec88fSEmmanuel Vadot interrupts: 45e67e8565SEmmanuel Vadot items: 46e67e8565SEmmanuel Vadot - description: MC general interrupt 47c66ec88fSEmmanuel Vadot 48c66ec88fSEmmanuel Vadot "#address-cells": 49c66ec88fSEmmanuel Vadot const: 2 50c66ec88fSEmmanuel Vadot 51c66ec88fSEmmanuel Vadot "#size-cells": 52c66ec88fSEmmanuel Vadot const: 2 53c66ec88fSEmmanuel Vadot 54c66ec88fSEmmanuel Vadot ranges: true 55c66ec88fSEmmanuel Vadot 56c66ec88fSEmmanuel Vadot dma-ranges: true 57c66ec88fSEmmanuel Vadot 58e67e8565SEmmanuel Vadot "#interconnect-cells": 59e67e8565SEmmanuel Vadot const: 1 60e67e8565SEmmanuel Vadot 61c66ec88fSEmmanuel VadotpatternProperties: 62c66ec88fSEmmanuel Vadot "^external-memory-controller@[0-9a-f]+$": 63c66ec88fSEmmanuel Vadot description: 64c66ec88fSEmmanuel Vadot The bulk of the work involved in controlling the external memory 65c66ec88fSEmmanuel Vadot controller on NVIDIA Tegra186 and later is performed on the BPMP. This 66c66ec88fSEmmanuel Vadot coprocessor exposes the EMC clock that is used to set the frequency at 67c66ec88fSEmmanuel Vadot which the external memory is clocked and a remote procedure call that 68c66ec88fSEmmanuel Vadot can be used to obtain the set of available frequencies. 69c66ec88fSEmmanuel Vadot type: object 70c66ec88fSEmmanuel Vadot properties: 71c66ec88fSEmmanuel Vadot compatible: 72c66ec88fSEmmanuel Vadot items: 73c66ec88fSEmmanuel Vadot - enum: 74c66ec88fSEmmanuel Vadot - nvidia,tegra186-emc 75c66ec88fSEmmanuel Vadot - nvidia,tegra194-emc 76e67e8565SEmmanuel Vadot - nvidia,tegra234-emc 77c66ec88fSEmmanuel Vadot 78c66ec88fSEmmanuel Vadot reg: 79e67e8565SEmmanuel Vadot minItems: 1 80e67e8565SEmmanuel Vadot maxItems: 2 81c66ec88fSEmmanuel Vadot 82c66ec88fSEmmanuel Vadot interrupts: 83e67e8565SEmmanuel Vadot items: 84e67e8565SEmmanuel Vadot - description: EMC general interrupt 85c66ec88fSEmmanuel Vadot 86c66ec88fSEmmanuel Vadot clocks: 87c66ec88fSEmmanuel Vadot items: 88c66ec88fSEmmanuel Vadot - description: external memory clock 89c66ec88fSEmmanuel Vadot 90c66ec88fSEmmanuel Vadot clock-names: 91c66ec88fSEmmanuel Vadot items: 92c66ec88fSEmmanuel Vadot - const: emc 93c66ec88fSEmmanuel Vadot 94e67e8565SEmmanuel Vadot "#interconnect-cells": 95e67e8565SEmmanuel Vadot const: 0 96e67e8565SEmmanuel Vadot 97c66ec88fSEmmanuel Vadot nvidia,bpmp: 98c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 99c66ec88fSEmmanuel Vadot description: 100c66ec88fSEmmanuel Vadot phandle of the node representing the BPMP 101c66ec88fSEmmanuel Vadot 102e67e8565SEmmanuel Vadot allOf: 103e67e8565SEmmanuel Vadot - if: 104e67e8565SEmmanuel Vadot properties: 105e67e8565SEmmanuel Vadot compatible: 106e67e8565SEmmanuel Vadot const: nvidia,tegra186-emc 107e67e8565SEmmanuel Vadot then: 108e67e8565SEmmanuel Vadot properties: 109e67e8565SEmmanuel Vadot reg: 110e67e8565SEmmanuel Vadot maxItems: 1 111e67e8565SEmmanuel Vadot 112e67e8565SEmmanuel Vadot - if: 113e67e8565SEmmanuel Vadot properties: 114e67e8565SEmmanuel Vadot compatible: 115e67e8565SEmmanuel Vadot const: nvidia,tegra194-emc 116e67e8565SEmmanuel Vadot then: 117e67e8565SEmmanuel Vadot properties: 118e67e8565SEmmanuel Vadot reg: 119e67e8565SEmmanuel Vadot minItems: 2 120e67e8565SEmmanuel Vadot 121e67e8565SEmmanuel Vadot - if: 122e67e8565SEmmanuel Vadot properties: 123e67e8565SEmmanuel Vadot compatible: 124e67e8565SEmmanuel Vadot const: nvidia,tegra234-emc 125e67e8565SEmmanuel Vadot then: 126e67e8565SEmmanuel Vadot properties: 127e67e8565SEmmanuel Vadot reg: 128e67e8565SEmmanuel Vadot minItems: 2 129e67e8565SEmmanuel Vadot 130e67e8565SEmmanuel Vadot additionalProperties: false 131e67e8565SEmmanuel Vadot 132e67e8565SEmmanuel Vadot required: 133e67e8565SEmmanuel Vadot - compatible 134e67e8565SEmmanuel Vadot - reg 135e67e8565SEmmanuel Vadot - interrupts 136e67e8565SEmmanuel Vadot - clocks 137e67e8565SEmmanuel Vadot - clock-names 138e67e8565SEmmanuel Vadot - "#interconnect-cells" 139e67e8565SEmmanuel Vadot - nvidia,bpmp 140e67e8565SEmmanuel Vadot 141e67e8565SEmmanuel VadotallOf: 142e67e8565SEmmanuel Vadot - if: 143e67e8565SEmmanuel Vadot properties: 144e67e8565SEmmanuel Vadot compatible: 145e67e8565SEmmanuel Vadot const: nvidia,tegra186-mc 146e67e8565SEmmanuel Vadot then: 147e67e8565SEmmanuel Vadot properties: 148e67e8565SEmmanuel Vadot reg: 149*d5b0e70fSEmmanuel Vadot maxItems: 6 150*d5b0e70fSEmmanuel Vadot description: 5 memory controller channels and 1 for stream-id registers 151*d5b0e70fSEmmanuel Vadot 152*d5b0e70fSEmmanuel Vadot reg-names: 153*d5b0e70fSEmmanuel Vadot items: 154*d5b0e70fSEmmanuel Vadot - const: sid 155*d5b0e70fSEmmanuel Vadot - const: broadcast 156*d5b0e70fSEmmanuel Vadot - const: ch0 157*d5b0e70fSEmmanuel Vadot - const: ch1 158*d5b0e70fSEmmanuel Vadot - const: ch2 159*d5b0e70fSEmmanuel Vadot - const: ch3 160e67e8565SEmmanuel Vadot 161e67e8565SEmmanuel Vadot - if: 162e67e8565SEmmanuel Vadot properties: 163e67e8565SEmmanuel Vadot compatible: 164e67e8565SEmmanuel Vadot const: nvidia,tegra194-mc 165e67e8565SEmmanuel Vadot then: 166e67e8565SEmmanuel Vadot properties: 167e67e8565SEmmanuel Vadot reg: 168*d5b0e70fSEmmanuel Vadot minItems: 18 169*d5b0e70fSEmmanuel Vadot description: 17 memory controller channels and 1 for stream-id registers 170*d5b0e70fSEmmanuel Vadot 171*d5b0e70fSEmmanuel Vadot reg-names: 172*d5b0e70fSEmmanuel Vadot items: 173*d5b0e70fSEmmanuel Vadot - const: sid 174*d5b0e70fSEmmanuel Vadot - const: broadcast 175*d5b0e70fSEmmanuel Vadot - const: ch0 176*d5b0e70fSEmmanuel Vadot - const: ch1 177*d5b0e70fSEmmanuel Vadot - const: ch2 178*d5b0e70fSEmmanuel Vadot - const: ch3 179*d5b0e70fSEmmanuel Vadot - const: ch4 180*d5b0e70fSEmmanuel Vadot - const: ch5 181*d5b0e70fSEmmanuel Vadot - const: ch6 182*d5b0e70fSEmmanuel Vadot - const: ch7 183*d5b0e70fSEmmanuel Vadot - const: ch8 184*d5b0e70fSEmmanuel Vadot - const: ch9 185*d5b0e70fSEmmanuel Vadot - const: ch10 186*d5b0e70fSEmmanuel Vadot - const: ch11 187*d5b0e70fSEmmanuel Vadot - const: ch12 188*d5b0e70fSEmmanuel Vadot - const: ch13 189*d5b0e70fSEmmanuel Vadot - const: ch14 190*d5b0e70fSEmmanuel Vadot - const: ch15 191e67e8565SEmmanuel Vadot 192e67e8565SEmmanuel Vadot - if: 193e67e8565SEmmanuel Vadot properties: 194e67e8565SEmmanuel Vadot compatible: 195e67e8565SEmmanuel Vadot const: nvidia,tegra234-mc 196e67e8565SEmmanuel Vadot then: 197e67e8565SEmmanuel Vadot properties: 198e67e8565SEmmanuel Vadot reg: 199*d5b0e70fSEmmanuel Vadot minItems: 18 200*d5b0e70fSEmmanuel Vadot description: 17 memory controller channels and 1 for stream-id registers 201*d5b0e70fSEmmanuel Vadot 202*d5b0e70fSEmmanuel Vadot reg-names: 203*d5b0e70fSEmmanuel Vadot items: 204*d5b0e70fSEmmanuel Vadot - const: sid 205*d5b0e70fSEmmanuel Vadot - const: broadcast 206*d5b0e70fSEmmanuel Vadot - const: ch0 207*d5b0e70fSEmmanuel Vadot - const: ch1 208*d5b0e70fSEmmanuel Vadot - const: ch2 209*d5b0e70fSEmmanuel Vadot - const: ch3 210*d5b0e70fSEmmanuel Vadot - const: ch4 211*d5b0e70fSEmmanuel Vadot - const: ch5 212*d5b0e70fSEmmanuel Vadot - const: ch6 213*d5b0e70fSEmmanuel Vadot - const: ch7 214*d5b0e70fSEmmanuel Vadot - const: ch8 215*d5b0e70fSEmmanuel Vadot - const: ch9 216*d5b0e70fSEmmanuel Vadot - const: ch10 217*d5b0e70fSEmmanuel Vadot - const: ch11 218*d5b0e70fSEmmanuel Vadot - const: ch12 219*d5b0e70fSEmmanuel Vadot - const: ch13 220*d5b0e70fSEmmanuel Vadot - const: ch14 221*d5b0e70fSEmmanuel Vadot - const: ch15 222e67e8565SEmmanuel Vadot 223e67e8565SEmmanuel VadotadditionalProperties: false 224e67e8565SEmmanuel Vadot 225c66ec88fSEmmanuel Vadotrequired: 226c66ec88fSEmmanuel Vadot - compatible 227c66ec88fSEmmanuel Vadot - reg 228*d5b0e70fSEmmanuel Vadot - reg-names 229c66ec88fSEmmanuel Vadot - interrupts 230c66ec88fSEmmanuel Vadot - "#address-cells" 231c66ec88fSEmmanuel Vadot - "#size-cells" 232c66ec88fSEmmanuel Vadot 233c66ec88fSEmmanuel Vadotexamples: 234c66ec88fSEmmanuel Vadot - | 235c66ec88fSEmmanuel Vadot #include <dt-bindings/clock/tegra186-clock.h> 236c66ec88fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 237c66ec88fSEmmanuel Vadot 238c66ec88fSEmmanuel Vadot bus { 239c66ec88fSEmmanuel Vadot #address-cells = <2>; 240c66ec88fSEmmanuel Vadot #size-cells = <2>; 241c66ec88fSEmmanuel Vadot 242c66ec88fSEmmanuel Vadot memory-controller@2c00000 { 243c66ec88fSEmmanuel Vadot compatible = "nvidia,tegra186-mc"; 244*d5b0e70fSEmmanuel Vadot reg = <0x0 0x02c00000 0x0 0x10000>, /* MC-SID */ 245*d5b0e70fSEmmanuel Vadot <0x0 0x02c10000 0x0 0x10000>, /* Broadcast channel */ 246*d5b0e70fSEmmanuel Vadot <0x0 0x02c20000 0x0 0x10000>, /* MC0 */ 247*d5b0e70fSEmmanuel Vadot <0x0 0x02c30000 0x0 0x10000>, /* MC1 */ 248*d5b0e70fSEmmanuel Vadot <0x0 0x02c40000 0x0 0x10000>, /* MC2 */ 249*d5b0e70fSEmmanuel Vadot <0x0 0x02c50000 0x0 0x10000>; /* MC3 */ 250*d5b0e70fSEmmanuel Vadot reg-names = "sid", "broadcast", "ch0", "ch1", "ch2", "ch3"; 251c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>; 252c66ec88fSEmmanuel Vadot 253c66ec88fSEmmanuel Vadot #address-cells = <2>; 254c66ec88fSEmmanuel Vadot #size-cells = <2>; 255c66ec88fSEmmanuel Vadot 256c66ec88fSEmmanuel Vadot ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>; 257c66ec88fSEmmanuel Vadot 258c66ec88fSEmmanuel Vadot /* 259c66ec88fSEmmanuel Vadot * Memory clients have access to all 40 bits that the memory 260c66ec88fSEmmanuel Vadot * controller can address. 261c66ec88fSEmmanuel Vadot */ 262c66ec88fSEmmanuel Vadot dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>; 263c66ec88fSEmmanuel Vadot 264c66ec88fSEmmanuel Vadot external-memory-controller@2c60000 { 265c66ec88fSEmmanuel Vadot compatible = "nvidia,tegra186-emc"; 266c66ec88fSEmmanuel Vadot reg = <0x0 0x02c60000 0x0 0x50000>; 267c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 268c66ec88fSEmmanuel Vadot clocks = <&bpmp TEGRA186_CLK_EMC>; 269c66ec88fSEmmanuel Vadot clock-names = "emc"; 270c66ec88fSEmmanuel Vadot 271e67e8565SEmmanuel Vadot #interconnect-cells = <0>; 272e67e8565SEmmanuel Vadot 273c66ec88fSEmmanuel Vadot nvidia,bpmp = <&bpmp>; 274c66ec88fSEmmanuel Vadot }; 275c66ec88fSEmmanuel Vadot }; 276c66ec88fSEmmanuel Vadot }; 277