ba088f054cfcc8f6465bf6680fae5134c55ef0aa
[linux-2.6.git] / arch / arm / mach-tegra / board-enterprise-memory.c
1 /*
2  * Copyright (C) 2011 NVIDIA, Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16  * 02111-1307, USA
17  */
18
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21
22 #include "board-enterprise.h"
23 #include "tegra3_emc.h"
24
25
26 static const struct tegra_emc_table enterprise_emc_tables_h5tc2g[] = {
27         {
28                 0x32,       /* Rev 3.2 */
29                 12750,      /* SDRAM frequency */
30                 {
31                         0x00000000, /* EMC_RC */
32                         0x00000001, /* EMC_RFC */
33                         0x00000002, /* EMC_RAS */
34                         0x00000002, /* EMC_RP */
35                         0x00000004, /* EMC_R2W */
36                         0x00000004, /* EMC_W2R */
37                         0x00000001, /* EMC_R2P */
38                         0x00000005, /* EMC_W2P */
39                         0x00000002, /* EMC_RD_RCD */
40                         0x00000002, /* EMC_WR_RCD */
41                         0x00000001, /* EMC_RRD */
42                         0x00000001, /* EMC_REXT */
43                         0x00000000, /* EMC_WEXT */
44                         0x00000001, /* EMC_WDV */
45                         0x00000003, /* EMC_QUSE */
46                         0x00000001, /* EMC_QRST */
47                         0x00000009, /* EMC_QSAFE */
48                         0x0000000a, /* EMC_RDV */
49                         0x0000002f, /* EMC_REFRESH */
50                         0x00000000, /* EMC_BURST_REFRESH_NUM */
51                         0x0000000b, /* EMC_PRE_REFRESH_REQ_CNT */
52                         0x00000001, /* EMC_PDEX2WR */
53                         0x00000001, /* EMC_PDEX2RD */
54                         0x00000002, /* EMC_PCHG2PDEN */
55                         0x00000000, /* EMC_ACT2PDEN */
56                         0x00000001, /* EMC_AR2PDEN */
57                         0x00000007, /* EMC_RW2PDEN */
58                         0x00000002, /* EMC_TXSR */
59                         0x00000002, /* EMC_TXSRDLL */
60                         0x00000003, /* EMC_TCKE */
61                         0x00000008, /* EMC_TFAW */
62                         0x00000004, /* EMC_TRPAB */
63                         0x00000001, /* EMC_TCLKSTABLE */
64                         0x00000002, /* EMC_TCLKSTOP */
65                         0x00000036, /* EMC_TREFBW */
66                         0x00000004, /* EMC_QUSE_EXTRA */
67                         0x00000004, /* EMC_FBIO_CFG6 */
68                         0x00000000, /* EMC_ODT_WRITE */
69                         0x00000000, /* EMC_ODT_READ */
70                         0x00004282, /* EMC_FBIO_CFG5 */
71                         0x007800a4, /* EMC_CFG_DIG_DLL */
72                         0x00008000, /* EMC_CFG_DIG_DLL_PERIOD */
73                         0x000fc000, /* EMC_DLL_XFORM_DQS0 */
74                         0x000fc000, /* EMC_DLL_XFORM_DQS1 */
75                         0x000fc000, /* EMC_DLL_XFORM_DQS2 */
76                         0x000fc000, /* EMC_DLL_XFORM_DQS3 */
77                         0x000fc000, /* EMC_DLL_XFORM_DQS4 */
78                         0x000fc000, /* EMC_DLL_XFORM_DQS5 */
79                         0x000fc000, /* EMC_DLL_XFORM_DQS6 */
80                         0x000fc000, /* EMC_DLL_XFORM_DQS7 */
81                         0x00000000, /* EMC_DLL_XFORM_QUSE0 */
82                         0x00000000, /* EMC_DLL_XFORM_QUSE1 */
83                         0x00000000, /* EMC_DLL_XFORM_QUSE2 */
84                         0x00000000, /* EMC_DLL_XFORM_QUSE3 */
85                         0x00000000, /* EMC_DLL_XFORM_QUSE4 */
86                         0x00000000, /* EMC_DLL_XFORM_QUSE5 */
87                         0x00000000, /* EMC_DLL_XFORM_QUSE6 */
88                         0x00000000, /* EMC_DLL_XFORM_QUSE7 */
89                         0x00000000, /* EMC_DLI_TRIM_TXDQS0 */
90                         0x00000000, /* EMC_DLI_TRIM_TXDQS1 */
91                         0x00000000, /* EMC_DLI_TRIM_TXDQS2 */
92                         0x00000000, /* EMC_DLI_TRIM_TXDQS3 */
93                         0x00000000, /* EMC_DLI_TRIM_TXDQS4 */
94                         0x00000000, /* EMC_DLI_TRIM_TXDQS5 */
95                         0x00000000, /* EMC_DLI_TRIM_TXDQS6 */
96                         0x00000000, /* EMC_DLI_TRIM_TXDQS7 */
97                         0x000fc000, /* EMC_DLL_XFORM_DQ0 */
98                         0x000fc000, /* EMC_DLL_XFORM_DQ1 */
99                         0x000fc000, /* EMC_DLL_XFORM_DQ2 */
100                         0x000fc000, /* EMC_DLL_XFORM_DQ3 */
101                         0x00100220, /* EMC_XM2CMDPADCTRL */
102                         0x0800201c, /* EMC_XM2DQSPADCTRL2 */
103                         0x00000000, /* EMC_XM2DQPADCTRL2 */
104                         0x77ffc004, /* EMC_XM2CLKPADCTRL */
105                         0x01f1f008, /* EMC_XM2COMPPADCTRL */
106                         0x00000000, /* EMC_XM2VTTGENPADCTRL */
107                         0x00000007, /* EMC_XM2VTTGENPADCTRL2 */
108                         0x08000068, /* EMC_XM2QUSEPADCTRL */
109                         0x08000000, /* EMC_XM2DQSPADCTRL3 */
110                         0x00000802, /* EMC_CTT_TERM_CTRL */
111                         0x00064000, /* EMC_ZCAL_INTERVAL */
112                         0x00000009, /* EMC_ZCAL_WAIT_CNT */
113                         0x00090009, /* EMC_MRS_WAIT_CNT */
114                         0xa0f10000, /* EMC_AUTO_CAL_CONFIG */
115                         0x00000000, /* EMC_CTT */
116                         0x00000000, /* EMC_CTT_DURATION */
117                         0x80000164, /* EMC_DYN_SELF_REF_CONTROL */
118                         0x00050001, /* MC_EMEM_ARB_CFG */
119                         0xc0000008, /* MC_EMEM_ARB_OUTSTANDING_REQ */
120                         0x00000001, /* MC_EMEM_ARB_TIMING_RCD */
121                         0x00000001, /* MC_EMEM_ARB_TIMING_RP */
122                         0x00000002, /* MC_EMEM_ARB_TIMING_RC */
123                         0x00000000, /* MC_EMEM_ARB_TIMING_RAS */
124                         0x00000003, /* MC_EMEM_ARB_TIMING_FAW */
125                         0x00000001, /* MC_EMEM_ARB_TIMING_RRD */
126                         0x00000002, /* MC_EMEM_ARB_TIMING_RAP2PRE */
127                         0x00000004, /* MC_EMEM_ARB_TIMING_WAP2PRE */
128                         0x00000001, /* MC_EMEM_ARB_TIMING_R2R */
129                         0x00000000, /* MC_EMEM_ARB_TIMING_W2W */
130                         0x00000002, /* MC_EMEM_ARB_TIMING_R2W */
131                         0x00000002, /* MC_EMEM_ARB_TIMING_W2R */
132                         0x02020001, /* MC_EMEM_ARB_DA_TURNS */
133                         0x00060402, /* MC_EMEM_ARB_DA_COVERS */
134                         0x77230303, /* MC_EMEM_ARB_MISC0 */
135                         0x001f0000, /* MC_EMEM_ARB_RING1_THROTTLE */
136                         0x50000000, /* EMC_FBIO_SPARE */
137                         0xff00ff00, /* EMC_CFG_RSV */
138                 },
139                 0x00000009, /* EMC_ZCAL_WAIT_CNT after clock change */
140                 0x001fffff, /* EMC_AUTO_CAL_INTERVAL */
141                 0x00000001, /* EMC_CFG.PERIODIC_QRST */
142                 0x00000000, /* Mode Register 0 */
143                 0x00010022, /* Mode Register 1 */
144                 0x00020001, /* Mode Register 2 */
145                 0x00000001, /* EMC_CFG.DYN_SELF_REF */
146         },
147         {
148                 0x32,       /* Rev 3.2 */
149                 25500,      /* SDRAM frequency */
150                 {
151                         0x00000001, /* EMC_RC */
152                         0x00000003, /* EMC_RFC */
153                         0x00000002, /* EMC_RAS */
154                         0x00000002, /* EMC_RP */
155                         0x00000004, /* EMC_R2W */
156                         0x00000004, /* EMC_W2R */
157                         0x00000001, /* EMC_R2P */
158                         0x00000005, /* EMC_W2P */
159                         0x00000002, /* EMC_RD_RCD */
160                         0x00000002, /* EMC_WR_RCD */
161                         0x00000001, /* EMC_RRD */
162                         0x00000001, /* EMC_REXT */
163                         0x00000000, /* EMC_WEXT */
164                         0x00000001, /* EMC_WDV */
165                         0x00000003, /* EMC_QUSE */
166                         0x00000001, /* EMC_QRST */
167                         0x00000009, /* EMC_QSAFE */
168                         0x0000000a, /* EMC_RDV */
169                         0x0000005e, /* EMC_REFRESH */
170                         0x00000000, /* EMC_BURST_REFRESH_NUM */
171                         0x00000017, /* EMC_PRE_REFRESH_REQ_CNT */
172                         0x00000001, /* EMC_PDEX2WR */
173                         0x00000001, /* EMC_PDEX2RD */
174                         0x00000002, /* EMC_PCHG2PDEN */
175                         0x00000000, /* EMC_ACT2PDEN */
176                         0x00000001, /* EMC_AR2PDEN */
177                         0x00000007, /* EMC_RW2PDEN */
178                         0x00000004, /* EMC_TXSR */
179                         0x00000004, /* EMC_TXSRDLL */
180                         0x00000003, /* EMC_TCKE */
181                         0x00000008, /* EMC_TFAW */
182                         0x00000004, /* EMC_TRPAB */
183                         0x00000004, /* EMC_TCLKSTABLE */
184                         0x00000002, /* EMC_TCLKSTOP */
185                         0x00000068, /* EMC_TREFBW */
186                         0x00000004, /* EMC_QUSE_EXTRA */
187                         0x00000004, /* EMC_FBIO_CFG6 */
188                         0x00000000, /* EMC_ODT_WRITE */
189                         0x00000000, /* EMC_ODT_READ */
190                         0x00004282, /* EMC_FBIO_CFG5 */
191                         0x007800a4, /* EMC_CFG_DIG_DLL */
192                         0x00008000, /* EMC_CFG_DIG_DLL_PERIOD */
193                         0x00090000, /* EMC_DLL_XFORM_DQS0 */
194                         0x00090000, /* EMC_DLL_XFORM_DQS1 */
195                         0x00090000, /* EMC_DLL_XFORM_DQS2 */
196                         0x00090000, /* EMC_DLL_XFORM_DQS3 */
197                         0x00000010, /* EMC_DLL_XFORM_DQS4 */
198                         0x00000010, /* EMC_DLL_XFORM_DQS5 */
199                         0x00000010, /* EMC_DLL_XFORM_DQS6 */
200                         0x00000010, /* EMC_DLL_XFORM_DQS7 */
201                         0x00000000, /* EMC_DLL_XFORM_QUSE0 */
202                         0x00000000, /* EMC_DLL_XFORM_QUSE1 */
203                         0x00000000, /* EMC_DLL_XFORM_QUSE2 */
204                         0x00000000, /* EMC_DLL_XFORM_QUSE3 */
205                         0x00000008, /* EMC_DLL_XFORM_QUSE4 */
206                         0x00000008, /* EMC_DLL_XFORM_QUSE5 */
207                         0x00000008, /* EMC_DLL_XFORM_QUSE6 */
208                         0x00000008, /* EMC_DLL_XFORM_QUSE7 */
209                         0x00000000, /* EMC_DLI_TRIM_TXDQS0 */
210                         0x00000000, /* EMC_DLI_TRIM_TXDQS1 */
211                         0x00000000, /* EMC_DLI_TRIM_TXDQS2 */
212                         0x00000000, /* EMC_DLI_TRIM_TXDQS3 */
213                         0x00000000, /* EMC_DLI_TRIM_TXDQS4 */
214                         0x00000000, /* EMC_DLI_TRIM_TXDQS5 */
215                         0x00000000, /* EMC_DLI_TRIM_TXDQS6 */
216                         0x00000000, /* EMC_DLI_TRIM_TXDQS7 */
217                         0x00088000, /* EMC_DLL_XFORM_DQ0 */
218                         0x00088000, /* EMC_DLL_XFORM_DQ1 */
219                         0x00088000, /* EMC_DLL_XFORM_DQ2 */
220                         0x00088000, /* EMC_DLL_XFORM_DQ3 */
221                         0x00100220, /* EMC_XM2CMDPADCTRL */
222                         0x0800201c, /* EMC_XM2DQSPADCTRL2 */
223                         0x00000000, /* EMC_XM2DQPADCTRL2 */
224                         0x77ffc004, /* EMC_XM2CLKPADCTRL */
225                         0x01f1f008, /* EMC_XM2COMPPADCTRL */
226                         0x00000000, /* EMC_XM2VTTGENPADCTRL */
227                         0x00000007, /* EMC_XM2VTTGENPADCTRL2 */
228                         0x08000068, /* EMC_XM2QUSEPADCTRL */
229                         0x08000000, /* EMC_XM2DQSPADCTRL3 */
230                         0x00000802, /* EMC_CTT_TERM_CTRL */
231                         0x00064000, /* EMC_ZCAL_INTERVAL */
232                         0x0000000a, /* EMC_ZCAL_WAIT_CNT */
233                         0x00090009, /* EMC_MRS_WAIT_CNT */
234                         0xa0f10000, /* EMC_AUTO_CAL_CONFIG */
235                         0x00000000, /* EMC_CTT */
236                         0x00000000, /* EMC_CTT_DURATION */
237                         0x800001c2, /* EMC_DYN_SELF_REF_CONTROL */
238                         0x00020001, /* MC_EMEM_ARB_CFG */
239                         0xc0000008, /* MC_EMEM_ARB_OUTSTANDING_REQ */
240                         0x00000001, /* MC_EMEM_ARB_TIMING_RCD */
241                         0x00000001, /* MC_EMEM_ARB_TIMING_RP */
242                         0x00000002, /* MC_EMEM_ARB_TIMING_RC */
243                         0x00000000, /* MC_EMEM_ARB_TIMING_RAS */
244                         0x00000003, /* MC_EMEM_ARB_TIMING_FAW */
245                         0x00000001, /* MC_EMEM_ARB_TIMING_RRD */
246                         0x00000002, /* MC_EMEM_ARB_TIMING_RAP2PRE */
247                         0x00000004, /* MC_EMEM_ARB_TIMING_WAP2PRE */
248                         0x00000001, /* MC_EMEM_ARB_TIMING_R2R */
249                         0x00000000, /* MC_EMEM_ARB_TIMING_W2W */
250                         0x00000002, /* MC_EMEM_ARB_TIMING_R2W */
251                         0x00000002, /* MC_EMEM_ARB_TIMING_W2R */
252                         0x02020001, /* MC_EMEM_ARB_DA_TURNS */
253                         0x00060402, /* MC_EMEM_ARB_DA_COVERS */
254                         0x74030303, /* MC_EMEM_ARB_MISC0 */
255                         0x001f0000, /* MC_EMEM_ARB_RING1_THROTTLE */
256                         0x50000000, /* EMC_FBIO_SPARE */
257                         0xff00ff00, /* EMC_CFG_RSV */
258                 },
259                 0x00000009, /* EMC_ZCAL_WAIT_CNT after clock change */
260                 0x001fffff, /* EMC_AUTO_CAL_INTERVAL */
261                 0x00000001, /* EMC_CFG.PERIODIC_QRST */
262                 0x00000000, /* Mode Register 0 */
263                 0x00010022, /* Mode Register 1 */
264                 0x00020001, /* Mode Register 2 */
265                 0x00000001, /* EMC_CFG.DYN_SELF_REF */
266         },
267         {
268                 0x32,       /* Rev 3.2 */
269                 51000,      /* SDRAM frequency */
270                 {
271                         0x00000003, /* EMC_RC */
272                         0x00000006, /* EMC_RFC */
273                         0x00000002, /* EMC_RAS */
274                         0x00000002, /* EMC_RP */
275                         0x00000004, /* EMC_R2W */
276                         0x00000004, /* EMC_W2R */
277                         0x00000001, /* EMC_R2P */
278                         0x00000005, /* EMC_W2P */
279                         0x00000002, /* EMC_RD_RCD */
280                         0x00000002, /* EMC_WR_RCD */
281                         0x00000001, /* EMC_RRD */
282                         0x00000001, /* EMC_REXT */
283                         0x00000000, /* EMC_WEXT */
284                         0x00000001, /* EMC_WDV */
285                         0x00000003, /* EMC_QUSE */
286                         0x00000001, /* EMC_QRST */
287                         0x00000009, /* EMC_QSAFE */
288                         0x0000000a, /* EMC_RDV */
289                         0x000000c0, /* EMC_REFRESH */
290                         0x00000000, /* EMC_BURST_REFRESH_NUM */
291                         0x00000030, /* EMC_PRE_REFRESH_REQ_CNT */
292                         0x00000001, /* EMC_PDEX2WR */
293                         0x00000001, /* EMC_PDEX2RD */
294                         0x00000002, /* EMC_PCHG2PDEN */
295                         0x00000000, /* EMC_ACT2PDEN */
296                         0x00000001, /* EMC_AR2PDEN */
297                         0x00000007, /* EMC_RW2PDEN */
298                         0x00000008, /* EMC_TXSR */
299                         0x00000008, /* EMC_TXSRDLL */
300                         0x00000003, /* EMC_TCKE */
301                         0x00000008, /* EMC_TFAW */
302                         0x00000004, /* EMC_TRPAB */
303                         0x00000004, /* EMC_TCLKSTABLE */
304                         0x00000002, /* EMC_TCLKSTOP */
305                         0x000000d5, /* EMC_TREFBW */
306                         0x00000004, /* EMC_QUSE_EXTRA */
307                         0x00000004, /* EMC_FBIO_CFG6 */
308                         0x00000000, /* EMC_ODT_WRITE */
309                         0x00000000, /* EMC_ODT_READ */
310                         0x00004282, /* EMC_FBIO_CFG5 */
311                         0x007800a4, /* EMC_CFG_DIG_DLL */
312                         0x00008000, /* EMC_CFG_DIG_DLL_PERIOD */
313                         0x00090000, /* EMC_DLL_XFORM_DQS0 */
314                         0x00090000, /* EMC_DLL_XFORM_DQS1 */
315                         0x00090000, /* EMC_DLL_XFORM_DQS2 */
316                         0x00090000, /* EMC_DLL_XFORM_DQS3 */
317                         0x00000010, /* EMC_DLL_XFORM_DQS4 */
318                         0x00000010, /* EMC_DLL_XFORM_DQS5 */
319                         0x00000010, /* EMC_DLL_XFORM_DQS6 */
320                         0x00000010, /* EMC_DLL_XFORM_DQS7 */
321                         0x00000000, /* EMC_DLL_XFORM_QUSE0 */
322                         0x00000000, /* EMC_DLL_XFORM_QUSE1 */
323                         0x00000000, /* EMC_DLL_XFORM_QUSE2 */
324                         0x00000000, /* EMC_DLL_XFORM_QUSE3 */
325                         0x00000018, /* EMC_DLL_XFORM_QUSE4 */
326                         0x00000018, /* EMC_DLL_XFORM_QUSE5 */
327                         0x00000018, /* EMC_DLL_XFORM_QUSE6 */
328                         0x00000018, /* EMC_DLL_XFORM_QUSE7 */
329                         0x00000000, /* EMC_DLI_TRIM_TXDQS0 */
330                         0x00000000, /* EMC_DLI_TRIM_TXDQS1 */
331                         0x00000000, /* EMC_DLI_TRIM_TXDQS2 */
332                         0x00000000, /* EMC_DLI_TRIM_TXDQS3 */
333                         0x00000000, /* EMC_DLI_TRIM_TXDQS4 */
334                         0x00000000, /* EMC_DLI_TRIM_TXDQS5 */
335                         0x00000000, /* EMC_DLI_TRIM_TXDQS6 */
336                         0x00000000, /* EMC_DLI_TRIM_TXDQS7 */
337                         0x00088000, /* EMC_DLL_XFORM_DQ0 */
338                         0x00088000, /* EMC_DLL_XFORM_DQ1 */
339                         0x00088000, /* EMC_DLL_XFORM_DQ2 */
340                         0x00088000, /* EMC_DLL_XFORM_DQ3 */
341                         0x00100220, /* EMC_XM2CMDPADCTRL */
342                         0x0800201c, /* EMC_XM2DQSPADCTRL2 */
343                         0x00000000, /* EMC_XM2DQPADCTRL2 */
344                         0x77ffc004, /* EMC_XM2CLKPADCTRL */
345                         0x01f1f008, /* EMC_XM2COMPPADCTRL */
346                         0x00000000, /* EMC_XM2VTTGENPADCTRL */
347                         0x00000007, /* EMC_XM2VTTGENPADCTRL2 */
348                         0x08000068, /* EMC_XM2QUSEPADCTRL */
349                         0x08000000, /* EMC_XM2DQSPADCTRL3 */
350                         0x00000802, /* EMC_CTT_TERM_CTRL */
351                         0x00064000, /* EMC_ZCAL_INTERVAL */
352                         0x00000013, /* EMC_ZCAL_WAIT_CNT */
353                         0x00090009, /* EMC_MRS_WAIT_CNT */
354                         0xa0f10000, /* EMC_AUTO_CAL_CONFIG */
355                         0x00000000, /* EMC_CTT */
356                         0x00000000, /* EMC_CTT_DURATION */
357                         0x80000287, /* EMC_DYN_SELF_REF_CONTROL */
358                         0x00010001, /* MC_EMEM_ARB_CFG */
359                         0xc000000a, /* MC_EMEM_ARB_OUTSTANDING_REQ */
360                         0x00000001, /* MC_EMEM_ARB_TIMING_RCD */
361                         0x00000001, /* MC_EMEM_ARB_TIMING_RP */
362                         0x00000002, /* MC_EMEM_ARB_TIMING_RC */
363                         0x00000000, /* MC_EMEM_ARB_TIMING_RAS */
364                         0x00000003, /* MC_EMEM_ARB_TIMING_FAW */
365                         0x00000001, /* MC_EMEM_ARB_TIMING_RRD */
366                         0x00000002, /* MC_EMEM_ARB_TIMING_RAP2PRE */
367                         0x00000004, /* MC_EMEM_ARB_TIMING_WAP2PRE */
368                         0x00000001, /* MC_EMEM_ARB_TIMING_R2R */
369                         0x00000000, /* MC_EMEM_ARB_TIMING_W2W */
370                         0x00000002, /* MC_EMEM_ARB_TIMING_R2W */
371                         0x00000002, /* MC_EMEM_ARB_TIMING_W2R */
372                         0x02020001, /* MC_EMEM_ARB_DA_TURNS */
373                         0x00060402, /* MC_EMEM_ARB_DA_COVERS */
374                         0x72c30303, /* MC_EMEM_ARB_MISC0 */
375                         0x001f0000, /* MC_EMEM_ARB_RING1_THROTTLE */
376                         0x50000000, /* EMC_FBIO_SPARE */
377                         0xff00ff00, /* EMC_CFG_RSV */
378                 },
379                 0x00000009, /* EMC_ZCAL_WAIT_CNT after clock change */
380                 0x001fffff, /* EMC_AUTO_CAL_INTERVAL */
381                 0x00000001, /* EMC_CFG.PERIODIC_QRST */
382                 0x00000000, /* Mode Register 0 */
383                 0x00010022, /* Mode Register 1 */
384                 0x00020001, /* Mode Register 2 */
385                 0x00000001, /* EMC_CFG.DYN_SELF_REF */
386         },
387         {
388                 0x32,       /* Rev 3.2 */
389                 102000,     /* SDRAM frequency */
390                 {
391                         0x00000006, /* EMC_RC */
392                         0x0000000d, /* EMC_RFC */
393                         0x00000004, /* EMC_RAS */
394                         0x00000002, /* EMC_RP */
395                         0x00000004, /* EMC_R2W */
396                         0x00000004, /* EMC_W2R */
397                         0x00000001, /* EMC_R2P */
398                         0x00000005, /* EMC_W2P */
399                         0x00000002, /* EMC_RD_RCD */
400                         0x00000002, /* EMC_WR_RCD */
401                         0x00000001, /* EMC_RRD */
402                         0x00000001, /* EMC_REXT */
403                         0x00000000, /* EMC_WEXT */
404                         0x00000001, /* EMC_WDV */
405                         0x00000003, /* EMC_QUSE */
406                         0x00000001, /* EMC_QRST */
407                         0x00000009, /* EMC_QSAFE */
408                         0x0000000a, /* EMC_RDV */
409                         0x00000181, /* EMC_REFRESH */
410                         0x00000000, /* EMC_BURST_REFRESH_NUM */
411                         0x00000060, /* EMC_PRE_REFRESH_REQ_CNT */
412                         0x00000001, /* EMC_PDEX2WR */
413                         0x00000001, /* EMC_PDEX2RD */
414                         0x00000002, /* EMC_PCHG2PDEN */
415                         0x00000000, /* EMC_ACT2PDEN */
416                         0x00000001, /* EMC_AR2PDEN */
417                         0x00000007, /* EMC_RW2PDEN */
418                         0x0000000f, /* EMC_TXSR */
419                         0x0000000f, /* EMC_TXSRDLL */
420                         0x00000003, /* EMC_TCKE */
421                         0x00000008, /* EMC_TFAW */
422                         0x00000004, /* EMC_TRPAB */
423                         0x00000004, /* EMC_TCLKSTABLE */
424                         0x00000002, /* EMC_TCLKSTOP */
425                         0x000001a9, /* EMC_TREFBW */
426                         0x00000004, /* EMC_QUSE_EXTRA */
427                         0x00000006, /* EMC_FBIO_CFG6 */
428                         0x00000000, /* EMC_ODT_WRITE */
429                         0x00000000, /* EMC_ODT_READ */
430                         0x00004282, /* EMC_FBIO_CFG5 */
431                         0x007800a4, /* EMC_CFG_DIG_DLL */
432                         0x00008000, /* EMC_CFG_DIG_DLL_PERIOD */
433                         0x00090000, /* EMC_DLL_XFORM_DQS0 */
434                         0x00090000, /* EMC_DLL_XFORM_DQS1 */
435                         0x00090000, /* EMC_DLL_XFORM_DQS2 */
436                         0x00090000, /* EMC_DLL_XFORM_DQS3 */
437                         0x00000010, /* EMC_DLL_XFORM_DQS4 */
438                         0x00000010, /* EMC_DLL_XFORM_DQS5 */
439                         0x00000010, /* EMC_DLL_XFORM_DQS6 */
440                         0x00000010, /* EMC_DLL_XFORM_DQS7 */
441                         0x00000000, /* EMC_DLL_XFORM_QUSE0 */
442                         0x00000000, /* EMC_DLL_XFORM_QUSE1 */
443                         0x00000000, /* EMC_DLL_XFORM_QUSE2 */
444                         0x00000000, /* EMC_DLL_XFORM_QUSE3 */
445                         0x00000008, /* EMC_DLL_XFORM_QUSE4 */
446                         0x00000008, /* EMC_DLL_XFORM_QUSE5 */
447                         0x00000008, /* EMC_DLL_XFORM_QUSE6 */
448                         0x00000008, /* EMC_DLL_XFORM_QUSE7 */
449                         0x00000000, /* EMC_DLI_TRIM_TXDQS0 */
450                         0x00000000, /* EMC_DLI_TRIM_TXDQS1 */
451                         0x00000000, /* EMC_DLI_TRIM_TXDQS2 */
452                         0x00000000, /* EMC_DLI_TRIM_TXDQS3 */
453                         0x00000000, /* EMC_DLI_TRIM_TXDQS4 */
454                         0x00000000, /* EMC_DLI_TRIM_TXDQS5 */
455                         0x00000000, /* EMC_DLI_TRIM_TXDQS6 */
456                         0x00000000, /* EMC_DLI_TRIM_TXDQS7 */
457                         0x00088000, /* EMC_DLL_XFORM_DQ0 */
458                         0x00088000, /* EMC_DLL_XFORM_DQ1 */
459                         0x00088000, /* EMC_DLL_XFORM_DQ2 */
460                         0x00088000, /* EMC_DLL_XFORM_DQ3 */
461                         0x00100220, /* EMC_XM2CMDPADCTRL */
462                         0x0800201c, /* EMC_XM2DQSPADCTRL2 */
463                         0x00000000, /* EMC_XM2DQPADCTRL2 */
464                         0x77ffc004, /* EMC_XM2CLKPADCTRL */
465                         0x01f1f008, /* EMC_XM2COMPPADCTRL */
466                         0x00000000, /* EMC_XM2VTTGENPADCTRL */
467                         0x00000007, /* EMC_XM2VTTGENPADCTRL2 */
468                         0x08000068, /* EMC_XM2QUSEPADCTRL */
469                         0x08000000, /* EMC_XM2DQSPADCTRL3 */
470                         0x00000802, /* EMC_CTT_TERM_CTRL */
471                         0x00064000, /* EMC_ZCAL_INTERVAL */
472                         0x00000025, /* EMC_ZCAL_WAIT_CNT */
473                         0x00090009, /* EMC_MRS_WAIT_CNT */
474                         0xa0f10000, /* EMC_AUTO_CAL_CONFIG */
475                         0x00000000, /* EMC_CTT */
476                         0x00000000, /* EMC_CTT_DURATION */
477                         0x8000040b, /* EMC_DYN_SELF_REF_CONTROL */
478                         0x00000001, /* MC_EMEM_ARB_CFG */
479                         0xc0000013, /* MC_EMEM_ARB_OUTSTANDING_REQ */
480                         0x00000001, /* MC_EMEM_ARB_TIMING_RCD */
481                         0x00000001, /* MC_EMEM_ARB_TIMING_RP */
482                         0x00000003, /* MC_EMEM_ARB_TIMING_RC */
483                         0x00000001, /* MC_EMEM_ARB_TIMING_RAS */
484                         0x00000003, /* MC_EMEM_ARB_TIMING_FAW */
485                         0x00000001, /* MC_EMEM_ARB_TIMING_RRD */
486                         0x00000002, /* MC_EMEM_ARB_TIMING_RAP2PRE */
487                         0x00000004, /* MC_EMEM_ARB_TIMING_WAP2PRE */
488                         0x00000001, /* MC_EMEM_ARB_TIMING_R2R */
489                         0x00000000, /* MC_EMEM_ARB_TIMING_W2W */
490                         0x00000002, /* MC_EMEM_ARB_TIMING_R2W */
491                         0x00000002, /* MC_EMEM_ARB_TIMING_W2R */
492                         0x02020001, /* MC_EMEM_ARB_DA_TURNS */
493                         0x00060403, /* MC_EMEM_ARB_DA_COVERS */
494                         0x72430504, /* MC_EMEM_ARB_MISC0 */
495                         0x001f0000, /* MC_EMEM_ARB_RING1_THROTTLE */
496                         0x50000000, /* EMC_FBIO_SPARE */
497                         0xff00ff00, /* EMC_CFG_RSV */
498                 },
499                 0x0000000a, /* EMC_ZCAL_WAIT_CNT after clock change */
500                 0x001fffff, /* EMC_AUTO_CAL_INTERVAL */
501                 0x00000001, /* EMC_CFG.PERIODIC_QRST */
502                 0x00000000, /* Mode Register 0 */
503                 0x00010022, /* Mode Register 1 */
504                 0x00020001, /* Mode Register 2 */
505                 0x00000001, /* EMC_CFG.DYN_SELF_REF */
506         },
507         {
508                 0x32,       /* Rev 3.2 */
509                 204000,     /* SDRAM frequency */
510                 {
511                         0x0000000c, /* EMC_RC */
512                         0x0000001a, /* EMC_RFC */
513                         0x00000008, /* EMC_RAS */
514                         0x00000003, /* EMC_RP */
515                         0x00000005, /* EMC_R2W */
516                         0x00000004, /* EMC_W2R */
517                         0x00000001, /* EMC_R2P */
518                         0x00000006, /* EMC_W2P */
519                         0x00000003, /* EMC_RD_RCD */
520                         0x00000003, /* EMC_WR_RCD */
521                         0x00000002, /* EMC_RRD */
522                         0x00000002, /* EMC_REXT */
523                         0x00000000, /* EMC_WEXT */
524                         0x00000001, /* EMC_WDV */
525                         0x00000003, /* EMC_QUSE */
526                         0x00000001, /* EMC_QRST */
527                         0x0000000b, /* EMC_QSAFE */
528                         0x0000000a, /* EMC_RDV */
529                         0x00000303, /* EMC_REFRESH */
530                         0x00000000, /* EMC_BURST_REFRESH_NUM */
531                         0x000000c0, /* EMC_PRE_REFRESH_REQ_CNT */
532                         0x00000001, /* EMC_PDEX2WR */
533                         0x00000001, /* EMC_PDEX2RD */
534                         0x00000003, /* EMC_PCHG2PDEN */
535                         0x00000000, /* EMC_ACT2PDEN */
536                         0x00000001, /* EMC_AR2PDEN */
537                         0x00000007, /* EMC_RW2PDEN */
538                         0x0000001d, /* EMC_TXSR */
539                         0x0000001d, /* EMC_TXSRDLL */
540                         0x00000004, /* EMC_TCKE */
541                         0x0000000b, /* EMC_TFAW */
542                         0x00000005, /* EMC_TRPAB */
543                         0x00000004, /* EMC_TCLKSTABLE */
544                         0x00000002, /* EMC_TCLKSTOP */
545                         0x00000351, /* EMC_TREFBW */
546                         0x00000004, /* EMC_QUSE_EXTRA */
547                         0x00000006, /* EMC_FBIO_CFG6 */
548                         0x00000000, /* EMC_ODT_WRITE */
549                         0x00000000, /* EMC_ODT_READ */
550                         0x00004282, /* EMC_FBIO_CFG5 */
551                         0x004400a4, /* EMC_CFG_DIG_DLL */
552                         0x00008000, /* EMC_CFG_DIG_DLL_PERIOD */
553                         0x0007c000, /* EMC_DLL_XFORM_DQS0 */
554                         0x0007c000, /* EMC_DLL_XFORM_DQS1 */
555                         0x0007c000, /* EMC_DLL_XFORM_DQS2 */
556                         0x0007c000, /* EMC_DLL_XFORM_DQS3 */
557                         0x00000010, /* EMC_DLL_XFORM_DQS4 */
558                         0x00000010, /* EMC_DLL_XFORM_DQS5 */
559                         0x00000010, /* EMC_DLL_XFORM_DQS6 */
560                         0x00000010, /* EMC_DLL_XFORM_DQS7 */
561                         0x00000000, /* EMC_DLL_XFORM_QUSE0 */
562                         0x00000000, /* EMC_DLL_XFORM_QUSE1 */
563                         0x00000000, /* EMC_DLL_XFORM_QUSE2 */
564                         0x00000000, /* EMC_DLL_XFORM_QUSE3 */
565                         0x00000018, /* EMC_DLL_XFORM_QUSE4 */
566                         0x00000018, /* EMC_DLL_XFORM_QUSE5 */
567                         0x00000018, /* EMC_DLL_XFORM_QUSE6 */
568                         0x00000018, /* EMC_DLL_XFORM_QUSE7 */
569                         0x00000000, /* EMC_DLI_TRIM_TXDQS0 */
570                         0x00000000, /* EMC_DLI_TRIM_TXDQS1 */
571                         0x00000000, /* EMC_DLI_TRIM_TXDQS2 */
572                         0x00000000, /* EMC_DLI_TRIM_TXDQS3 */
573                         0x00000000, /* EMC_DLI_TRIM_TXDQS4 */
574                         0x00000000, /* EMC_DLI_TRIM_TXDQS5 */
575                         0x00000000, /* EMC_DLI_TRIM_TXDQS6 */
576                         0x00000000, /* EMC_DLI_TRIM_TXDQS7 */
577                         0x00088000, /* EMC_DLL_XFORM_DQ0 */
578                         0x00088000, /* EMC_DLL_XFORM_DQ1 */
579                         0x00088000, /* EMC_DLL_XFORM_DQ2 */
580                         0x00088000, /* EMC_DLL_XFORM_DQ3 */
581                         0x000f0220, /* EMC_XM2CMDPADCTRL */
582                         0x0800201c, /* EMC_XM2DQSPADCTRL2 */
583                         0x00000000, /* EMC_XM2DQPADCTRL2 */
584                         0x77ffc004, /* EMC_XM2CLKPADCTRL */
585                         0x01f1f008, /* EMC_XM2COMPPADCTRL */
586                         0x00000000, /* EMC_XM2VTTGENPADCTRL */
587                         0x00000007, /* EMC_XM2VTTGENPADCTRL2 */
588                         0x08000068, /* EMC_XM2QUSEPADCTRL */
589                         0x08000000, /* EMC_XM2DQSPADCTRL3 */
590                         0x00000802, /* EMC_CTT_TERM_CTRL */
591                         0x00064000, /* EMC_ZCAL_INTERVAL */
592                         0x0000004a, /* EMC_ZCAL_WAIT_CNT */
593                         0x00090009, /* EMC_MRS_WAIT_CNT */
594                         0xa0f10000, /* EMC_AUTO_CAL_CONFIG */
595                         0x00000000, /* EMC_CTT */
596                         0x00000000, /* EMC_CTT_DURATION */
597                         0x80000713, /* EMC_DYN_SELF_REF_CONTROL */
598                         0x00000003, /* MC_EMEM_ARB_CFG */
599                         0xc0000025, /* MC_EMEM_ARB_OUTSTANDING_REQ */
600                         0x00000001, /* MC_EMEM_ARB_TIMING_RCD */
601                         0x00000001, /* MC_EMEM_ARB_TIMING_RP */
602                         0x00000006, /* MC_EMEM_ARB_TIMING_RC */
603                         0x00000003, /* MC_EMEM_ARB_TIMING_RAS */
604                         0x00000005, /* MC_EMEM_ARB_TIMING_FAW */
605                         0x00000001, /* MC_EMEM_ARB_TIMING_RRD */
606                         0x00000002, /* MC_EMEM_ARB_TIMING_RAP2PRE */
607                         0x00000004, /* MC_EMEM_ARB_TIMING_WAP2PRE */
608                         0x00000001, /* MC_EMEM_ARB_TIMING_R2R */
609                         0x00000000, /* MC_EMEM_ARB_TIMING_W2W */
610                         0x00000003, /* MC_EMEM_ARB_TIMING_R2W */
611                         0x00000002, /* MC_EMEM_ARB_TIMING_W2R */
612                         0x02030001, /* MC_EMEM_ARB_DA_TURNS */
613                         0x00070506, /* MC_EMEM_ARB_DA_COVERS */
614                         0x71e40a07, /* MC_EMEM_ARB_MISC0 */
615                         0x001f0000, /* MC_EMEM_ARB_RING1_THROTTLE */
616                         0x50000000, /* EMC_FBIO_SPARE */
617                         0xff00ff00, /* EMC_CFG_RSV */
618                 },
619                 0x00000013, /* EMC_ZCAL_WAIT_CNT after clock change */
620                 0x001fffff, /* EMC_AUTO_CAL_INTERVAL */
621                 0x00000001, /* EMC_CFG.PERIODIC_QRST */
622                 0x00000000, /* Mode Register 0 */
623                 0x00010042, /* Mode Register 1 */
624                 0x00020001, /* Mode Register 2 */
625                 0x00000001, /* EMC_CFG.DYN_SELF_REF */
626         },
627         {
628                 0x32,       /* Rev 3.2 */
629                 400000,     /* SDRAM frequency */
630                 {
631                         0x00000017, /* EMC_RC */
632                         0x00000033, /* EMC_RFC */
633                         0x00000010, /* EMC_RAS */
634                         0x00000007, /* EMC_RP */
635                         0x00000007, /* EMC_R2W */
636                         0x00000007, /* EMC_W2R */
637                         0x00000002, /* EMC_R2P */
638                         0x0000000a, /* EMC_W2P */
639                         0x00000007, /* EMC_RD_RCD */
640                         0x00000007, /* EMC_WR_RCD */
641                         0x00000003, /* EMC_RRD */
642                         0x00000002, /* EMC_REXT */
643                         0x00000000, /* EMC_WEXT */
644                         0x00000003, /* EMC_WDV */
645                         0x00000007, /* EMC_QUSE */
646                         0x00000004, /* EMC_QRST */
647                         0x0000000b, /* EMC_QSAFE */
648                         0x0000000e, /* EMC_RDV */
649                         0x000005e9, /* EMC_REFRESH */
650                         0x00000000, /* EMC_BURST_REFRESH_NUM */
651                         0x0000017a, /* EMC_PRE_REFRESH_REQ_CNT */
652                         0x00000002, /* EMC_PDEX2WR */
653                         0x00000002, /* EMC_PDEX2RD */
654                         0x00000007, /* EMC_PCHG2PDEN */
655                         0x00000000, /* EMC_ACT2PDEN */
656                         0x00000001, /* EMC_AR2PDEN */
657                         0x0000000c, /* EMC_RW2PDEN */
658                         0x00000038, /* EMC_TXSR */
659                         0x00000038, /* EMC_TXSRDLL */
660                         0x00000006, /* EMC_TCKE */
661                         0x00000014, /* EMC_TFAW */
662                         0x00000009, /* EMC_TRPAB */
663                         0x00000004, /* EMC_TCLKSTABLE */
664                         0x00000002, /* EMC_TCLKSTOP */
665                         0x00000680, /* EMC_TREFBW */
666                         0x00000000, /* EMC_QUSE_EXTRA */
667                         0x00000006, /* EMC_FBIO_CFG6 */
668                         0x00000000, /* EMC_ODT_WRITE */
669                         0x00000000, /* EMC_ODT_READ */
670                         0x00006282, /* EMC_FBIO_CFG5 */
671                         0x001d0084, /* EMC_CFG_DIG_DLL */
672                         0x00008000, /* EMC_CFG_DIG_DLL_PERIOD */
673                         0x00024000, /* EMC_DLL_XFORM_DQS0 */
674                         0x00024000, /* EMC_DLL_XFORM_DQS1 */
675                         0x00024000, /* EMC_DLL_XFORM_DQS2 */
676                         0x00024000, /* EMC_DLL_XFORM_DQS3 */
677                         0x00000010, /* EMC_DLL_XFORM_DQS4 */
678                         0x00000010, /* EMC_DLL_XFORM_DQS5 */
679                         0x00000010, /* EMC_DLL_XFORM_DQS6 */
680                         0x00000010, /* EMC_DLL_XFORM_DQS7 */
681                         0x00000000, /* EMC_DLL_XFORM_QUSE0 */
682                         0x00000000, /* EMC_DLL_XFORM_QUSE1 */
683                         0x00000000, /* EMC_DLL_XFORM_QUSE2 */
684                         0x00000000, /* EMC_DLL_XFORM_QUSE3 */
685                         0x00000008, /* EMC_DLL_XFORM_QUSE4 */
686                         0x00000008, /* EMC_DLL_XFORM_QUSE5 */
687                         0x00000008, /* EMC_DLL_XFORM_QUSE6 */
688                         0x00000008, /* EMC_DLL_XFORM_QUSE7 */
689                         0x00000000, /* EMC_DLI_TRIM_TXDQS0 */
690                         0x00000000, /* EMC_DLI_TRIM_TXDQS1 */
691                         0x00000000, /* EMC_DLI_TRIM_TXDQS2 */
692                         0x00000000, /* EMC_DLI_TRIM_TXDQS3 */
693                         0x00000000, /* EMC_DLI_TRIM_TXDQS4 */
694                         0x00000000, /* EMC_DLI_TRIM_TXDQS5 */
695                         0x00000000, /* EMC_DLI_TRIM_TXDQS6 */
696                         0x00000000, /* EMC_DLI_TRIM_TXDQS7 */
697                         0x00048000, /* EMC_DLL_XFORM_DQ0 */
698                         0x00048000, /* EMC_DLL_XFORM_DQ1 */
699                         0x00048000, /* EMC_DLL_XFORM_DQ2 */
700                         0x00048000, /* EMC_DLL_XFORM_DQ3 */
701                         0x00060220, /* EMC_XM2CMDPADCTRL */
702                         0x0800003d, /* EMC_XM2DQSPADCTRL2 */
703                         0x00000000, /* EMC_XM2DQPADCTRL2 */
704                         0x77ffc004, /* EMC_XM2CLKPADCTRL */
705                         0x01f1f408, /* EMC_XM2COMPPADCTRL */
706                         0x00000000, /* EMC_XM2VTTGENPADCTRL */
707                         0x00000007, /* EMC_XM2VTTGENPADCTRL2 */
708                         0x08000068, /* EMC_XM2QUSEPADCTRL */
709                         0x08000000, /* EMC_XM2DQSPADCTRL3 */
710                         0x00000802, /* EMC_CTT_TERM_CTRL */
711                         0x00064000, /* EMC_ZCAL_INTERVAL */
712                         0x00000090, /* EMC_ZCAL_WAIT_CNT */
713                         0x000c000c, /* EMC_MRS_WAIT_CNT */
714                         0xa0f10000, /* EMC_AUTO_CAL_CONFIG */
715                         0x00000000, /* EMC_CTT */
716                         0x00000000, /* EMC_CTT_DURATION */
717                         0x80000ce6, /* EMC_DYN_SELF_REF_CONTROL */
718                         0x00000006, /* MC_EMEM_ARB_CFG */
719                         0x80000048, /* MC_EMEM_ARB_OUTSTANDING_REQ */
720                         0x00000002, /* MC_EMEM_ARB_TIMING_RCD */
721                         0x00000003, /* MC_EMEM_ARB_TIMING_RP */
722                         0x0000000c, /* MC_EMEM_ARB_TIMING_RC */
723                         0x00000007, /* MC_EMEM_ARB_TIMING_RAS */
724                         0x00000009, /* MC_EMEM_ARB_TIMING_FAW */
725                         0x00000001, /* MC_EMEM_ARB_TIMING_RRD */
726                         0x00000002, /* MC_EMEM_ARB_TIMING_RAP2PRE */
727                         0x00000006, /* MC_EMEM_ARB_TIMING_WAP2PRE */
728                         0x00000001, /* MC_EMEM_ARB_TIMING_R2R */
729                         0x00000000, /* MC_EMEM_ARB_TIMING_W2W */
730                         0x00000004, /* MC_EMEM_ARB_TIMING_R2W */
731                         0x00000004, /* MC_EMEM_ARB_TIMING_W2R */
732                         0x04040001, /* MC_EMEM_ARB_DA_TURNS */
733                         0x000d090c, /* MC_EMEM_ARB_DA_COVERS */
734                         0x71c6120d, /* MC_EMEM_ARB_MISC0 */
735                         0x001f0000, /* MC_EMEM_ARB_RING1_THROTTLE */
736                         0x10000000, /* EMC_FBIO_SPARE */
737                         0xff00ff00, /* EMC_CFG_RSV */
738                 },
739                 0x00000024, /* EMC_ZCAL_WAIT_CNT after clock change */
740                 0x001fffff, /* EMC_AUTO_CAL_INTERVAL */
741                 0x00000001, /* EMC_CFG.PERIODIC_QRST */
742                 0x00000000, /* Mode Register 0 */
743                 0x00010082, /* Mode Register 1 */
744                 0x00020004, /* Mode Register 2 */
745                 0x00000000, /* EMC_CFG.DYN_SELF_REF */
746         },
747 };
748
749 int enterprise_emc_init(void)
750 {
751         tegra_init_emc(enterprise_emc_tables_h5tc2g,
752                 ARRAY_SIZE(enterprise_emc_tables_h5tc2g));
753         return 0;
754 }