Merge tag 'memory-controller-drv-tegra-5.11-2' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / memory-controllers / nvidia,tegra20-emc.txt
1 Embedded Memory Controller
2
3 Properties:
4 - name : Should be emc
5 - #address-cells : Should be 1
6 - #size-cells : Should be 0
7 - compatible : Should contain "nvidia,tegra20-emc".
8 - reg : Offset and length of the register set for the device
9 - nvidia,use-ram-code : If present, the sub-nodes will be addressed
10   and chosen using the ramcode board selector. If omitted, only one
11   set of tables can be present and said tables will be used
12   irrespective of ram-code configuration.
13 - interrupts : Should contain EMC General interrupt.
14 - clocks : Should contain EMC clock.
15 - nvidia,memory-controller : Phandle of the Memory Controller node.
16 - #interconnect-cells : Should be 0.
17 - operating-points-v2: See ../bindings/opp/opp.txt for details.
18
19 Optional properties:
20 - core-supply: Phandle of voltage regulator of the SoC "core" power domain.
21
22 Child device nodes describe the memory settings for different configurations and clock rates.
23
24 Example:
25
26         opp_table: opp-table {
27                 compatible = "operating-points-v2";
28
29                 opp@36000000 {
30                         opp-microvolt = <950000 950000 1300000>;
31                         opp-hz = /bits/ 64 <36000000>;
32                 };
33                 ...
34         };
35
36         memory-controller@7000f400 {
37                 #address-cells = < 1 >;
38                 #size-cells = < 0 >;
39                 #interconnect-cells = <0>;
40                 compatible = "nvidia,tegra20-emc";
41                 reg = <0x7000f400 0x400>;
42                 interrupts = <0 78 0x04>;
43                 clocks = <&tegra_car TEGRA20_CLK_EMC>;
44                 nvidia,memory-controller = <&mc>;
45                 core-supply = <&core_vdd_reg>;
46                 operating-points-v2 = <&opp_table>;
47         }
48
49
50 Embedded Memory Controller ram-code table
51
52 If the emc node has the nvidia,use-ram-code property present, then the
53 next level of nodes below the emc table are used to specify which settings
54 apply for which ram-code settings.
55
56 If the emc node lacks the nvidia,use-ram-code property, this level is omitted
57 and the tables are stored directly under the emc node (see below).
58
59 Properties:
60
61 - name : Should be emc-tables
62 - nvidia,ram-code : the binary representation of the ram-code board strappings
63   for which this node (and children) are valid.
64
65
66
67 Embedded Memory Controller configuration table
68
69 This is a table containing the EMC register settings for the various
70 operating speeds of the memory controller. They are always located as
71 subnodes of the emc controller node.
72
73 There are two ways of specifying which tables to use:
74
75 * The simplest is if there is just one set of tables in the device tree,
76   and they will always be used (based on which frequency is used).
77   This is the preferred method, especially when firmware can fill in
78   this information based on the specific system information and just
79   pass it on to the kernel.
80
81 * The slightly more complex one is when more than one memory configuration
82   might exist on the system.  The Tegra20 platform handles this during
83   early boot by selecting one out of possible 4 memory settings based
84   on a 2-pin "ram code" bootstrap setting on the board. The values of
85   these strappings can be read through a register in the SoC, and thus
86   used to select which tables to use.
87
88 Properties:
89 - name : Should be emc-table
90 - compatible : Should contain "nvidia,tegra20-emc-table".
91 - reg : either an opaque enumerator to tell different tables apart, or
92   the valid frequency for which the table should be used (in kHz).
93 - clock-frequency : the clock frequency for the EMC at which this
94   table should be used (in kHz).
95 - nvidia,emc-registers : a 46 word array of EMC registers to be programmed
96   for operation at the 'clock-frequency' setting.
97   The order and contents of the registers are:
98     RC, RFC, RAS, RP, R2W, W2R, R2P, W2P, RD_RCD, WR_RCD, RRD, REXT,
99     WDV, QUSE, QRST, QSAFE, RDV, REFRESH, BURST_REFRESH_NUM, PDEX2WR,
100     PDEX2RD, PCHG2PDEN, ACT2PDEN, AR2PDEN, RW2PDEN, TXSR, TCKE, TFAW,
101     TRPAB, TCLKSTABLE, TCLKSTOP, TREFBW, QUSE_EXTRA, FBIO_CFG6, ODT_WRITE,
102     ODT_READ, FBIO_CFG5, CFG_DIG_DLL, DLL_XFORM_DQS, DLL_XFORM_QUSE,
103     ZCAL_REF_CNT, ZCAL_WAIT_CNT, AUTO_CAL_INTERVAL, CFG_CLKTRIM_0,
104     CFG_CLKTRIM_1, CFG_CLKTRIM_2
105
106                 emc-table@166000 {
107                         reg = <166000>;
108                         compatible = "nvidia,tegra20-emc-table";
109                         clock-frequency = < 166000 >;
110                         nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0
111                                                  0 0 0 0 0 0 0 0 0 0 0 0 0 0
112                                                  0 0 0 0 0 0 0 0 0 0 0 0 0 0
113                                                  0 0 0 0 >;
114                 };
115
116                 emc-table@333000 {
117                         reg = <333000>;
118                         compatible = "nvidia,tegra20-emc-table";
119                         clock-frequency = < 333000 >;
120                         nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0
121                                                  0 0 0 0 0 0 0 0 0 0 0 0 0 0
122                                                  0 0 0 0 0 0 0 0 0 0 0 0 0 0
123                                                  0 0 0 0 >;
124                 };