]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arm64: tegra: Add the memory subsystem on Tegra194
authorThierry Reding <treding@nvidia.com>
Sun, 22 Dec 2019 14:10:35 +0000 (15:10 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 9 Jan 2020 18:15:09 +0000 (19:15 +0100)
The memory subsystem on Tegra194 encompasses both the memory and
external memory controllers. The EMC is represented as a subnode of the
MC and a ranges property is used to describe the register ranges.

A dma-ranges property is also added to describe that all memory clients
can address up to 39 bits using the memory controller client interface
(MCCIF), unless otherwise limited by the DMA engines of the hardware. A
memory client can technically use 40 bits of addresses, but the memory
controller on Tegra194 uses bit 39 to determine the XBAR format used to
access memory. Use of this bit needs to be explicitly controlled by the
operating system drivers for devices that can use this on-the-fly format
conversion. Using the dma-ranges property prevents the operating system
from using the bit implicitly, for example in I/O virtual address
mappings.

Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
arch/arm64/boot/dts/nvidia/tegra194.dtsi

index c7f2a20e6b0215c583d6407935c3c6ab78bf549a..bdd33ff4e32400526ab39eb42bb59bacc9d8b79e 100644 (file)
@@ -48,6 +48,10 @@ phy: phy@0 {
                        };
                };
 
+               memory-controller@2c00000 {
+                       status = "okay";
+               };
+
                serial@3110000 {
                        status = "okay";
                };
index 11220d97adb8d3e2a929cabec1698bd3394b9fad..96dd0d7a9dde911c56f3eb019e7ab7b47db058bc 100644 (file)
@@ -7,6 +7,7 @@
 #include <dt-bindings/power/tegra194-powergate.h>
 #include <dt-bindings/reset/tegra194-reset.h>
 #include <dt-bindings/thermal/tegra194-bpmp-thermal.h>
+#include <dt-bindings/memory/tegra194-mc.h>
 
 / {
        compatible = "nvidia,tegra194";
@@ -164,6 +165,48 @@ clkreq {
                        };
                };
 
+               mc: memory-controller@2c00000 {
+                       compatible = "nvidia,tegra194-mc";
+                       reg = <0x02c00000 0x100000>,
+                             <0x02b80000 0x040000>,
+                             <0x01700000 0x100000>;
+                       status = "disabled";
+
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+
+                       ranges = <0x01700000 0x0 0x01700000 0x0 0x100000>,
+                                <0x02b80000 0x0 0x02b80000 0x0 0x040000>,
+                                <0x02c00000 0x0 0x02c00000 0x0 0x100000>;
+
+                       /*
+                        * Bit 39 of addresses passing through the memory
+                        * controller selects the XBAR format used when memory
+                        * is accessed. This is used to transparently access
+                        * memory in the XBAR format used by the discrete GPU
+                        * (bit 39 set) or Tegra (bit 39 clear).
+                        *
+                        * As a consequence, the operating system must ensure
+                        * that bit 39 is never used implicitly, for example
+                        * via an I/O virtual address mapping of an IOMMU. If
+                        * devices require access to the XBAR switch, their
+                        * drivers must set this bit explicitly.
+                        *
+                        * Limit the DMA range for memory clients to [38:0].
+                        */
+                       dma-ranges = <0x0 0x0 0x0 0x80 0x0>;
+
+                       emc: external-memory-controller@2c60000 {
+                               compatible = "nvidia,tegra194-emc";
+                               reg = <0x0 0x02c60000 0x0 0x90000>,
+                                     <0x0 0x01780000 0x0 0x80000>;
+                               clocks = <&bpmp TEGRA194_CLK_EMC>;
+                               clock-names = "emc";
+
+                               nvidia,bpmp = <&bpmp>;
+                       };
+               };
+
                uarta: serial@3100000 {
                        compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
                        reg = <0x03100000 0x40>;