1*4882a593SmuzhiyunEmbedded Memory Controller
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunProperties:
4*4882a593Smuzhiyun- name : Should be emc
5*4882a593Smuzhiyun- #address-cells : Should be 1
6*4882a593Smuzhiyun- #size-cells : Should be 0
7*4882a593Smuzhiyun- compatible : Should contain "nvidia,tegra20-emc".
8*4882a593Smuzhiyun- reg : Offset and length of the register set for the device
9*4882a593Smuzhiyun- nvidia,use-ram-code : If present, the sub-nodes will be addressed
10*4882a593Smuzhiyun  and chosen using the ramcode board selector. If omitted, only one
11*4882a593Smuzhiyun  set of tables can be present and said tables will be used
12*4882a593Smuzhiyun  irrespective of ram-code configuration.
13*4882a593Smuzhiyun- interrupts : Should contain EMC General interrupt.
14*4882a593Smuzhiyun- clocks : Should contain EMC clock.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunChild device nodes describe the memory settings for different configurations and clock rates.
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunExample:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun	memory-controller@7000f400 {
21*4882a593Smuzhiyun		#address-cells = < 1 >;
22*4882a593Smuzhiyun		#size-cells = < 0 >;
23*4882a593Smuzhiyun		compatible = "nvidia,tegra20-emc";
24*4882a593Smuzhiyun		reg = <0x7000f4000 0x200>;
25*4882a593Smuzhiyun		interrupts = <0 78 0x04>;
26*4882a593Smuzhiyun		clocks = <&tegra_car TEGRA20_CLK_EMC>;
27*4882a593Smuzhiyun	}
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunEmbedded Memory Controller ram-code table
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunIf the emc node has the nvidia,use-ram-code property present, then the
33*4882a593Smuzhiyunnext level of nodes below the emc table are used to specify which settings
34*4882a593Smuzhiyunapply for which ram-code settings.
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunIf the emc node lacks the nvidia,use-ram-code property, this level is omitted
37*4882a593Smuzhiyunand the tables are stored directly under the emc node (see below).
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunProperties:
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun- name : Should be emc-tables
42*4882a593Smuzhiyun- nvidia,ram-code : the binary representation of the ram-code board strappings
43*4882a593Smuzhiyun  for which this node (and children) are valid.
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunEmbedded Memory Controller configuration table
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunThis is a table containing the EMC register settings for the various
50*4882a593Smuzhiyunoperating speeds of the memory controller. They are always located as
51*4882a593Smuzhiyunsubnodes of the emc controller node.
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunThere are two ways of specifying which tables to use:
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun* The simplest is if there is just one set of tables in the device tree,
56*4882a593Smuzhiyun  and they will always be used (based on which frequency is used).
57*4882a593Smuzhiyun  This is the preferred method, especially when firmware can fill in
58*4882a593Smuzhiyun  this information based on the specific system information and just
59*4882a593Smuzhiyun  pass it on to the kernel.
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun* The slightly more complex one is when more than one memory configuration
62*4882a593Smuzhiyun  might exist on the system.  The Tegra20 platform handles this during
63*4882a593Smuzhiyun  early boot by selecting one out of possible 4 memory settings based
64*4882a593Smuzhiyun  on a 2-pin "ram code" bootstrap setting on the board. The values of
65*4882a593Smuzhiyun  these strappings can be read through a register in the SoC, and thus
66*4882a593Smuzhiyun  used to select which tables to use.
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunProperties:
69*4882a593Smuzhiyun- name : Should be emc-table
70*4882a593Smuzhiyun- compatible : Should contain "nvidia,tegra20-emc-table".
71*4882a593Smuzhiyun- reg : either an opaque enumerator to tell different tables apart, or
72*4882a593Smuzhiyun  the valid frequency for which the table should be used (in kHz).
73*4882a593Smuzhiyun- clock-frequency : the clock frequency for the EMC at which this
74*4882a593Smuzhiyun  table should be used (in kHz).
75*4882a593Smuzhiyun- nvidia,emc-registers : a 46 word array of EMC registers to be programmed
76*4882a593Smuzhiyun  for operation at the 'clock-frequency' setting.
77*4882a593Smuzhiyun  The order and contents of the registers are:
78*4882a593Smuzhiyun    RC, RFC, RAS, RP, R2W, W2R, R2P, W2P, RD_RCD, WR_RCD, RRD, REXT,
79*4882a593Smuzhiyun    WDV, QUSE, QRST, QSAFE, RDV, REFRESH, BURST_REFRESH_NUM, PDEX2WR,
80*4882a593Smuzhiyun    PDEX2RD, PCHG2PDEN, ACT2PDEN, AR2PDEN, RW2PDEN, TXSR, TCKE, TFAW,
81*4882a593Smuzhiyun    TRPAB, TCLKSTABLE, TCLKSTOP, TREFBW, QUSE_EXTRA, FBIO_CFG6, ODT_WRITE,
82*4882a593Smuzhiyun    ODT_READ, FBIO_CFG5, CFG_DIG_DLL, DLL_XFORM_DQS, DLL_XFORM_QUSE,
83*4882a593Smuzhiyun    ZCAL_REF_CNT, ZCAL_WAIT_CNT, AUTO_CAL_INTERVAL, CFG_CLKTRIM_0,
84*4882a593Smuzhiyun    CFG_CLKTRIM_1, CFG_CLKTRIM_2
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun		emc-table@166000 {
87*4882a593Smuzhiyun			reg = <166000>;
88*4882a593Smuzhiyun			compatible = "nvidia,tegra20-emc-table";
89*4882a593Smuzhiyun			clock-frequency = < 166000 >;
90*4882a593Smuzhiyun			nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0
91*4882a593Smuzhiyun						 0 0 0 0 0 0 0 0 0 0 0 0 0 0
92*4882a593Smuzhiyun						 0 0 0 0 0 0 0 0 0 0 0 0 0 0
93*4882a593Smuzhiyun						 0 0 0 0 >;
94*4882a593Smuzhiyun		};
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun		emc-table@333000 {
97*4882a593Smuzhiyun			reg = <333000>;
98*4882a593Smuzhiyun			compatible = "nvidia,tegra20-emc-table";
99*4882a593Smuzhiyun			clock-frequency = < 333000 >;
100*4882a593Smuzhiyun			nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0
101*4882a593Smuzhiyun						 0 0 0 0 0 0 0 0 0 0 0 0 0 0
102*4882a593Smuzhiyun						 0 0 0 0 0 0 0 0 0 0 0 0 0 0
103*4882a593Smuzhiyun						 0 0 0 0 >;
104*4882a593Smuzhiyun		};
105