1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra186-mc.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: NVIDIA Tegra186 (and later) SoC Memory Controller
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Jon Hunter <jonathanh@nvidia.com>
11*4882a593Smuzhiyun  - Thierry Reding <thierry.reding@gmail.com>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription: |
14*4882a593Smuzhiyun  The NVIDIA Tegra186 SoC features a 128 bit memory controller that is split
15*4882a593Smuzhiyun  into four 32 bit channels to support LPDDR4 with x16 subpartitions. The MC
16*4882a593Smuzhiyun  handles memory requests for 40-bit virtual addresses from internal clients
17*4882a593Smuzhiyun  and arbitrates among them to allocate memory bandwidth.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun  Up to 15 GiB of physical memory can be supported. Security features such as
20*4882a593Smuzhiyun  encryption of traffic to and from DRAM via general security apertures are
21*4882a593Smuzhiyun  available for video and other secure applications, as well as DRAM ECC for
22*4882a593Smuzhiyun  automotive safety applications (single bit error correction and double bit
23*4882a593Smuzhiyun  error detection).
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunproperties:
26*4882a593Smuzhiyun  $nodename:
27*4882a593Smuzhiyun    pattern: "^memory-controller@[0-9a-f]+$"
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun  compatible:
30*4882a593Smuzhiyun    items:
31*4882a593Smuzhiyun      - enum:
32*4882a593Smuzhiyun          - nvidia,tegra186-mc
33*4882a593Smuzhiyun          - nvidia,tegra194-mc
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun  reg:
36*4882a593Smuzhiyun    maxItems: 1
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun  interrupts:
39*4882a593Smuzhiyun    maxItems: 1
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun  "#address-cells":
42*4882a593Smuzhiyun    const: 2
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun  "#size-cells":
45*4882a593Smuzhiyun    const: 2
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun  ranges: true
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun  dma-ranges: true
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunpatternProperties:
52*4882a593Smuzhiyun  "^external-memory-controller@[0-9a-f]+$":
53*4882a593Smuzhiyun    description:
54*4882a593Smuzhiyun      The bulk of the work involved in controlling the external memory
55*4882a593Smuzhiyun      controller on NVIDIA Tegra186 and later is performed on the BPMP. This
56*4882a593Smuzhiyun      coprocessor exposes the EMC clock that is used to set the frequency at
57*4882a593Smuzhiyun      which the external memory is clocked and a remote procedure call that
58*4882a593Smuzhiyun      can be used to obtain the set of available frequencies.
59*4882a593Smuzhiyun    type: object
60*4882a593Smuzhiyun    properties:
61*4882a593Smuzhiyun      compatible:
62*4882a593Smuzhiyun        items:
63*4882a593Smuzhiyun          - enum:
64*4882a593Smuzhiyun              - nvidia,tegra186-emc
65*4882a593Smuzhiyun              - nvidia,tegra194-emc
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun      reg:
68*4882a593Smuzhiyun        maxItems: 1
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun      interrupts:
71*4882a593Smuzhiyun        maxItems: 1
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun      clocks:
74*4882a593Smuzhiyun        items:
75*4882a593Smuzhiyun          - description: external memory clock
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun      clock-names:
78*4882a593Smuzhiyun        items:
79*4882a593Smuzhiyun          - const: emc
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun      nvidia,bpmp:
82*4882a593Smuzhiyun        $ref: /schemas/types.yaml#/definitions/phandle
83*4882a593Smuzhiyun        description:
84*4882a593Smuzhiyun          phandle of the node representing the BPMP
85*4882a593Smuzhiyun
86*4882a593Smuzhiyunrequired:
87*4882a593Smuzhiyun  - compatible
88*4882a593Smuzhiyun  - reg
89*4882a593Smuzhiyun  - interrupts
90*4882a593Smuzhiyun  - "#address-cells"
91*4882a593Smuzhiyun  - "#size-cells"
92*4882a593Smuzhiyun
93*4882a593SmuzhiyunadditionalProperties: false
94*4882a593Smuzhiyun
95*4882a593Smuzhiyunexamples:
96*4882a593Smuzhiyun  - |
97*4882a593Smuzhiyun    #include <dt-bindings/clock/tegra186-clock.h>
98*4882a593Smuzhiyun    #include <dt-bindings/interrupt-controller/arm-gic.h>
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun    bus {
101*4882a593Smuzhiyun        #address-cells = <2>;
102*4882a593Smuzhiyun        #size-cells = <2>;
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun        memory-controller@2c00000 {
105*4882a593Smuzhiyun            compatible = "nvidia,tegra186-mc";
106*4882a593Smuzhiyun            reg = <0x0 0x02c00000 0x0 0xb0000>;
107*4882a593Smuzhiyun            interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun            #address-cells = <2>;
110*4882a593Smuzhiyun            #size-cells = <2>;
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun            ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>;
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun            /*
115*4882a593Smuzhiyun             * Memory clients have access to all 40 bits that the memory
116*4882a593Smuzhiyun             * controller can address.
117*4882a593Smuzhiyun             */
118*4882a593Smuzhiyun            dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
119*4882a593Smuzhiyun
120*4882a593Smuzhiyun            external-memory-controller@2c60000 {
121*4882a593Smuzhiyun                compatible = "nvidia,tegra186-emc";
122*4882a593Smuzhiyun                reg = <0x0 0x02c60000 0x0 0x50000>;
123*4882a593Smuzhiyun                interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
124*4882a593Smuzhiyun                clocks = <&bpmp TEGRA186_CLK_EMC>;
125*4882a593Smuzhiyun                clock-names = "emc";
126*4882a593Smuzhiyun
127*4882a593Smuzhiyun                nvidia,bpmp = <&bpmp>;
128*4882a593Smuzhiyun            };
129*4882a593Smuzhiyun        };
130*4882a593Smuzhiyun    };
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun    bpmp: bpmp {
133*4882a593Smuzhiyun        compatible = "nvidia,tegra186-bpmp";
134*4882a593Smuzhiyun        #clock-cells = <1>;
135*4882a593Smuzhiyun    };
136