blob: a3577efd0b24be7c3facd99da02b5f54a71f2fdc [file] [log] [blame]
Ye Liee337ce2021-03-19 15:57:09 +08001/*
2 * Copyright 2019 NXP
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 *
6 * Generated code from MX8M_DDR_tool
7 * Align with uboot version:
8 * imx_v2018.03_4.14.78_1.0.0_ga ~ imx_v2018.04_4.19.35_1.1.0_ga
9 */
10
11#include <linux/kernel.h>
12#include <asm/arch/ddr.h>
13
14struct dram_cfg_param ddr_ddrc_cfg[] = {
15 /** Initialize DDRC registers **/
16 { 0x3d400000, 0x81040010 },
17 { 0x3d400030, 0x20 },
18 { 0x3d400034, 0x221306 },
19 { 0x3d400050, 0x210070 },
20 { 0x3d400054, 0x10008 },
21 { 0x3d400060, 0x0 },
22 { 0x3d400064, 0x6100dc },
23 { 0x3d4000c0, 0x0 },
24 { 0x3d4000c4, 0x1000 },
25 { 0x3d4000d0, 0xc00200c5 },
26 { 0x3d4000d4, 0x500000 },
27 { 0x3d4000dc, 0x2340105 },
28 { 0x3d4000e0, 0x0 },
29 { 0x3d4000e4, 0x110000 },
30 { 0x3d4000e8, 0x2000600 },
31 { 0x3d4000ec, 0x410 },
32 { 0x3d4000f0, 0x20 },
33 { 0x3d4000f4, 0xec7 },
34 { 0x3d400100, 0xd0c1b0d },
35 { 0x3d400104, 0x30313 },
36 { 0x3d400108, 0x508060a },
37 { 0x3d40010c, 0x400c },
38 { 0x3d400110, 0x6030306 },
39 { 0x3d400114, 0x4040302 },
40 { 0x3d40011c, 0x404 },
41 { 0x3d400120, 0x5050d08 },
42 { 0x3d400124, 0x20308 },
43 { 0x3d40012c, 0x1406010e },
44 { 0x3d400130, 0x8 },
45 { 0x3d40013c, 0x0 },
46 { 0x3d400180, 0x1000040 },
47 { 0x3d400184, 0x30d4 },
48 { 0x3d400190, 0x38b8204 },
49 { 0x3d400194, 0x2020303 },
50 { 0x3d400198, 0x7f04011 },
51 { 0x3d40019c, 0xb0 },
52 { 0x3d4001a0, 0xe0400018 },
53 { 0x3d4001a4, 0x48005a },
54 { 0x3d4001a8, 0x80000000 },
55 { 0x3d4001b0, 0x1 },
56 { 0x3d4001b4, 0xb04 },
57 { 0x3d4001b8, 0x4 },
58 { 0x3d4001c0, 0x1 },
59 { 0x3d4001c4, 0x0 },
60 { 0x3d400200, 0x3f1f },
61 { 0x3d400204, 0x3f0909 },
62 { 0x3d400208, 0x700 },
63 { 0x3d40020c, 0x0 },
64 { 0x3d400210, 0x1f1f },
65 { 0x3d400214, 0x7070707 },
66 { 0x3d400218, 0x7070707 },
67 { 0x3d40021c, 0xf07 },
68 { 0x3d400220, 0x3f01 },
69 { 0x3d400240, 0x600061c },
70 { 0x3d400244, 0x1323 },
71 { 0x3d400400, 0x100 },
72 { 0x3d400250, 0x317d1a07 },
73 { 0x3d400254, 0xf },
74 { 0x3d40025c, 0x2a001b76 },
75 { 0x3d400264, 0x7300b473 },
76 { 0x3d40026c, 0x30000e06 },
77 { 0x3d400300, 0x14 },
78 { 0x3d40036c, 0x10 },
79 { 0x3d400404, 0x13193 },
80 { 0x3d400408, 0x6096 },
81 { 0x3d400490, 0x1 },
82 { 0x3d400494, 0x2000c00 },
83 { 0x3d400498, 0x3c00db },
84 { 0x3d40049c, 0x100009 },
85 { 0x3d4004a0, 0x2 },
86 { 0x3d402050, 0x210070 },
87 { 0x3d402064, 0x400093 },
88 { 0x3d4020dc, 0x40105 },
89 { 0x3d4020e0, 0x0 },
90 { 0x3d4020e8, 0x2000600 },
91 { 0x3d4020ec, 0x10 },
92 { 0x3d402100, 0xb081209 },
93 { 0x3d402104, 0x2020d },
94 { 0x3d402108, 0x5050309 },
95 { 0x3d40210c, 0x400c },
96 { 0x3d402110, 0x5030206 },
97 { 0x3d402114, 0x3030202 },
98 { 0x3d40211c, 0x303 },
99 { 0x3d402120, 0x4040d06 },
100 { 0x3d402124, 0x20208 },
101 { 0x3d40212c, 0x1205010e },
102 { 0x3d402130, 0x8 },
103 { 0x3d40213c, 0x0 },
104 { 0x3d402180, 0x1000040 },
105 { 0x3d402190, 0x3858204 },
106 { 0x3d402194, 0x2020303 },
107 { 0x3d4021b4, 0x504 },
108 { 0x3d4021b8, 0x4 },
109 { 0x3d402240, 0x6000604 },
110 { 0x3d4020f4, 0xec7 },
111};
112
113/* PHY Initialize Configuration */
114struct dram_cfg_param ddr_ddrphy_cfg[] = {
115 { 0x1005f, 0x2fd },
116 { 0x1015f, 0x2fd },
117 { 0x1105f, 0x2fd },
118 { 0x1115f, 0x2fd },
119 { 0x11005f, 0x2fd },
120 { 0x11015f, 0x2fd },
121 { 0x11105f, 0x2fd },
122 { 0x11115f, 0x2fd },
123 { 0x55, 0x355 },
124 { 0x1055, 0x355 },
125 { 0x2055, 0x355 },
126 { 0x3055, 0x355 },
127 { 0x4055, 0x55 },
128 { 0x5055, 0x55 },
129 { 0x6055, 0x355 },
130 { 0x7055, 0x355 },
131 { 0x8055, 0x355 },
132 { 0x9055, 0x355 },
133 { 0x200c5, 0xb },
134 { 0x1200c5, 0x6 },
135 { 0x2002e, 0x1 },
136 { 0x12002e, 0x1 },
137 { 0x20024, 0x8 },
138 { 0x2003a, 0x2 },
139 { 0x120024, 0x8 },
140 { 0x2003a, 0x2 },
141 { 0x20056, 0xa },
142 { 0x120056, 0xa },
143 { 0x1004d, 0x1a },
144 { 0x1014d, 0x1a },
145 { 0x1104d, 0x1a },
146 { 0x1114d, 0x1a },
147 { 0x11004d, 0x1a },
148 { 0x11014d, 0x1a },
149 { 0x11104d, 0x1a },
150 { 0x11114d, 0x1a },
151 { 0x10049, 0xe38 },
152 { 0x10149, 0xe38 },
153 { 0x11049, 0xe38 },
154 { 0x11149, 0xe38 },
155 { 0x110049, 0xe38 },
156 { 0x110149, 0xe38 },
157 { 0x111049, 0xe38 },
158 { 0x111149, 0xe38 },
159 { 0x43, 0x63 },
160 { 0x1043, 0x63 },
161 { 0x2043, 0x63 },
162 { 0x3043, 0x63 },
163 { 0x4043, 0x63 },
164 { 0x5043, 0x63 },
165 { 0x6043, 0x63 },
166 { 0x7043, 0x63 },
167 { 0x8043, 0x63 },
168 { 0x9043, 0x63 },
169 { 0x20018, 0x1 },
170 { 0x20075, 0x2 },
171 { 0x20050, 0x0 },
172 { 0x20008, 0x190 },
173 { 0x120008, 0x10a },
174 { 0x20088, 0x9 },
175 { 0x200b2, 0x268 },
176 { 0x10043, 0x5b1 },
177 { 0x10143, 0x5b1 },
178 { 0x11043, 0x5b1 },
179 { 0x11143, 0x5b1 },
180 { 0x1200b2, 0x268 },
181 { 0x110043, 0x5b1 },
182 { 0x110143, 0x5b1 },
183 { 0x111043, 0x5b1 },
184 { 0x111143, 0x5b1 },
185 { 0x200fa, 0x1 },
186 { 0x1200fa, 0x1 },
187 { 0x20019, 0x5 },
188 { 0x120019, 0x5 },
189 { 0x200f0, 0x5555 },
190 { 0x200f1, 0x5555 },
191 { 0x200f2, 0x5555 },
192 { 0x200f3, 0x5555 },
193 { 0x200f4, 0x5555 },
194 { 0x200f5, 0x5555 },
195 { 0x200f6, 0x5555 },
196 { 0x200f7, 0xf000 },
197 { 0x20025, 0x0 },
198 { 0x2002d, 0x0 },
199 { 0x12002d, 0x0 },
200 { 0x2005b, 0x7529 },
201 { 0x2005c, 0x0 },
202 { 0x200c7, 0x21 },
203 { 0x200ca, 0x24 },
204 { 0x200cc, 0x1f7 },
205 { 0x1200c7, 0x21 },
206 { 0x1200ca, 0x24 },
207 { 0x1200cc, 0x1f7 },
208 { 0x2007d, 0x212 },
209 { 0x12007d, 0x212 },
210 { 0x2007c, 0x61 },
211 { 0x12007c, 0x61 },
212 { 0x1004a, 0x500 },
213 { 0x1104a, 0x500 },
214 { 0x2002c, 0x0 },
215};
216
217/* ddr phy trained csr */
218struct dram_cfg_param ddr_ddrphy_trained_csr[] = {
219 {0x0200b2, 0x0},
220 {0x1200b2, 0x0},
221 {0x2200b2, 0x0},
222 {0x0200cb, 0x0},
223 {0x010043, 0x0},
224 {0x110043, 0x0},
225 {0x210043, 0x0},
226 {0x010143, 0x0},
227 {0x110143, 0x0},
228 {0x210143, 0x0},
229 {0x011043, 0x0},
230 {0x111043, 0x0},
231 {0x211043, 0x0},
232 {0x011143, 0x0},
233 {0x111143, 0x0},
234 {0x211143, 0x0},
235 {0x000080, 0x0},
236 {0x100080, 0x0},
237 {0x200080, 0x0},
238 {0x001080, 0x0},
239 {0x101080, 0x0},
240 {0x201080, 0x0},
241 {0x002080, 0x0},
242 {0x102080, 0x0},
243 {0x202080, 0x0},
244 {0x003080, 0x0},
245 {0x103080, 0x0},
246 {0x203080, 0x0},
247 {0x004080, 0x0},
248 {0x104080, 0x0},
249 {0x204080, 0x0},
250 {0x005080, 0x0},
251 {0x105080, 0x0},
252 {0x205080, 0x0},
253 {0x006080, 0x0},
254 {0x106080, 0x0},
255 {0x206080, 0x0},
256 {0x007080, 0x0},
257 {0x107080, 0x0},
258 {0x207080, 0x0},
259 {0x008080, 0x0},
260 {0x108080, 0x0},
261 {0x208080, 0x0},
262 {0x009080, 0x0},
263 {0x109080, 0x0},
264 {0x209080, 0x0},
265 {0x010080, 0x0},
266 {0x110080, 0x0},
267 {0x210080, 0x0},
268 {0x010180, 0x0},
269 {0x110180, 0x0},
270 {0x210180, 0x0},
271 {0x010081, 0x0},
272 {0x110081, 0x0},
273 {0x210081, 0x0},
274 {0x010181, 0x0},
275 {0x110181, 0x0},
276 {0x210181, 0x0},
277 {0x010082, 0x0},
278 {0x110082, 0x0},
279 {0x210082, 0x0},
280 {0x010182, 0x0},
281 {0x110182, 0x0},
282 {0x210182, 0x0},
283 {0x010083, 0x0},
284 {0x110083, 0x0},
285 {0x210083, 0x0},
286 {0x010183, 0x0},
287 {0x110183, 0x0},
288 {0x210183, 0x0},
289 {0x011080, 0x0},
290 {0x111080, 0x0},
291 {0x211080, 0x0},
292 {0x011180, 0x0},
293 {0x111180, 0x0},
294 {0x211180, 0x0},
295 {0x011081, 0x0},
296 {0x111081, 0x0},
297 {0x211081, 0x0},
298 {0x011181, 0x0},
299 {0x111181, 0x0},
300 {0x211181, 0x0},
301 {0x011082, 0x0},
302 {0x111082, 0x0},
303 {0x211082, 0x0},
304 {0x011182, 0x0},
305 {0x111182, 0x0},
306 {0x211182, 0x0},
307 {0x011083, 0x0},
308 {0x111083, 0x0},
309 {0x211083, 0x0},
310 {0x011183, 0x0},
311 {0x111183, 0x0},
312 {0x211183, 0x0},
313 {0x0100d0, 0x0},
314 {0x1100d0, 0x0},
315 {0x2100d0, 0x0},
316 {0x0101d0, 0x0},
317 {0x1101d0, 0x0},
318 {0x2101d0, 0x0},
319 {0x0100d1, 0x0},
320 {0x1100d1, 0x0},
321 {0x2100d1, 0x0},
322 {0x0101d1, 0x0},
323 {0x1101d1, 0x0},
324 {0x2101d1, 0x0},
325 {0x0100d2, 0x0},
326 {0x1100d2, 0x0},
327 {0x2100d2, 0x0},
328 {0x0101d2, 0x0},
329 {0x1101d2, 0x0},
330 {0x2101d2, 0x0},
331 {0x0100d3, 0x0},
332 {0x1100d3, 0x0},
333 {0x2100d3, 0x0},
334 {0x0101d3, 0x0},
335 {0x1101d3, 0x0},
336 {0x2101d3, 0x0},
337 {0x0110d0, 0x0},
338 {0x1110d0, 0x0},
339 {0x2110d0, 0x0},
340 {0x0111d0, 0x0},
341 {0x1111d0, 0x0},
342 {0x2111d0, 0x0},
343 {0x0110d1, 0x0},
344 {0x1110d1, 0x0},
345 {0x2110d1, 0x0},
346 {0x0111d1, 0x0},
347 {0x1111d1, 0x0},
348 {0x2111d1, 0x0},
349 {0x0110d2, 0x0},
350 {0x1110d2, 0x0},
351 {0x2110d2, 0x0},
352 {0x0111d2, 0x0},
353 {0x1111d2, 0x0},
354 {0x2111d2, 0x0},
355 {0x0110d3, 0x0},
356 {0x1110d3, 0x0},
357 {0x2110d3, 0x0},
358 {0x0111d3, 0x0},
359 {0x1111d3, 0x0},
360 {0x2111d3, 0x0},
361 {0x010068, 0x0},
362 {0x010168, 0x0},
363 {0x010268, 0x0},
364 {0x010368, 0x0},
365 {0x010468, 0x0},
366 {0x010568, 0x0},
367 {0x010668, 0x0},
368 {0x010768, 0x0},
369 {0x010868, 0x0},
370 {0x010069, 0x0},
371 {0x010169, 0x0},
372 {0x010269, 0x0},
373 {0x010369, 0x0},
374 {0x010469, 0x0},
375 {0x010569, 0x0},
376 {0x010669, 0x0},
377 {0x010769, 0x0},
378 {0x010869, 0x0},
379 {0x01006a, 0x0},
380 {0x01016a, 0x0},
381 {0x01026a, 0x0},
382 {0x01036a, 0x0},
383 {0x01046a, 0x0},
384 {0x01056a, 0x0},
385 {0x01066a, 0x0},
386 {0x01076a, 0x0},
387 {0x01086a, 0x0},
388 {0x01006b, 0x0},
389 {0x01016b, 0x0},
390 {0x01026b, 0x0},
391 {0x01036b, 0x0},
392 {0x01046b, 0x0},
393 {0x01056b, 0x0},
394 {0x01066b, 0x0},
395 {0x01076b, 0x0},
396 {0x01086b, 0x0},
397 {0x011068, 0x0},
398 {0x011168, 0x0},
399 {0x011268, 0x0},
400 {0x011368, 0x0},
401 {0x011468, 0x0},
402 {0x011568, 0x0},
403 {0x011668, 0x0},
404 {0x011768, 0x0},
405 {0x011868, 0x0},
406 {0x011069, 0x0},
407 {0x011169, 0x0},
408 {0x011269, 0x0},
409 {0x011369, 0x0},
410 {0x011469, 0x0},
411 {0x011569, 0x0},
412 {0x011669, 0x0},
413 {0x011769, 0x0},
414 {0x011869, 0x0},
415 {0x01106a, 0x0},
416 {0x01116a, 0x0},
417 {0x01126a, 0x0},
418 {0x01136a, 0x0},
419 {0x01146a, 0x0},
420 {0x01156a, 0x0},
421 {0x01166a, 0x0},
422 {0x01176a, 0x0},
423 {0x01186a, 0x0},
424 {0x01106b, 0x0},
425 {0x01116b, 0x0},
426 {0x01126b, 0x0},
427 {0x01136b, 0x0},
428 {0x01146b, 0x0},
429 {0x01156b, 0x0},
430 {0x01166b, 0x0},
431 {0x01176b, 0x0},
432 {0x01186b, 0x0},
433 {0x01008c, 0x0},
434 {0x11008c, 0x0},
435 {0x21008c, 0x0},
436 {0x01018c, 0x0},
437 {0x11018c, 0x0},
438 {0x21018c, 0x0},
439 {0x01008d, 0x0},
440 {0x11008d, 0x0},
441 {0x21008d, 0x0},
442 {0x01018d, 0x0},
443 {0x11018d, 0x0},
444 {0x21018d, 0x0},
445 {0x01008e, 0x0},
446 {0x11008e, 0x0},
447 {0x21008e, 0x0},
448 {0x01018e, 0x0},
449 {0x11018e, 0x0},
450 {0x21018e, 0x0},
451 {0x01008f, 0x0},
452 {0x11008f, 0x0},
453 {0x21008f, 0x0},
454 {0x01018f, 0x0},
455 {0x11018f, 0x0},
456 {0x21018f, 0x0},
457 {0x01108c, 0x0},
458 {0x11108c, 0x0},
459 {0x21108c, 0x0},
460 {0x01118c, 0x0},
461 {0x11118c, 0x0},
462 {0x21118c, 0x0},
463 {0x01108d, 0x0},
464 {0x11108d, 0x0},
465 {0x21108d, 0x0},
466 {0x01118d, 0x0},
467 {0x11118d, 0x0},
468 {0x21118d, 0x0},
469 {0x01108e, 0x0},
470 {0x11108e, 0x0},
471 {0x21108e, 0x0},
472 {0x01118e, 0x0},
473 {0x11118e, 0x0},
474 {0x21118e, 0x0},
475 {0x01108f, 0x0},
476 {0x11108f, 0x0},
477 {0x21108f, 0x0},
478 {0x01118f, 0x0},
479 {0x11118f, 0x0},
480 {0x21118f, 0x0},
481 {0x0100c0, 0x0},
482 {0x1100c0, 0x0},
483 {0x2100c0, 0x0},
484 {0x0101c0, 0x0},
485 {0x1101c0, 0x0},
486 {0x2101c0, 0x0},
487 {0x0102c0, 0x0},
488 {0x1102c0, 0x0},
489 {0x2102c0, 0x0},
490 {0x0103c0, 0x0},
491 {0x1103c0, 0x0},
492 {0x2103c0, 0x0},
493 {0x0104c0, 0x0},
494 {0x1104c0, 0x0},
495 {0x2104c0, 0x0},
496 {0x0105c0, 0x0},
497 {0x1105c0, 0x0},
498 {0x2105c0, 0x0},
499 {0x0106c0, 0x0},
500 {0x1106c0, 0x0},
501 {0x2106c0, 0x0},
502 {0x0107c0, 0x0},
503 {0x1107c0, 0x0},
504 {0x2107c0, 0x0},
505 {0x0108c0, 0x0},
506 {0x1108c0, 0x0},
507 {0x2108c0, 0x0},
508 {0x0100c1, 0x0},
509 {0x1100c1, 0x0},
510 {0x2100c1, 0x0},
511 {0x0101c1, 0x0},
512 {0x1101c1, 0x0},
513 {0x2101c1, 0x0},
514 {0x0102c1, 0x0},
515 {0x1102c1, 0x0},
516 {0x2102c1, 0x0},
517 {0x0103c1, 0x0},
518 {0x1103c1, 0x0},
519 {0x2103c1, 0x0},
520 {0x0104c1, 0x0},
521 {0x1104c1, 0x0},
522 {0x2104c1, 0x0},
523 {0x0105c1, 0x0},
524 {0x1105c1, 0x0},
525 {0x2105c1, 0x0},
526 {0x0106c1, 0x0},
527 {0x1106c1, 0x0},
528 {0x2106c1, 0x0},
529 {0x0107c1, 0x0},
530 {0x1107c1, 0x0},
531 {0x2107c1, 0x0},
532 {0x0108c1, 0x0},
533 {0x1108c1, 0x0},
534 {0x2108c1, 0x0},
535 {0x0100c2, 0x0},
536 {0x1100c2, 0x0},
537 {0x2100c2, 0x0},
538 {0x0101c2, 0x0},
539 {0x1101c2, 0x0},
540 {0x2101c2, 0x0},
541 {0x0102c2, 0x0},
542 {0x1102c2, 0x0},
543 {0x2102c2, 0x0},
544 {0x0103c2, 0x0},
545 {0x1103c2, 0x0},
546 {0x2103c2, 0x0},
547 {0x0104c2, 0x0},
548 {0x1104c2, 0x0},
549 {0x2104c2, 0x0},
550 {0x0105c2, 0x0},
551 {0x1105c2, 0x0},
552 {0x2105c2, 0x0},
553 {0x0106c2, 0x0},
554 {0x1106c2, 0x0},
555 {0x2106c2, 0x0},
556 {0x0107c2, 0x0},
557 {0x1107c2, 0x0},
558 {0x2107c2, 0x0},
559 {0x0108c2, 0x0},
560 {0x1108c2, 0x0},
561 {0x2108c2, 0x0},
562 {0x0100c3, 0x0},
563 {0x1100c3, 0x0},
564 {0x2100c3, 0x0},
565 {0x0101c3, 0x0},
566 {0x1101c3, 0x0},
567 {0x2101c3, 0x0},
568 {0x0102c3, 0x0},
569 {0x1102c3, 0x0},
570 {0x2102c3, 0x0},
571 {0x0103c3, 0x0},
572 {0x1103c3, 0x0},
573 {0x2103c3, 0x0},
574 {0x0104c3, 0x0},
575 {0x1104c3, 0x0},
576 {0x2104c3, 0x0},
577 {0x0105c3, 0x0},
578 {0x1105c3, 0x0},
579 {0x2105c3, 0x0},
580 {0x0106c3, 0x0},
581 {0x1106c3, 0x0},
582 {0x2106c3, 0x0},
583 {0x0107c3, 0x0},
584 {0x1107c3, 0x0},
585 {0x2107c3, 0x0},
586 {0x0108c3, 0x0},
587 {0x1108c3, 0x0},
588 {0x2108c3, 0x0},
589 {0x0110c0, 0x0},
590 {0x1110c0, 0x0},
591 {0x2110c0, 0x0},
592 {0x0111c0, 0x0},
593 {0x1111c0, 0x0},
594 {0x2111c0, 0x0},
595 {0x0112c0, 0x0},
596 {0x1112c0, 0x0},
597 {0x2112c0, 0x0},
598 {0x0113c0, 0x0},
599 {0x1113c0, 0x0},
600 {0x2113c0, 0x0},
601 {0x0114c0, 0x0},
602 {0x1114c0, 0x0},
603 {0x2114c0, 0x0},
604 {0x0115c0, 0x0},
605 {0x1115c0, 0x0},
606 {0x2115c0, 0x0},
607 {0x0116c0, 0x0},
608 {0x1116c0, 0x0},
609 {0x2116c0, 0x0},
610 {0x0117c0, 0x0},
611 {0x1117c0, 0x0},
612 {0x2117c0, 0x0},
613 {0x0118c0, 0x0},
614 {0x1118c0, 0x0},
615 {0x2118c0, 0x0},
616 {0x0110c1, 0x0},
617 {0x1110c1, 0x0},
618 {0x2110c1, 0x0},
619 {0x0111c1, 0x0},
620 {0x1111c1, 0x0},
621 {0x2111c1, 0x0},
622 {0x0112c1, 0x0},
623 {0x1112c1, 0x0},
624 {0x2112c1, 0x0},
625 {0x0113c1, 0x0},
626 {0x1113c1, 0x0},
627 {0x2113c1, 0x0},
628 {0x0114c1, 0x0},
629 {0x1114c1, 0x0},
630 {0x2114c1, 0x0},
631 {0x0115c1, 0x0},
632 {0x1115c1, 0x0},
633 {0x2115c1, 0x0},
634 {0x0116c1, 0x0},
635 {0x1116c1, 0x0},
636 {0x2116c1, 0x0},
637 {0x0117c1, 0x0},
638 {0x1117c1, 0x0},
639 {0x2117c1, 0x0},
640 {0x0118c1, 0x0},
641 {0x1118c1, 0x0},
642 {0x2118c1, 0x0},
643 {0x0110c2, 0x0},
644 {0x1110c2, 0x0},
645 {0x2110c2, 0x0},
646 {0x0111c2, 0x0},
647 {0x1111c2, 0x0},
648 {0x2111c2, 0x0},
649 {0x0112c2, 0x0},
650 {0x1112c2, 0x0},
651 {0x2112c2, 0x0},
652 {0x0113c2, 0x0},
653 {0x1113c2, 0x0},
654 {0x2113c2, 0x0},
655 {0x0114c2, 0x0},
656 {0x1114c2, 0x0},
657 {0x2114c2, 0x0},
658 {0x0115c2, 0x0},
659 {0x1115c2, 0x0},
660 {0x2115c2, 0x0},
661 {0x0116c2, 0x0},
662 {0x1116c2, 0x0},
663 {0x2116c2, 0x0},
664 {0x0117c2, 0x0},
665 {0x1117c2, 0x0},
666 {0x2117c2, 0x0},
667 {0x0118c2, 0x0},
668 {0x1118c2, 0x0},
669 {0x2118c2, 0x0},
670 {0x0110c3, 0x0},
671 {0x1110c3, 0x0},
672 {0x2110c3, 0x0},
673 {0x0111c3, 0x0},
674 {0x1111c3, 0x0},
675 {0x2111c3, 0x0},
676 {0x0112c3, 0x0},
677 {0x1112c3, 0x0},
678 {0x2112c3, 0x0},
679 {0x0113c3, 0x0},
680 {0x1113c3, 0x0},
681 {0x2113c3, 0x0},
682 {0x0114c3, 0x0},
683 {0x1114c3, 0x0},
684 {0x2114c3, 0x0},
685 {0x0115c3, 0x0},
686 {0x1115c3, 0x0},
687 {0x2115c3, 0x0},
688 {0x0116c3, 0x0},
689 {0x1116c3, 0x0},
690 {0x2116c3, 0x0},
691 {0x0117c3, 0x0},
692 {0x1117c3, 0x0},
693 {0x2117c3, 0x0},
694 {0x0118c3, 0x0},
695 {0x1118c3, 0x0},
696 {0x2118c3, 0x0},
697 {0x010020, 0x0},
698 {0x110020, 0x0},
699 {0x210020, 0x0},
700 {0x011020, 0x0},
701 {0x111020, 0x0},
702 {0x211020, 0x0},
703 {0x02007d, 0x0},
704 {0x12007d, 0x0},
705 {0x22007d, 0x0},
706 {0x010040, 0x0},
707 {0x010140, 0x0},
708 {0x010240, 0x0},
709 {0x010340, 0x0},
710 {0x010440, 0x0},
711 {0x010540, 0x0},
712 {0x010640, 0x0},
713 {0x010740, 0x0},
714 {0x010840, 0x0},
715 {0x010030, 0x0},
716 {0x010130, 0x0},
717 {0x010230, 0x0},
718 {0x010330, 0x0},
719 {0x010430, 0x0},
720 {0x010530, 0x0},
721 {0x010630, 0x0},
722 {0x010730, 0x0},
723 {0x010830, 0x0},
724 {0x011040, 0x0},
725 {0x011140, 0x0},
726 {0x011240, 0x0},
727 {0x011340, 0x0},
728 {0x011440, 0x0},
729 {0x011540, 0x0},
730 {0x011640, 0x0},
731 {0x011740, 0x0},
732 {0x011840, 0x0},
733 {0x011030, 0x0},
734 {0x011130, 0x0},
735 {0x011230, 0x0},
736 {0x011330, 0x0},
737 {0x011430, 0x0},
738 {0x011530, 0x0},
739 {0x011630, 0x0},
740 {0x011730, 0x0},
741 {0x011830, 0x0},
742};
743
744/* P0 message block paremeter for training firmware */
745struct dram_cfg_param ddr_fsp0_cfg[] = {
746 { 0xd0000, 0x0 },
747 { 0x54003, 0x640 },
748 { 0x54004, 0x2 },
749 { 0x54005, 0x2830 },
750 { 0x54006, 0x25e },
751 { 0x54007, 0x1000 },
752 { 0x54008, 0x101 },
753 { 0x5400b, 0x31f },
754 { 0x5400c, 0xc8 },
755 { 0x5400d, 0x100 },
756 { 0x54012, 0x1 },
757 { 0x5402f, 0x234 },
758 { 0x54030, 0x105 },
759 { 0x54033, 0x200 },
760 { 0x54034, 0x600 },
761 { 0x54035, 0x410 },
762 { 0x54036, 0x101 },
763 { 0x5403f, 0x1221 },
764 { 0x541fc, 0x100 },
765 { 0xd0000, 0x1 },
766};
767
768
769/* P1 message block paremeter for training firmware */
770struct dram_cfg_param ddr_fsp1_cfg[] = {
771 { 0xd0000, 0x0 },
772 { 0x54002, 0x1 },
773 { 0x54003, 0x42a },
774 { 0x54004, 0x2 },
775 { 0x54005, 0x2830 },
776 { 0x54006, 0x25e },
777 { 0x54007, 0x1000 },
778 { 0x54008, 0x101 },
779 { 0x5400b, 0x21f },
780 { 0x5400c, 0xc8 },
781 { 0x5400d, 0x100 },
782 { 0x54012, 0x1 },
783 { 0x5402f, 0x4 },
784 { 0x54030, 0x105 },
785 { 0x54033, 0x200 },
786 { 0x54034, 0x600 },
787 { 0x54035, 0x10 },
788 { 0x54036, 0x101 },
789 { 0x5403f, 0x1221 },
790 { 0x541fc, 0x100 },
791 { 0xd0000, 0x1 },
792};
793
794
795/* P0 2D message block paremeter for training firmware */
796struct dram_cfg_param ddr_fsp0_2d_cfg[] = {
797 { 0xd0000, 0x0 },
798 { 0x54003, 0x640 },
799 { 0x54004, 0x2 },
800 { 0x54005, 0x2830 },
801 { 0x54006, 0x25e },
802 { 0x54007, 0x1000 },
803 { 0x54008, 0x101 },
804 { 0x5400b, 0x61 },
805 { 0x5400c, 0xc8 },
806 { 0x5400d, 0x100 },
807 { 0x5400e, 0x1f7f },
808 { 0x54012, 0x1 },
809 { 0x5402f, 0x234 },
810 { 0x54030, 0x105 },
811 { 0x54033, 0x200 },
812 { 0x54034, 0x600 },
813 { 0x54035, 0x410 },
814 { 0x54036, 0x101 },
815 { 0x5403f, 0x1221 },
816 { 0x541fc, 0x100 },
817 { 0xd0000, 0x1 },
818};
819
820/* DRAM PHY init engine image */
821struct dram_cfg_param ddr_phy_pie[] = {
822 { 0xd0000, 0x0 },
823 { 0x90000, 0x10 },
824 { 0x90001, 0x400 },
825 { 0x90002, 0x10e },
826 { 0x90003, 0x0 },
827 { 0x90004, 0x0 },
828 { 0x90005, 0x8 },
829 { 0x90029, 0xb },
830 { 0x9002a, 0x480 },
831 { 0x9002b, 0x109 },
832 { 0x9002c, 0x8 },
833 { 0x9002d, 0x448 },
834 { 0x9002e, 0x139 },
835 { 0x9002f, 0x8 },
836 { 0x90030, 0x478 },
837 { 0x90031, 0x109 },
838 { 0x90032, 0x2 },
839 { 0x90033, 0x10 },
840 { 0x90034, 0x139 },
841 { 0x90035, 0xb },
842 { 0x90036, 0x7c0 },
843 { 0x90037, 0x139 },
844 { 0x90038, 0x44 },
845 { 0x90039, 0x633 },
846 { 0x9003a, 0x159 },
847 { 0x9003b, 0x14f },
848 { 0x9003c, 0x630 },
849 { 0x9003d, 0x159 },
850 { 0x9003e, 0x47 },
851 { 0x9003f, 0x633 },
852 { 0x90040, 0x149 },
853 { 0x90041, 0x4f },
854 { 0x90042, 0x633 },
855 { 0x90043, 0x179 },
856 { 0x90044, 0x8 },
857 { 0x90045, 0xe0 },
858 { 0x90046, 0x109 },
859 { 0x90047, 0x0 },
860 { 0x90048, 0x7c8 },
861 { 0x90049, 0x109 },
862 { 0x9004a, 0x0 },
863 { 0x9004b, 0x1 },
864 { 0x9004c, 0x8 },
865 { 0x9004d, 0x0 },
866 { 0x9004e, 0x45a },
867 { 0x9004f, 0x9 },
868 { 0x90050, 0x0 },
869 { 0x90051, 0x448 },
870 { 0x90052, 0x109 },
871 { 0x90053, 0x40 },
872 { 0x90054, 0x633 },
873 { 0x90055, 0x179 },
874 { 0x90056, 0x1 },
875 { 0x90057, 0x618 },
876 { 0x90058, 0x109 },
877 { 0x90059, 0x40c0 },
878 { 0x9005a, 0x633 },
879 { 0x9005b, 0x149 },
880 { 0x9005c, 0x8 },
881 { 0x9005d, 0x4 },
882 { 0x9005e, 0x48 },
883 { 0x9005f, 0x4040 },
884 { 0x90060, 0x633 },
885 { 0x90061, 0x149 },
886 { 0x90062, 0x0 },
887 { 0x90063, 0x4 },
888 { 0x90064, 0x48 },
889 { 0x90065, 0x40 },
890 { 0x90066, 0x633 },
891 { 0x90067, 0x149 },
892 { 0x90068, 0x10 },
893 { 0x90069, 0x4 },
894 { 0x9006a, 0x18 },
895 { 0x9006b, 0x0 },
896 { 0x9006c, 0x4 },
897 { 0x9006d, 0x78 },
898 { 0x9006e, 0x549 },
899 { 0x9006f, 0x633 },
900 { 0x90070, 0x159 },
901 { 0x90071, 0xd49 },
902 { 0x90072, 0x633 },
903 { 0x90073, 0x159 },
904 { 0x90074, 0x94a },
905 { 0x90075, 0x633 },
906 { 0x90076, 0x159 },
907 { 0x90077, 0x441 },
908 { 0x90078, 0x633 },
909 { 0x90079, 0x149 },
910 { 0x9007a, 0x42 },
911 { 0x9007b, 0x633 },
912 { 0x9007c, 0x149 },
913 { 0x9007d, 0x1 },
914 { 0x9007e, 0x633 },
915 { 0x9007f, 0x149 },
916 { 0x90080, 0x0 },
917 { 0x90081, 0xe0 },
918 { 0x90082, 0x109 },
919 { 0x90083, 0xa },
920 { 0x90084, 0x10 },
921 { 0x90085, 0x109 },
922 { 0x90086, 0x9 },
923 { 0x90087, 0x3c0 },
924 { 0x90088, 0x149 },
925 { 0x90089, 0x9 },
926 { 0x9008a, 0x3c0 },
927 { 0x9008b, 0x159 },
928 { 0x9008c, 0x18 },
929 { 0x9008d, 0x10 },
930 { 0x9008e, 0x109 },
931 { 0x9008f, 0x0 },
932 { 0x90090, 0x3c0 },
933 { 0x90091, 0x109 },
934 { 0x90092, 0x18 },
935 { 0x90093, 0x4 },
936 { 0x90094, 0x48 },
937 { 0x90095, 0x18 },
938 { 0x90096, 0x4 },
939 { 0x90097, 0x58 },
940 { 0x90098, 0xb },
941 { 0x90099, 0x10 },
942 { 0x9009a, 0x109 },
943 { 0x9009b, 0x1 },
944 { 0x9009c, 0x10 },
945 { 0x9009d, 0x109 },
946 { 0x9009e, 0x5 },
947 { 0x9009f, 0x7c0 },
948 { 0x900a0, 0x109 },
949 { 0x900a1, 0x0 },
950 { 0x900a2, 0x8140 },
951 { 0x900a3, 0x10c },
952 { 0x900a4, 0x10 },
953 { 0x900a5, 0x8138 },
954 { 0x900a6, 0x10c },
955 { 0x900a7, 0x8 },
956 { 0x900a8, 0x7c8 },
957 { 0x900a9, 0x101 },
958 { 0x900aa, 0x8 },
959 { 0x900ab, 0x448 },
960 { 0x900ac, 0x109 },
961 { 0x900ad, 0xf },
962 { 0x900ae, 0x7c0 },
963 { 0x900af, 0x109 },
964 { 0x900b0, 0x47 },
965 { 0x900b1, 0x630 },
966 { 0x900b2, 0x109 },
967 { 0x900b3, 0x8 },
968 { 0x900b4, 0x618 },
969 { 0x900b5, 0x109 },
970 { 0x900b6, 0x8 },
971 { 0x900b7, 0xe0 },
972 { 0x900b8, 0x109 },
973 { 0x900b9, 0x0 },
974 { 0x900ba, 0x7c8 },
975 { 0x900bb, 0x109 },
976 { 0x900bc, 0x8 },
977 { 0x900bd, 0x8140 },
978 { 0x900be, 0x10c },
979 { 0x900bf, 0x0 },
980 { 0x900c0, 0x1 },
981 { 0x900c1, 0x8 },
982 { 0x900c2, 0x8 },
983 { 0x900c3, 0x4 },
984 { 0x900c4, 0x8 },
985 { 0x900c5, 0x8 },
986 { 0x900c6, 0x7c8 },
987 { 0x900c7, 0x101 },
988 { 0x90006, 0x0 },
989 { 0x90007, 0x0 },
990 { 0x90008, 0x8 },
991 { 0x90009, 0x0 },
992 { 0x9000a, 0x0 },
993 { 0x9000b, 0x0 },
994 { 0xd00e7, 0x400 },
995 { 0x90017, 0x0 },
996 { 0x90026, 0x2b },
997 { 0x2000b, 0x32 },
998 { 0x2000c, 0x64 },
999 { 0x2000d, 0x3e8 },
1000 { 0x2000e, 0x2c },
1001 { 0x12000b, 0x21 },
1002 { 0x12000c, 0x42 },
1003 { 0x12000d, 0x29a },
1004 { 0x12000e, 0x21 },
1005 { 0x9000c, 0x0 },
1006 { 0x9000d, 0x173 },
1007 { 0x9000e, 0x60 },
1008 { 0x9000f, 0x6110 },
1009 { 0x90010, 0x2152 },
1010 { 0x90011, 0xdfbd },
1011 { 0x90012, 0xffff },
1012 { 0x90013, 0x6152 },
1013 { 0x20089, 0x1 },
1014 { 0x20088, 0x19 },
1015 { 0xc0080, 0x0 },
1016 { 0xd0000, 0x1 }
1017};
1018
1019struct dram_fsp_msg ddr_dram_fsp_msg[] = {
1020 {
1021 /* P0 1600mts 1D */
1022 .drate = 1600,
1023 .fw_type = FW_1D_IMAGE,
1024 .fsp_cfg = ddr_fsp0_cfg,
1025 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_cfg),
1026 },
1027 {
1028 /* P1 1066mts 1D */
1029 .drate = 1066,
1030 .fw_type = FW_1D_IMAGE,
1031 .fsp_cfg = ddr_fsp1_cfg,
1032 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp1_cfg),
1033 },
1034 {
1035 /* P0 1600mts 2D */
1036 .drate = 1600,
1037 .fw_type = FW_2D_IMAGE,
1038 .fsp_cfg = ddr_fsp0_2d_cfg,
1039 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_2d_cfg),
1040 },
1041};
1042
1043/* ddr timing config params */
1044struct dram_timing_info dram_timing = {
1045 .ddrc_cfg = ddr_ddrc_cfg,
1046 .ddrc_cfg_num = ARRAY_SIZE(ddr_ddrc_cfg),
1047 .ddrphy_cfg = ddr_ddrphy_cfg,
1048 .ddrphy_cfg_num = ARRAY_SIZE(ddr_ddrphy_cfg),
1049 .fsp_msg = ddr_dram_fsp_msg,
1050 .fsp_msg_num = ARRAY_SIZE(ddr_dram_fsp_msg),
1051 .ddrphy_trained_csr = ddr_ddrphy_trained_csr,
1052 .ddrphy_trained_csr_num = ARRAY_SIZE(ddr_ddrphy_trained_csr),
1053 .ddrphy_pie = ddr_phy_pie,
1054 .ddrphy_pie_num = ARRAY_SIZE(ddr_phy_pie),
1055 .fsp_table = { 1600, 1066, },
1056};