blob: 9ba2d2571ce52f6a457e32156da5f98bbc51fc56 [file] [log] [blame]
Tim Harvey1a50e742022-02-11 10:48:56 -08001// SPDX-License-Identifier: GPL-2.0+
2
3#include <linux/kernel.h>
4#include <asm/arch/ddr.h>
5
6/*
7 * Generated code from MX8M_DDR_tool v3.20 using RPAv15
8 */
9/* ddr phy trained csr */
10static struct dram_cfg_param ddr_ddrphy_trained_csr[] = {
11 {0x0200b2, 0x0},
12 {0x1200b2, 0x0},
13 {0x2200b2, 0x0},
14 {0x0200cb, 0x0},
15 {0x010043, 0x0},
16 {0x110043, 0x0},
17 {0x210043, 0x0},
18 {0x010143, 0x0},
19 {0x110143, 0x0},
20 {0x210143, 0x0},
21 {0x011043, 0x0},
22 {0x111043, 0x0},
23 {0x211043, 0x0},
24 {0x011143, 0x0},
25 {0x111143, 0x0},
26 {0x211143, 0x0},
27 {0x000080, 0x0},
28 {0x100080, 0x0},
29 {0x200080, 0x0},
30 {0x001080, 0x0},
31 {0x101080, 0x0},
32 {0x201080, 0x0},
33 {0x002080, 0x0},
34 {0x102080, 0x0},
35 {0x202080, 0x0},
36 {0x003080, 0x0},
37 {0x103080, 0x0},
38 {0x203080, 0x0},
39 {0x004080, 0x0},
40 {0x104080, 0x0},
41 {0x204080, 0x0},
42 {0x005080, 0x0},
43 {0x105080, 0x0},
44 {0x205080, 0x0},
45 {0x006080, 0x0},
46 {0x106080, 0x0},
47 {0x206080, 0x0},
48 {0x007080, 0x0},
49 {0x107080, 0x0},
50 {0x207080, 0x0},
51 {0x008080, 0x0},
52 {0x108080, 0x0},
53 {0x208080, 0x0},
54 {0x009080, 0x0},
55 {0x109080, 0x0},
56 {0x209080, 0x0},
57 {0x010080, 0x0},
58 {0x110080, 0x0},
59 {0x210080, 0x0},
60 {0x010180, 0x0},
61 {0x110180, 0x0},
62 {0x210180, 0x0},
63 {0x011080, 0x0},
64 {0x111080, 0x0},
65 {0x211080, 0x0},
66 {0x011180, 0x0},
67 {0x111180, 0x0},
68 {0x211180, 0x0},
69 {0x010081, 0x0},
70 {0x110081, 0x0},
71 {0x210081, 0x0},
72 {0x010181, 0x0},
73 {0x110181, 0x0},
74 {0x210181, 0x0},
75 {0x011081, 0x0},
76 {0x111081, 0x0},
77 {0x211081, 0x0},
78 {0x011181, 0x0},
79 {0x111181, 0x0},
80 {0x211181, 0x0},
81 {0x0100d0, 0x0},
82 {0x1100d0, 0x0},
83 {0x2100d0, 0x0},
84 {0x0101d0, 0x0},
85 {0x1101d0, 0x0},
86 {0x2101d0, 0x0},
87 {0x0110d0, 0x0},
88 {0x1110d0, 0x0},
89 {0x2110d0, 0x0},
90 {0x0111d0, 0x0},
91 {0x1111d0, 0x0},
92 {0x2111d0, 0x0},
93 {0x0100d1, 0x0},
94 {0x1100d1, 0x0},
95 {0x2100d1, 0x0},
96 {0x0101d1, 0x0},
97 {0x1101d1, 0x0},
98 {0x2101d1, 0x0},
99 {0x0110d1, 0x0},
100 {0x1110d1, 0x0},
101 {0x2110d1, 0x0},
102 {0x0111d1, 0x0},
103 {0x1111d1, 0x0},
104 {0x2111d1, 0x0},
105 {0x010068, 0x0},
106 {0x010168, 0x0},
107 {0x010268, 0x0},
108 {0x010368, 0x0},
109 {0x010468, 0x0},
110 {0x010568, 0x0},
111 {0x010668, 0x0},
112 {0x010768, 0x0},
113 {0x010868, 0x0},
114 {0x011068, 0x0},
115 {0x011168, 0x0},
116 {0x011268, 0x0},
117 {0x011368, 0x0},
118 {0x011468, 0x0},
119 {0x011568, 0x0},
120 {0x011668, 0x0},
121 {0x011768, 0x0},
122 {0x011868, 0x0},
123 {0x010069, 0x0},
124 {0x010169, 0x0},
125 {0x010269, 0x0},
126 {0x010369, 0x0},
127 {0x010469, 0x0},
128 {0x010569, 0x0},
129 {0x010669, 0x0},
130 {0x010769, 0x0},
131 {0x010869, 0x0},
132 {0x011069, 0x0},
133 {0x011169, 0x0},
134 {0x011269, 0x0},
135 {0x011369, 0x0},
136 {0x011469, 0x0},
137 {0x011569, 0x0},
138 {0x011669, 0x0},
139 {0x011769, 0x0},
140 {0x011869, 0x0},
141 {0x01008c, 0x0},
142 {0x11008c, 0x0},
143 {0x21008c, 0x0},
144 {0x01018c, 0x0},
145 {0x11018c, 0x0},
146 {0x21018c, 0x0},
147 {0x01108c, 0x0},
148 {0x11108c, 0x0},
149 {0x21108c, 0x0},
150 {0x01118c, 0x0},
151 {0x11118c, 0x0},
152 {0x21118c, 0x0},
153 {0x01008d, 0x0},
154 {0x11008d, 0x0},
155 {0x21008d, 0x0},
156 {0x01018d, 0x0},
157 {0x11018d, 0x0},
158 {0x21018d, 0x0},
159 {0x01108d, 0x0},
160 {0x11108d, 0x0},
161 {0x21108d, 0x0},
162 {0x01118d, 0x0},
163 {0x11118d, 0x0},
164 {0x21118d, 0x0},
165 {0x0100c0, 0x0},
166 {0x1100c0, 0x0},
167 {0x2100c0, 0x0},
168 {0x0101c0, 0x0},
169 {0x1101c0, 0x0},
170 {0x2101c0, 0x0},
171 {0x0102c0, 0x0},
172 {0x1102c0, 0x0},
173 {0x2102c0, 0x0},
174 {0x0103c0, 0x0},
175 {0x1103c0, 0x0},
176 {0x2103c0, 0x0},
177 {0x0104c0, 0x0},
178 {0x1104c0, 0x0},
179 {0x2104c0, 0x0},
180 {0x0105c0, 0x0},
181 {0x1105c0, 0x0},
182 {0x2105c0, 0x0},
183 {0x0106c0, 0x0},
184 {0x1106c0, 0x0},
185 {0x2106c0, 0x0},
186 {0x0107c0, 0x0},
187 {0x1107c0, 0x0},
188 {0x2107c0, 0x0},
189 {0x0108c0, 0x0},
190 {0x1108c0, 0x0},
191 {0x2108c0, 0x0},
192 {0x0110c0, 0x0},
193 {0x1110c0, 0x0},
194 {0x2110c0, 0x0},
195 {0x0111c0, 0x0},
196 {0x1111c0, 0x0},
197 {0x2111c0, 0x0},
198 {0x0112c0, 0x0},
199 {0x1112c0, 0x0},
200 {0x2112c0, 0x0},
201 {0x0113c0, 0x0},
202 {0x1113c0, 0x0},
203 {0x2113c0, 0x0},
204 {0x0114c0, 0x0},
205 {0x1114c0, 0x0},
206 {0x2114c0, 0x0},
207 {0x0115c0, 0x0},
208 {0x1115c0, 0x0},
209 {0x2115c0, 0x0},
210 {0x0116c0, 0x0},
211 {0x1116c0, 0x0},
212 {0x2116c0, 0x0},
213 {0x0117c0, 0x0},
214 {0x1117c0, 0x0},
215 {0x2117c0, 0x0},
216 {0x0118c0, 0x0},
217 {0x1118c0, 0x0},
218 {0x2118c0, 0x0},
219 {0x0100c1, 0x0},
220 {0x1100c1, 0x0},
221 {0x2100c1, 0x0},
222 {0x0101c1, 0x0},
223 {0x1101c1, 0x0},
224 {0x2101c1, 0x0},
225 {0x0102c1, 0x0},
226 {0x1102c1, 0x0},
227 {0x2102c1, 0x0},
228 {0x0103c1, 0x0},
229 {0x1103c1, 0x0},
230 {0x2103c1, 0x0},
231 {0x0104c1, 0x0},
232 {0x1104c1, 0x0},
233 {0x2104c1, 0x0},
234 {0x0105c1, 0x0},
235 {0x1105c1, 0x0},
236 {0x2105c1, 0x0},
237 {0x0106c1, 0x0},
238 {0x1106c1, 0x0},
239 {0x2106c1, 0x0},
240 {0x0107c1, 0x0},
241 {0x1107c1, 0x0},
242 {0x2107c1, 0x0},
243 {0x0108c1, 0x0},
244 {0x1108c1, 0x0},
245 {0x2108c1, 0x0},
246 {0x0110c1, 0x0},
247 {0x1110c1, 0x0},
248 {0x2110c1, 0x0},
249 {0x0111c1, 0x0},
250 {0x1111c1, 0x0},
251 {0x2111c1, 0x0},
252 {0x0112c1, 0x0},
253 {0x1112c1, 0x0},
254 {0x2112c1, 0x0},
255 {0x0113c1, 0x0},
256 {0x1113c1, 0x0},
257 {0x2113c1, 0x0},
258 {0x0114c1, 0x0},
259 {0x1114c1, 0x0},
260 {0x2114c1, 0x0},
261 {0x0115c1, 0x0},
262 {0x1115c1, 0x0},
263 {0x2115c1, 0x0},
264 {0x0116c1, 0x0},
265 {0x1116c1, 0x0},
266 {0x2116c1, 0x0},
267 {0x0117c1, 0x0},
268 {0x1117c1, 0x0},
269 {0x2117c1, 0x0},
270 {0x0118c1, 0x0},
271 {0x1118c1, 0x0},
272 {0x2118c1, 0x0},
273 {0x010020, 0x0},
274 {0x110020, 0x0},
275 {0x210020, 0x0},
276 {0x011020, 0x0},
277 {0x111020, 0x0},
278 {0x211020, 0x0},
279 {0x020072, 0x0},
280 {0x020073, 0x0},
281 {0x020074, 0x0},
282 {0x0100aa, 0x0},
283 {0x0110aa, 0x0},
284 {0x020010, 0x0},
285 {0x120010, 0x0},
286 {0x220010, 0x0},
287 {0x020011, 0x0},
288 {0x120011, 0x0},
289 {0x220011, 0x0},
290 {0x0100ae, 0x0},
291 {0x1100ae, 0x0},
292 {0x2100ae, 0x0},
293 {0x0100af, 0x0},
294 {0x1100af, 0x0},
295 {0x2100af, 0x0},
296 {0x0110ae, 0x0},
297 {0x1110ae, 0x0},
298 {0x2110ae, 0x0},
299 {0x0110af, 0x0},
300 {0x1110af, 0x0},
301 {0x2110af, 0x0},
302 {0x020020, 0x0},
303 {0x120020, 0x0},
304 {0x220020, 0x0},
305 {0x0100a0, 0x0},
306 {0x0100a1, 0x0},
307 {0x0100a2, 0x0},
308 {0x0100a3, 0x0},
309 {0x0100a4, 0x0},
310 {0x0100a5, 0x0},
311 {0x0100a6, 0x0},
312 {0x0100a7, 0x0},
313 {0x0110a0, 0x0},
314 {0x0110a1, 0x0},
315 {0x0110a2, 0x0},
316 {0x0110a3, 0x0},
317 {0x0110a4, 0x0},
318 {0x0110a5, 0x0},
319 {0x0110a6, 0x0},
320 {0x0110a7, 0x0},
321 {0x02007c, 0x0},
322 {0x12007c, 0x0},
323 {0x22007c, 0x0},
324 {0x02007d, 0x0},
325 {0x12007d, 0x0},
326 {0x22007d, 0x0},
327 {0x0400fd, 0x0},
328 {0x0400c0, 0x0},
329 {0x090201, 0x0},
330 {0x190201, 0x0},
331 {0x290201, 0x0},
332 {0x090202, 0x0},
333 {0x190202, 0x0},
334 {0x290202, 0x0},
335 {0x090203, 0x0},
336 {0x190203, 0x0},
337 {0x290203, 0x0},
338 {0x090204, 0x0},
339 {0x190204, 0x0},
340 {0x290204, 0x0},
341 {0x090205, 0x0},
342 {0x190205, 0x0},
343 {0x290205, 0x0},
344 {0x090206, 0x0},
345 {0x190206, 0x0},
346 {0x290206, 0x0},
347 {0x090207, 0x0},
348 {0x190207, 0x0},
349 {0x290207, 0x0},
350 {0x090208, 0x0},
351 {0x190208, 0x0},
352 {0x290208, 0x0},
353 {0x010062, 0x0},
354 {0x010162, 0x0},
355 {0x010262, 0x0},
356 {0x010362, 0x0},
357 {0x010462, 0x0},
358 {0x010562, 0x0},
359 {0x010662, 0x0},
360 {0x010762, 0x0},
361 {0x010862, 0x0},
362 {0x011062, 0x0},
363 {0x011162, 0x0},
364 {0x011262, 0x0},
365 {0x011362, 0x0},
366 {0x011462, 0x0},
367 {0x011562, 0x0},
368 {0x011662, 0x0},
369 {0x011762, 0x0},
370 {0x011862, 0x0},
371 {0x020077, 0x0},
372 {0x010001, 0x0},
373 {0x011001, 0x0},
374 {0x010040, 0x0},
375 {0x010140, 0x0},
376 {0x010240, 0x0},
377 {0x010340, 0x0},
378 {0x010440, 0x0},
379 {0x010540, 0x0},
380 {0x010640, 0x0},
381 {0x010740, 0x0},
382 {0x010840, 0x0},
383 {0x010030, 0x0},
384 {0x010130, 0x0},
385 {0x010230, 0x0},
386 {0x010330, 0x0},
387 {0x010430, 0x0},
388 {0x010530, 0x0},
389 {0x010630, 0x0},
390 {0x010730, 0x0},
391 {0x010830, 0x0},
392 {0x011040, 0x0},
393 {0x011140, 0x0},
394 {0x011240, 0x0},
395 {0x011340, 0x0},
396 {0x011440, 0x0},
397 {0x011540, 0x0},
398 {0x011640, 0x0},
399 {0x011740, 0x0},
400 {0x011840, 0x0},
401 {0x011030, 0x0},
402 {0x011130, 0x0},
403 {0x011230, 0x0},
404 {0x011330, 0x0},
405 {0x011430, 0x0},
406 {0x011530, 0x0},
407 {0x011630, 0x0},
408 {0x011730, 0x0},
409 {0x011830, 0x0},
410};
411
412/* DRAM PHY init engine image */
413static struct dram_cfg_param ddr_phy_pie[] = {
414 { 0xd0000, 0x0 },
415 { 0x90000, 0x10 },
416 { 0x90001, 0x400 },
417 { 0x90002, 0x10e },
418 { 0x90003, 0x0 },
419 { 0x90004, 0x0 },
420 { 0x90005, 0x8 },
421 { 0x90029, 0xb },
422 { 0x9002a, 0x480 },
423 { 0x9002b, 0x109 },
424 { 0x9002c, 0x8 },
425 { 0x9002d, 0x448 },
426 { 0x9002e, 0x139 },
427 { 0x9002f, 0x8 },
428 { 0x90030, 0x478 },
429 { 0x90031, 0x109 },
430 { 0x90032, 0x0 },
431 { 0x90033, 0xe8 },
432 { 0x90034, 0x109 },
433 { 0x90035, 0x2 },
434 { 0x90036, 0x10 },
435 { 0x90037, 0x139 },
436 { 0x90038, 0xb },
437 { 0x90039, 0x7c0 },
438 { 0x9003a, 0x139 },
439 { 0x9003b, 0x44 },
440 { 0x9003c, 0x633 },
441 { 0x9003d, 0x159 },
442 { 0x9003e, 0x14f },
443 { 0x9003f, 0x630 },
444 { 0x90040, 0x159 },
445 { 0x90041, 0x47 },
446 { 0x90042, 0x633 },
447 { 0x90043, 0x149 },
448 { 0x90044, 0x4f },
449 { 0x90045, 0x633 },
450 { 0x90046, 0x179 },
451 { 0x90047, 0x8 },
452 { 0x90048, 0xe0 },
453 { 0x90049, 0x109 },
454 { 0x9004a, 0x0 },
455 { 0x9004b, 0x7c8 },
456 { 0x9004c, 0x109 },
457 { 0x9004d, 0x0 },
458 { 0x9004e, 0x1 },
459 { 0x9004f, 0x8 },
460 { 0x90050, 0x0 },
461 { 0x90051, 0x45a },
462 { 0x90052, 0x9 },
463 { 0x90053, 0x0 },
464 { 0x90054, 0x448 },
465 { 0x90055, 0x109 },
466 { 0x90056, 0x40 },
467 { 0x90057, 0x633 },
468 { 0x90058, 0x179 },
469 { 0x90059, 0x1 },
470 { 0x9005a, 0x618 },
471 { 0x9005b, 0x109 },
472 { 0x9005c, 0x40c0 },
473 { 0x9005d, 0x633 },
474 { 0x9005e, 0x149 },
475 { 0x9005f, 0x8 },
476 { 0x90060, 0x4 },
477 { 0x90061, 0x48 },
478 { 0x90062, 0x4040 },
479 { 0x90063, 0x633 },
480 { 0x90064, 0x149 },
481 { 0x90065, 0x0 },
482 { 0x90066, 0x4 },
483 { 0x90067, 0x48 },
484 { 0x90068, 0x40 },
485 { 0x90069, 0x633 },
486 { 0x9006a, 0x149 },
487 { 0x9006b, 0x10 },
488 { 0x9006c, 0x4 },
489 { 0x9006d, 0x18 },
490 { 0x9006e, 0x0 },
491 { 0x9006f, 0x4 },
492 { 0x90070, 0x78 },
493 { 0x90071, 0x549 },
494 { 0x90072, 0x633 },
495 { 0x90073, 0x159 },
496 { 0x90074, 0xd49 },
497 { 0x90075, 0x633 },
498 { 0x90076, 0x159 },
499 { 0x90077, 0x94a },
500 { 0x90078, 0x633 },
501 { 0x90079, 0x159 },
502 { 0x9007a, 0x441 },
503 { 0x9007b, 0x633 },
504 { 0x9007c, 0x149 },
505 { 0x9007d, 0x42 },
506 { 0x9007e, 0x633 },
507 { 0x9007f, 0x149 },
508 { 0x90080, 0x1 },
509 { 0x90081, 0x633 },
510 { 0x90082, 0x149 },
511 { 0x90083, 0x0 },
512 { 0x90084, 0xe0 },
513 { 0x90085, 0x109 },
514 { 0x90086, 0xa },
515 { 0x90087, 0x10 },
516 { 0x90088, 0x109 },
517 { 0x90089, 0x9 },
518 { 0x9008a, 0x3c0 },
519 { 0x9008b, 0x149 },
520 { 0x9008c, 0x9 },
521 { 0x9008d, 0x3c0 },
522 { 0x9008e, 0x159 },
523 { 0x9008f, 0x18 },
524 { 0x90090, 0x10 },
525 { 0x90091, 0x109 },
526 { 0x90092, 0x0 },
527 { 0x90093, 0x3c0 },
528 { 0x90094, 0x109 },
529 { 0x90095, 0x18 },
530 { 0x90096, 0x4 },
531 { 0x90097, 0x48 },
532 { 0x90098, 0x18 },
533 { 0x90099, 0x4 },
534 { 0x9009a, 0x58 },
535 { 0x9009b, 0xb },
536 { 0x9009c, 0x10 },
537 { 0x9009d, 0x109 },
538 { 0x9009e, 0x1 },
539 { 0x9009f, 0x10 },
540 { 0x900a0, 0x109 },
541 { 0x900a1, 0x5 },
542 { 0x900a2, 0x7c0 },
543 { 0x900a3, 0x109 },
544 { 0x40000, 0x811 },
545 { 0x40020, 0x880 },
546 { 0x40040, 0x0 },
547 { 0x40060, 0x0 },
548 { 0x40001, 0x4008 },
549 { 0x40021, 0x83 },
550 { 0x40041, 0x4f },
551 { 0x40061, 0x0 },
552 { 0x40002, 0x4040 },
553 { 0x40022, 0x83 },
554 { 0x40042, 0x51 },
555 { 0x40062, 0x0 },
556 { 0x40003, 0x811 },
557 { 0x40023, 0x880 },
558 { 0x40043, 0x0 },
559 { 0x40063, 0x0 },
560 { 0x40004, 0x720 },
561 { 0x40024, 0xf },
562 { 0x40044, 0x1740 },
563 { 0x40064, 0x0 },
564 { 0x40005, 0x16 },
565 { 0x40025, 0x83 },
566 { 0x40045, 0x4b },
567 { 0x40065, 0x0 },
568 { 0x40006, 0x716 },
569 { 0x40026, 0xf },
570 { 0x40046, 0x2001 },
571 { 0x40066, 0x0 },
572 { 0x40007, 0x716 },
573 { 0x40027, 0xf },
574 { 0x40047, 0x2800 },
575 { 0x40067, 0x0 },
576 { 0x40008, 0x716 },
577 { 0x40028, 0xf },
578 { 0x40048, 0xf00 },
579 { 0x40068, 0x0 },
580 { 0x40009, 0x720 },
581 { 0x40029, 0xf },
582 { 0x40049, 0x1400 },
583 { 0x40069, 0x0 },
584 { 0x4000a, 0xe08 },
585 { 0x4002a, 0xc15 },
586 { 0x4004a, 0x0 },
587 { 0x4006a, 0x0 },
588 { 0x4000b, 0x625 },
589 { 0x4002b, 0x15 },
590 { 0x4004b, 0x0 },
591 { 0x4006b, 0x0 },
592 { 0x4000c, 0x4028 },
593 { 0x4002c, 0x80 },
594 { 0x4004c, 0x0 },
595 { 0x4006c, 0x0 },
596 { 0x4000d, 0xe08 },
597 { 0x4002d, 0xc1a },
598 { 0x4004d, 0x0 },
599 { 0x4006d, 0x0 },
600 { 0x4000e, 0x625 },
601 { 0x4002e, 0x1a },
602 { 0x4004e, 0x0 },
603 { 0x4006e, 0x0 },
604 { 0x4000f, 0x4040 },
605 { 0x4002f, 0x80 },
606 { 0x4004f, 0x0 },
607 { 0x4006f, 0x0 },
608 { 0x40010, 0x2604 },
609 { 0x40030, 0x15 },
610 { 0x40050, 0x0 },
611 { 0x40070, 0x0 },
612 { 0x40011, 0x708 },
613 { 0x40031, 0x5 },
614 { 0x40051, 0x0 },
615 { 0x40071, 0x2002 },
616 { 0x40012, 0x8 },
617 { 0x40032, 0x80 },
618 { 0x40052, 0x0 },
619 { 0x40072, 0x0 },
620 { 0x40013, 0x2604 },
621 { 0x40033, 0x1a },
622 { 0x40053, 0x0 },
623 { 0x40073, 0x0 },
624 { 0x40014, 0x708 },
625 { 0x40034, 0xa },
626 { 0x40054, 0x0 },
627 { 0x40074, 0x2002 },
628 { 0x40015, 0x4040 },
629 { 0x40035, 0x80 },
630 { 0x40055, 0x0 },
631 { 0x40075, 0x0 },
632 { 0x40016, 0x60a },
633 { 0x40036, 0x15 },
634 { 0x40056, 0x1200 },
635 { 0x40076, 0x0 },
636 { 0x40017, 0x61a },
637 { 0x40037, 0x15 },
638 { 0x40057, 0x1300 },
639 { 0x40077, 0x0 },
640 { 0x40018, 0x60a },
641 { 0x40038, 0x1a },
642 { 0x40058, 0x1200 },
643 { 0x40078, 0x0 },
644 { 0x40019, 0x642 },
645 { 0x40039, 0x1a },
646 { 0x40059, 0x1300 },
647 { 0x40079, 0x0 },
648 { 0x4001a, 0x4808 },
649 { 0x4003a, 0x880 },
650 { 0x4005a, 0x0 },
651 { 0x4007a, 0x0 },
652 { 0x900a4, 0x0 },
653 { 0x900a5, 0x790 },
654 { 0x900a6, 0x11a },
655 { 0x900a7, 0x8 },
656 { 0x900a8, 0x7aa },
657 { 0x900a9, 0x2a },
658 { 0x900aa, 0x10 },
659 { 0x900ab, 0x7b2 },
660 { 0x900ac, 0x2a },
661 { 0x900ad, 0x0 },
662 { 0x900ae, 0x7c8 },
663 { 0x900af, 0x109 },
664 { 0x900b0, 0x10 },
665 { 0x900b1, 0x10 },
666 { 0x900b2, 0x109 },
667 { 0x900b3, 0x10 },
668 { 0x900b4, 0x2a8 },
669 { 0x900b5, 0x129 },
670 { 0x900b6, 0x8 },
671 { 0x900b7, 0x370 },
672 { 0x900b8, 0x129 },
673 { 0x900b9, 0xa },
674 { 0x900ba, 0x3c8 },
675 { 0x900bb, 0x1a9 },
676 { 0x900bc, 0xc },
677 { 0x900bd, 0x408 },
678 { 0x900be, 0x199 },
679 { 0x900bf, 0x14 },
680 { 0x900c0, 0x790 },
681 { 0x900c1, 0x11a },
682 { 0x900c2, 0x8 },
683 { 0x900c3, 0x4 },
684 { 0x900c4, 0x18 },
685 { 0x900c5, 0xe },
686 { 0x900c6, 0x408 },
687 { 0x900c7, 0x199 },
688 { 0x900c8, 0x8 },
689 { 0x900c9, 0x8568 },
690 { 0x900ca, 0x108 },
691 { 0x900cb, 0x18 },
692 { 0x900cc, 0x790 },
693 { 0x900cd, 0x16a },
694 { 0x900ce, 0x8 },
695 { 0x900cf, 0x1d8 },
696 { 0x900d0, 0x169 },
697 { 0x900d1, 0x10 },
698 { 0x900d2, 0x8558 },
699 { 0x900d3, 0x168 },
700 { 0x900d4, 0x70 },
701 { 0x900d5, 0x788 },
702 { 0x900d6, 0x16a },
703 { 0x900d7, 0x1ff8 },
704 { 0x900d8, 0x85a8 },
705 { 0x900d9, 0x1e8 },
706 { 0x900da, 0x50 },
707 { 0x900db, 0x798 },
708 { 0x900dc, 0x16a },
709 { 0x900dd, 0x60 },
710 { 0x900de, 0x7a0 },
711 { 0x900df, 0x16a },
712 { 0x900e0, 0x8 },
713 { 0x900e1, 0x8310 },
714 { 0x900e2, 0x168 },
715 { 0x900e3, 0x8 },
716 { 0x900e4, 0xa310 },
717 { 0x900e5, 0x168 },
718 { 0x900e6, 0xa },
719 { 0x900e7, 0x408 },
720 { 0x900e8, 0x169 },
721 { 0x900e9, 0x6e },
722 { 0x900ea, 0x0 },
723 { 0x900eb, 0x68 },
724 { 0x900ec, 0x0 },
725 { 0x900ed, 0x408 },
726 { 0x900ee, 0x169 },
727 { 0x900ef, 0x0 },
728 { 0x900f0, 0x8310 },
729 { 0x900f1, 0x168 },
730 { 0x900f2, 0x0 },
731 { 0x900f3, 0xa310 },
732 { 0x900f4, 0x168 },
733 { 0x900f5, 0x1ff8 },
734 { 0x900f6, 0x85a8 },
735 { 0x900f7, 0x1e8 },
736 { 0x900f8, 0x68 },
737 { 0x900f9, 0x798 },
738 { 0x900fa, 0x16a },
739 { 0x900fb, 0x78 },
740 { 0x900fc, 0x7a0 },
741 { 0x900fd, 0x16a },
742 { 0x900fe, 0x68 },
743 { 0x900ff, 0x790 },
744 { 0x90100, 0x16a },
745 { 0x90101, 0x8 },
746 { 0x90102, 0x8b10 },
747 { 0x90103, 0x168 },
748 { 0x90104, 0x8 },
749 { 0x90105, 0xab10 },
750 { 0x90106, 0x168 },
751 { 0x90107, 0xa },
752 { 0x90108, 0x408 },
753 { 0x90109, 0x169 },
754 { 0x9010a, 0x58 },
755 { 0x9010b, 0x0 },
756 { 0x9010c, 0x68 },
757 { 0x9010d, 0x0 },
758 { 0x9010e, 0x408 },
759 { 0x9010f, 0x169 },
760 { 0x90110, 0x0 },
761 { 0x90111, 0x8b10 },
762 { 0x90112, 0x168 },
763 { 0x90113, 0x0 },
764 { 0x90114, 0xab10 },
765 { 0x90115, 0x168 },
766 { 0x90116, 0x0 },
767 { 0x90117, 0x1d8 },
768 { 0x90118, 0x169 },
769 { 0x90119, 0x80 },
770 { 0x9011a, 0x790 },
771 { 0x9011b, 0x16a },
772 { 0x9011c, 0x18 },
773 { 0x9011d, 0x7aa },
774 { 0x9011e, 0x6a },
775 { 0x9011f, 0xa },
776 { 0x90120, 0x0 },
777 { 0x90121, 0x1e9 },
778 { 0x90122, 0x8 },
779 { 0x90123, 0x8080 },
780 { 0x90124, 0x108 },
781 { 0x90125, 0xf },
782 { 0x90126, 0x408 },
783 { 0x90127, 0x169 },
784 { 0x90128, 0xc },
785 { 0x90129, 0x0 },
786 { 0x9012a, 0x68 },
787 { 0x9012b, 0x9 },
788 { 0x9012c, 0x0 },
789 { 0x9012d, 0x1a9 },
790 { 0x9012e, 0x0 },
791 { 0x9012f, 0x408 },
792 { 0x90130, 0x169 },
793 { 0x90131, 0x0 },
794 { 0x90132, 0x8080 },
795 { 0x90133, 0x108 },
796 { 0x90134, 0x8 },
797 { 0x90135, 0x7aa },
798 { 0x90136, 0x6a },
799 { 0x90137, 0x0 },
800 { 0x90138, 0x8568 },
801 { 0x90139, 0x108 },
802 { 0x9013a, 0xb7 },
803 { 0x9013b, 0x790 },
804 { 0x9013c, 0x16a },
805 { 0x9013d, 0x1f },
806 { 0x9013e, 0x0 },
807 { 0x9013f, 0x68 },
808 { 0x90140, 0x8 },
809 { 0x90141, 0x8558 },
810 { 0x90142, 0x168 },
811 { 0x90143, 0xf },
812 { 0x90144, 0x408 },
813 { 0x90145, 0x169 },
814 { 0x90146, 0xd },
815 { 0x90147, 0x0 },
816 { 0x90148, 0x68 },
817 { 0x90149, 0x0 },
818 { 0x9014a, 0x408 },
819 { 0x9014b, 0x169 },
820 { 0x9014c, 0x0 },
821 { 0x9014d, 0x8558 },
822 { 0x9014e, 0x168 },
823 { 0x9014f, 0x8 },
824 { 0x90150, 0x3c8 },
825 { 0x90151, 0x1a9 },
826 { 0x90152, 0x3 },
827 { 0x90153, 0x370 },
828 { 0x90154, 0x129 },
829 { 0x90155, 0x20 },
830 { 0x90156, 0x2aa },
831 { 0x90157, 0x9 },
832 { 0x90158, 0x0 },
833 { 0x90159, 0x400 },
834 { 0x9015a, 0x10e },
835 { 0x9015b, 0x8 },
836 { 0x9015c, 0xe8 },
837 { 0x9015d, 0x109 },
838 { 0x9015e, 0x0 },
839 { 0x9015f, 0x8140 },
840 { 0x90160, 0x10c },
841 { 0x90161, 0x10 },
842 { 0x90162, 0x8138 },
843 { 0x90163, 0x10c },
844 { 0x90164, 0x8 },
845 { 0x90165, 0x7c8 },
846 { 0x90166, 0x101 },
847 { 0x90167, 0x8 },
848 { 0x90168, 0x448 },
849 { 0x90169, 0x109 },
850 { 0x9016a, 0xf },
851 { 0x9016b, 0x7c0 },
852 { 0x9016c, 0x109 },
853 { 0x9016d, 0x0 },
854 { 0x9016e, 0xe8 },
855 { 0x9016f, 0x109 },
856 { 0x90170, 0x47 },
857 { 0x90171, 0x630 },
858 { 0x90172, 0x109 },
859 { 0x90173, 0x8 },
860 { 0x90174, 0x618 },
861 { 0x90175, 0x109 },
862 { 0x90176, 0x8 },
863 { 0x90177, 0xe0 },
864 { 0x90178, 0x109 },
865 { 0x90179, 0x0 },
866 { 0x9017a, 0x7c8 },
867 { 0x9017b, 0x109 },
868 { 0x9017c, 0x8 },
869 { 0x9017d, 0x8140 },
870 { 0x9017e, 0x10c },
871 { 0x9017f, 0x0 },
872 { 0x90180, 0x1 },
873 { 0x90181, 0x8 },
874 { 0x90182, 0x8 },
875 { 0x90183, 0x4 },
876 { 0x90184, 0x8 },
877 { 0x90185, 0x8 },
878 { 0x90186, 0x7c8 },
879 { 0x90187, 0x101 },
880 { 0x90006, 0x0 },
881 { 0x90007, 0x0 },
882 { 0x90008, 0x8 },
883 { 0x90009, 0x0 },
884 { 0x9000a, 0x0 },
885 { 0x9000b, 0x0 },
886 { 0xd00e7, 0x400 },
887 { 0x90017, 0x0 },
888 { 0x9001f, 0x29 },
889 { 0x90026, 0x6a },
890 { 0x400d0, 0x0 },
891 { 0x400d1, 0x101 },
892 { 0x400d2, 0x105 },
893 { 0x400d3, 0x107 },
894 { 0x400d4, 0x10f },
895 { 0x400d5, 0x202 },
896 { 0x400d6, 0x20a },
897 { 0x400d7, 0x20b },
898 { 0x2003a, 0x2 },
899 { 0x2000b, 0x64 },
900 { 0x2000c, 0xc8 },
901 { 0x2000d, 0x7d0 },
902 { 0x2000e, 0x2c },
903 { 0x12000b, 0xc },
904 { 0x12000c, 0x19 },
905 { 0x12000d, 0xfa },
906 { 0x12000e, 0x10 },
907 { 0x22000b, 0x3 },
908 { 0x22000c, 0x6 },
909 { 0x22000d, 0x3e },
910 { 0x22000e, 0x10 },
911 { 0x9000c, 0x0 },
912 { 0x9000d, 0x173 },
913 { 0x9000e, 0x60 },
914 { 0x9000f, 0x6110 },
915 { 0x90010, 0x2152 },
916 { 0x90011, 0xdfbd },
917 { 0x90012, 0x2060 },
918 { 0x90013, 0x6152 },
919 { 0x20010, 0x5a },
920 { 0x20011, 0x3 },
921 { 0x120010, 0x5a },
922 { 0x120011, 0x3 },
923 { 0x220010, 0x5a },
924 { 0x220011, 0x3 },
925 { 0x40080, 0xe0 },
926 { 0x40081, 0x12 },
927 { 0x40082, 0xe0 },
928 { 0x40083, 0x12 },
929 { 0x40084, 0xe0 },
930 { 0x40085, 0x12 },
931 { 0x140080, 0xe0 },
932 { 0x140081, 0x12 },
933 { 0x140082, 0xe0 },
934 { 0x140083, 0x12 },
935 { 0x140084, 0xe0 },
936 { 0x140085, 0x12 },
937 { 0x240080, 0xe0 },
938 { 0x240081, 0x12 },
939 { 0x240082, 0xe0 },
940 { 0x240083, 0x12 },
941 { 0x240084, 0xe0 },
942 { 0x240085, 0x12 },
943 { 0x400fd, 0xf },
944 { 0x10011, 0x1 },
945 { 0x10012, 0x1 },
946 { 0x10013, 0x180 },
947 { 0x10018, 0x1 },
948 { 0x10002, 0x6209 },
949 { 0x100b2, 0x1 },
950 { 0x101b4, 0x1 },
951 { 0x102b4, 0x1 },
952 { 0x103b4, 0x1 },
953 { 0x104b4, 0x1 },
954 { 0x105b4, 0x1 },
955 { 0x106b4, 0x1 },
956 { 0x107b4, 0x1 },
957 { 0x108b4, 0x1 },
958 { 0x11011, 0x1 },
959 { 0x11012, 0x1 },
960 { 0x11013, 0x180 },
961 { 0x11018, 0x1 },
962 { 0x11002, 0x6209 },
963 { 0x110b2, 0x1 },
964 { 0x111b4, 0x1 },
965 { 0x112b4, 0x1 },
966 { 0x113b4, 0x1 },
967 { 0x114b4, 0x1 },
968 { 0x115b4, 0x1 },
969 { 0x116b4, 0x1 },
970 { 0x117b4, 0x1 },
971 { 0x118b4, 0x1 },
972 { 0x20089, 0x1 },
973 { 0x20088, 0x19 },
974 { 0xc0080, 0x2 },
975 { 0xd0000, 0x1 }
976};
977
978/*
979 * Generated code from MX8M_DDR_tool v3.20 using RPAv15
980 * - imx8mn-gw7902 1x Micron MT53D512M16D1 16bit single-die for total of 1GiB
981 */
982/* P0 message block paremeter for training firmware */
983static struct dram_cfg_param ddr_ddrc_cfg_1gb_single_die[] = {
984 /** Initialize DDRC registers **/
985 { 0x3d400304, 0x1 },
986 { 0x3d400030, 0x1 },
987 { 0x3d400000, 0xa1080020 },
988 { 0x3d400020, 0x213 },
989 { 0x3d400024, 0x3e800 },
990 { 0x3d400064, 0x6100e0 },
991 { 0x3d4000d0, 0xc003061c },
992 { 0x3d4000d4, 0x9e0000 },
993 { 0x3d4000dc, 0xd4002d },
994 { 0x3d4000e0, 0x310000 },
995 { 0x3d4000e8, 0x66004d },
996 { 0x3d4000ec, 0x16004d },
997 { 0x3d400100, 0x1a201b22 },
998 { 0x3d400104, 0x60633 },
999 { 0x3d40010c, 0xc0c000 },
1000 { 0x3d400110, 0xf04080f },
1001 { 0x3d400114, 0x2040c0c },
1002 { 0x3d400118, 0x1010007 },
1003 { 0x3d40011c, 0x401 },
1004 { 0x3d400130, 0x20600 },
1005 { 0x3d400134, 0xc100002 },
1006 { 0x3d400138, 0xe6 },
1007 { 0x3d400144, 0xa00050 },
1008 { 0x3d400180, 0x3200018 },
1009 { 0x3d400184, 0x28061a8 },
1010 { 0x3d400188, 0x0 },
1011 { 0x3d400190, 0x497820a },
1012 { 0x3d400194, 0x80303 },
1013 { 0x3d4001b4, 0x170a },
1014 { 0x3d4001a0, 0xe0400018 },
1015 { 0x3d4001a4, 0xdf00e4 },
1016 { 0x3d4001a8, 0x80000000 },
1017 { 0x3d4001b0, 0x11 },
1018 { 0x3d4001c0, 0x1 },
1019 { 0x3d4001c4, 0x1 },
1020 { 0x3d4000f4, 0xc99 },
1021 { 0x3d400108, 0x70e1617 },
1022 { 0x3d400200, 0x1f },
1023 { 0x3d40020c, 0x0 },
1024 { 0x3d400210, 0x1f1f },
1025 { 0x3d400204, 0x80808 },
1026 { 0x3d400214, 0x7070707 },
1027 { 0x3d400218, 0x7070707 },
1028 { 0x3d400250, 0x29001701 },
1029 { 0x3d400254, 0x2c },
1030 { 0x3d40025c, 0x4000030 },
1031 { 0x3d400264, 0x900093e7 },
1032 { 0x3d40026c, 0x2005574 },
1033 { 0x3d400400, 0x111 },
1034 { 0x3d400408, 0x72ff },
1035 { 0x3d400494, 0x2100e07 },
1036 { 0x3d400498, 0x620096 },
1037 { 0x3d40049c, 0x1100e07 },
1038 { 0x3d4004a0, 0xc8012c },
1039 { 0x3d402020, 0x11 },
1040 { 0x3d402024, 0x7d00 },
1041 { 0x3d402050, 0x20d040 },
1042 { 0x3d402064, 0xc001c },
1043 { 0x3d4020dc, 0x840000 },
1044 { 0x3d4020e0, 0x310000 },
1045 { 0x3d4020e8, 0x66004d },
1046 { 0x3d4020ec, 0x16004d },
1047 { 0x3d402100, 0xa040305 },
1048 { 0x3d402104, 0x30407 },
1049 { 0x3d402108, 0x203060b },
1050 { 0x3d40210c, 0x505000 },
1051 { 0x3d402110, 0x2040202 },
1052 { 0x3d402114, 0x2030202 },
1053 { 0x3d402118, 0x1010004 },
1054 { 0x3d40211c, 0x301 },
1055 { 0x3d402130, 0x20300 },
1056 { 0x3d402134, 0xa100002 },
1057 { 0x3d402138, 0x1d },
1058 { 0x3d402144, 0x14000a },
1059 { 0x3d402180, 0x640004 },
1060 { 0x3d402190, 0x3818200 },
1061 { 0x3d402194, 0x80303 },
1062 { 0x3d4021b4, 0x100 },
1063 { 0x3d4020f4, 0xc99 },
1064 { 0x3d403020, 0x11 },
1065 { 0x3d403024, 0x1f40 },
1066 { 0x3d403050, 0x20d040 },
1067 { 0x3d403064, 0x30007 },
1068 { 0x3d4030dc, 0x840000 },
1069 { 0x3d4030e0, 0x310000 },
1070 { 0x3d4030e8, 0x66004d },
1071 { 0x3d4030ec, 0x16004d },
1072 { 0x3d403100, 0xa010102 },
1073 { 0x3d403104, 0x30404 },
1074 { 0x3d403108, 0x203060b },
1075 { 0x3d40310c, 0x505000 },
1076 { 0x3d403110, 0x2040202 },
1077 { 0x3d403114, 0x2030202 },
1078 { 0x3d403118, 0x1010004 },
1079 { 0x3d40311c, 0x301 },
1080 { 0x3d403130, 0x20300 },
1081 { 0x3d403134, 0xa100002 },
1082 { 0x3d403138, 0x8 },
1083 { 0x3d403144, 0x50003 },
1084 { 0x3d403180, 0x190004 },
1085 { 0x3d403190, 0x3818200 },
1086 { 0x3d403194, 0x80303 },
1087 { 0x3d4031b4, 0x100 },
1088 { 0x3d4030f4, 0xc99 },
1089 { 0x3d400028, 0x0 },
1090};
1091
1092/* PHY Initialize Configuration */
1093static struct dram_cfg_param ddr_ddrphy_cfg_1gb_single_die[] = {
1094 { 0x100a0, 0x0 },
1095 { 0x100a1, 0x1 },
1096 { 0x100a2, 0x3 },
1097 { 0x100a3, 0x4 },
1098 { 0x100a4, 0x5 },
1099 { 0x100a5, 0x2 },
1100 { 0x100a6, 0x7 },
1101 { 0x100a7, 0x6 },
1102 { 0x110a0, 0x0 },
1103 { 0x110a1, 0x1 },
1104 { 0x110a2, 0x2 },
1105 { 0x110a3, 0x3 },
1106 { 0x110a4, 0x4 },
1107 { 0x110a5, 0x5 },
1108 { 0x110a6, 0x6 },
1109 { 0x110a7, 0x7 },
1110 { 0x1005f, 0x1ff },
1111 { 0x1015f, 0x1ff },
1112 { 0x1105f, 0x1ff },
1113 { 0x1115f, 0x1ff },
1114 { 0x11005f, 0x1ff },
1115 { 0x11015f, 0x1ff },
1116 { 0x11105f, 0x1ff },
1117 { 0x11115f, 0x1ff },
1118 { 0x21005f, 0x1ff },
1119 { 0x21015f, 0x1ff },
1120 { 0x21105f, 0x1ff },
1121 { 0x21115f, 0x1ff },
1122 { 0x55, 0x1ff },
1123 { 0x1055, 0x1ff },
1124 { 0x2055, 0x1ff },
1125 { 0x3055, 0x1ff },
1126 { 0x4055, 0x1ff },
1127 { 0x5055, 0x1ff },
1128 { 0x6055, 0x1ff },
1129 { 0x7055, 0x1ff },
1130 { 0x8055, 0x1ff },
1131 { 0x9055, 0x1ff },
1132 { 0x200c5, 0x19 },
1133 { 0x1200c5, 0x7 },
1134 { 0x2200c5, 0x7 },
1135 { 0x2002e, 0x2 },
1136 { 0x12002e, 0x2 },
1137 { 0x22002e, 0x2 },
1138 { 0x90204, 0x0 },
1139 { 0x190204, 0x0 },
1140 { 0x290204, 0x0 },
1141 { 0x20024, 0x1a3 },
1142 { 0x2003a, 0x2 },
1143 { 0x120024, 0x1a3 },
1144 { 0x2003a, 0x2 },
1145 { 0x220024, 0x1a3 },
1146 { 0x2003a, 0x2 },
1147 { 0x20056, 0x3 },
1148 { 0x120056, 0x3 },
1149 { 0x220056, 0x3 },
1150 { 0x1004d, 0xe00 },
1151 { 0x1014d, 0xe00 },
1152 { 0x1104d, 0xe00 },
1153 { 0x1114d, 0xe00 },
1154 { 0x11004d, 0xe00 },
1155 { 0x11014d, 0xe00 },
1156 { 0x11104d, 0xe00 },
1157 { 0x11114d, 0xe00 },
1158 { 0x21004d, 0xe00 },
1159 { 0x21014d, 0xe00 },
1160 { 0x21104d, 0xe00 },
1161 { 0x21114d, 0xe00 },
1162 { 0x10049, 0xeba },
1163 { 0x10149, 0xeba },
1164 { 0x11049, 0xeba },
1165 { 0x11149, 0xeba },
1166 { 0x110049, 0xeba },
1167 { 0x110149, 0xeba },
1168 { 0x111049, 0xeba },
1169 { 0x111149, 0xeba },
1170 { 0x210049, 0xeba },
1171 { 0x210149, 0xeba },
1172 { 0x211049, 0xeba },
1173 { 0x211149, 0xeba },
1174 { 0x43, 0x63 },
1175 { 0x1043, 0x63 },
1176 { 0x2043, 0x63 },
1177 { 0x3043, 0x63 },
1178 { 0x4043, 0x63 },
1179 { 0x5043, 0x63 },
1180 { 0x6043, 0x63 },
1181 { 0x7043, 0x63 },
1182 { 0x8043, 0x63 },
1183 { 0x9043, 0x63 },
1184 { 0x20018, 0x1 },
1185 { 0x20075, 0x4 },
1186 { 0x20050, 0x0 },
1187 { 0x20008, 0x320 },
1188 { 0x120008, 0x64 },
1189 { 0x220008, 0x19 },
1190 { 0x20088, 0x9 },
1191 { 0x200b2, 0xdc },
1192 { 0x10043, 0x5a1 },
1193 { 0x10143, 0x5a1 },
1194 { 0x11043, 0x5a1 },
1195 { 0x11143, 0x5a1 },
1196 { 0x1200b2, 0xdc },
1197 { 0x110043, 0x5a1 },
1198 { 0x110143, 0x5a1 },
1199 { 0x111043, 0x5a1 },
1200 { 0x111143, 0x5a1 },
1201 { 0x2200b2, 0xdc },
1202 { 0x210043, 0x5a1 },
1203 { 0x210143, 0x5a1 },
1204 { 0x211043, 0x5a1 },
1205 { 0x211143, 0x5a1 },
1206 { 0x200fa, 0x1 },
1207 { 0x1200fa, 0x1 },
1208 { 0x2200fa, 0x1 },
1209 { 0x20019, 0x1 },
1210 { 0x120019, 0x1 },
1211 { 0x220019, 0x1 },
1212 { 0x200f0, 0x660 },
1213 { 0x200f1, 0x0 },
1214 { 0x200f2, 0x4444 },
1215 { 0x200f3, 0x8888 },
1216 { 0x200f4, 0x5665 },
1217 { 0x200f5, 0x0 },
1218 { 0x200f6, 0x0 },
1219 { 0x200f7, 0xf000 },
1220 { 0x20025, 0x0 },
1221 { 0x2002d, 0x0 },
1222 { 0x12002d, 0x0 },
1223 { 0x22002d, 0x0 },
1224 { 0x2005b, 0x7529 },
1225 { 0x2005c, 0x0 },
1226 { 0x200c7, 0x21 },
1227 { 0x200ca, 0x24 },
1228 { 0x200cc, 0x1f7 },
1229 { 0x1200c7, 0x21 },
1230 { 0x1200ca, 0x24 },
1231 { 0x1200cc, 0x1f7 },
1232 { 0x2200c7, 0x21 },
1233 { 0x2200ca, 0x24 },
1234 { 0x2200cc, 0x1f7 },
1235 { 0x2007d, 0x212 },
1236 { 0x12007d, 0x212 },
1237 { 0x22007d, 0x212 },
1238 { 0x2007c, 0x61 },
1239 { 0x12007c, 0x61 },
1240 { 0x22007c, 0x61 },
1241 { 0x1004a, 0x500 },
1242 { 0x1104a, 0x500 },
1243 { 0x2002c, 0x0 },
1244};
1245
1246static struct dram_cfg_param ddr_fsp0_cfg_1gb_single_die[] = {
1247 { 0xd0000, 0x0 },
1248 { 0x54003, 0xc80 },
1249 { 0x54004, 0x2 },
1250 { 0x54005, 0x2228 },
1251 { 0x54006, 0x11 },
1252 { 0x54008, 0x131f },
1253 { 0x54009, 0xc8 },
1254 { 0x5400b, 0x2 },
1255 { 0x5400f, 0x100 },
1256 { 0x54012, 0x110 },
1257 { 0x54019, 0x2dd4 },
1258 { 0x5401a, 0x31 },
1259 { 0x5401b, 0x4d66 },
1260 { 0x5401c, 0x4d00 },
1261 { 0x5401e, 0x16 },
1262 { 0x5401f, 0x2dd4 },
1263 { 0x54020, 0x31 },
1264 { 0x54021, 0x4d66 },
1265 { 0x54022, 0x4d00 },
1266 { 0x54024, 0x16 },
1267 { 0x54032, 0xd400 },
1268 { 0x54033, 0x312d },
1269 { 0x54034, 0x6600 },
1270 { 0x54035, 0x4d },
1271 { 0x54036, 0x4d },
1272 { 0x54037, 0x1600 },
1273 { 0x54038, 0xd400 },
1274 { 0x54039, 0x312d },
1275 { 0x5403a, 0x6600 },
1276 { 0x5403b, 0x4d },
1277 { 0x5403c, 0x4d },
1278 { 0x5403d, 0x1600 },
1279 { 0xd0000, 0x1 },
1280};
1281
1282/* P1 message block paremeter for training firmware */
1283static struct dram_cfg_param ddr_fsp1_cfg_1gb_single_die[] = {
1284 { 0xd0000, 0x0 },
1285 { 0x54002, 0x101 },
1286 { 0x54003, 0x190 },
1287 { 0x54004, 0x2 },
1288 { 0x54005, 0x2228 },
1289 { 0x54006, 0x11 },
1290 { 0x54008, 0x121f },
1291 { 0x54009, 0xc8 },
1292 { 0x5400b, 0x2 },
1293 { 0x5400f, 0x100 },
1294 { 0x54012, 0x110 },
1295 { 0x54019, 0x84 },
1296 { 0x5401a, 0x31 },
1297 { 0x5401b, 0x4d66 },
1298 { 0x5401c, 0x4d00 },
1299 { 0x5401e, 0x16 },
1300 { 0x5401f, 0x84 },
1301 { 0x54020, 0x31 },
1302 { 0x54021, 0x4d66 },
1303 { 0x54022, 0x4d00 },
1304 { 0x54024, 0x16 },
1305 { 0x54032, 0x8400 },
1306 { 0x54033, 0x3100 },
1307 { 0x54034, 0x6600 },
1308 { 0x54035, 0x4d },
1309 { 0x54036, 0x4d },
1310 { 0x54037, 0x1600 },
1311 { 0x54038, 0x8400 },
1312 { 0x54039, 0x3100 },
1313 { 0x5403a, 0x6600 },
1314 { 0x5403b, 0x4d },
1315 { 0x5403c, 0x4d },
1316 { 0x5403d, 0x1600 },
1317 { 0xd0000, 0x1 },
1318};
1319
1320/* P2 message block paremeter for training firmware */
1321static struct dram_cfg_param ddr_fsp2_cfg_1gb_single_die[] = {
1322 { 0xd0000, 0x0 },
1323 { 0x54002, 0x102 },
1324 { 0x54003, 0x64 },
1325 { 0x54004, 0x2 },
1326 { 0x54005, 0x2228 },
1327 { 0x54006, 0x11 },
1328 { 0x54008, 0x121f },
1329 { 0x54009, 0xc8 },
1330 { 0x5400b, 0x2 },
1331 { 0x5400f, 0x100 },
1332 { 0x54012, 0x110 },
1333 { 0x54019, 0x84 },
1334 { 0x5401a, 0x31 },
1335 { 0x5401b, 0x4d66 },
1336 { 0x5401c, 0x4d00 },
1337 { 0x5401e, 0x16 },
1338 { 0x5401f, 0x84 },
1339 { 0x54020, 0x31 },
1340 { 0x54021, 0x4d66 },
1341 { 0x54022, 0x4d00 },
1342 { 0x54024, 0x16 },
1343 { 0x54032, 0x8400 },
1344 { 0x54033, 0x3100 },
1345 { 0x54034, 0x6600 },
1346 { 0x54035, 0x4d },
1347 { 0x54036, 0x4d },
1348 { 0x54037, 0x1600 },
1349 { 0x54038, 0x8400 },
1350 { 0x54039, 0x3100 },
1351 { 0x5403a, 0x6600 },
1352 { 0x5403b, 0x4d },
1353 { 0x5403c, 0x4d },
1354 { 0x5403d, 0x1600 },
1355 { 0xd0000, 0x1 },
1356};
1357
1358/* P0 2D message block paremeter for training firmware */
1359static struct dram_cfg_param ddr_fsp0_2d_cfg_1gb_single_die[] = {
1360 { 0xd0000, 0x0 },
1361 { 0x54003, 0xc80 },
1362 { 0x54004, 0x2 },
1363 { 0x54005, 0x2228 },
1364 { 0x54006, 0x11 },
1365 { 0x54008, 0x61 },
1366 { 0x54009, 0xc8 },
1367 { 0x5400b, 0x2 },
1368 { 0x5400f, 0x100 },
1369 { 0x54010, 0x1f7f },
1370 { 0x54012, 0x110 },
1371 { 0x54019, 0x2dd4 },
1372 { 0x5401a, 0x31 },
1373 { 0x5401b, 0x4d66 },
1374 { 0x5401c, 0x4d00 },
1375 { 0x5401e, 0x16 },
1376 { 0x5401f, 0x2dd4 },
1377 { 0x54020, 0x31 },
1378 { 0x54021, 0x4d66 },
1379 { 0x54022, 0x4d00 },
1380 { 0x54024, 0x16 },
1381 { 0x54032, 0xd400 },
1382 { 0x54033, 0x312d },
1383 { 0x54034, 0x6600 },
1384 { 0x54035, 0x4d },
1385 { 0x54036, 0x4d },
1386 { 0x54037, 0x1600 },
1387 { 0x54038, 0xd400 },
1388 { 0x54039, 0x312d },
1389 { 0x5403a, 0x6600 },
1390 { 0x5403b, 0x4d },
1391 { 0x5403c, 0x4d },
1392 { 0x5403d, 0x1600 },
1393 { 0xd0000, 0x1 },
1394};
1395
1396static struct dram_fsp_msg ddr_dram_fsp_msg_1gb_single_die[] = {
1397 {
1398 /* P0 3200mts 1D */
1399 .drate = 3200,
1400 .fw_type = FW_1D_IMAGE,
1401 .fsp_cfg = ddr_fsp0_cfg_1gb_single_die,
1402 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_cfg_1gb_single_die),
1403 },
1404 {
1405 /* P1 400mts 1D */
1406 .drate = 400,
1407 .fw_type = FW_1D_IMAGE,
1408 .fsp_cfg = ddr_fsp1_cfg_1gb_single_die,
1409 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp1_cfg_1gb_single_die),
1410 },
1411 {
1412 /* P2 100mts 1D */
1413 .drate = 100,
1414 .fw_type = FW_1D_IMAGE,
1415 .fsp_cfg = ddr_fsp2_cfg_1gb_single_die,
1416 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp2_cfg_1gb_single_die),
1417 },
1418 {
1419 /* P0 3200mts 2D */
1420 .drate = 3200,
1421 .fw_type = FW_2D_IMAGE,
1422 .fsp_cfg = ddr_fsp0_2d_cfg_1gb_single_die,
1423 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_2d_cfg_1gb_single_die),
1424 },
1425};
1426
1427/* ddr timing config params */
1428struct dram_timing_info dram_timing_1gb_single_die = {
1429 .ddrc_cfg = ddr_ddrc_cfg_1gb_single_die,
1430 .ddrc_cfg_num = ARRAY_SIZE(ddr_ddrc_cfg_1gb_single_die),
1431 .ddrphy_cfg = ddr_ddrphy_cfg_1gb_single_die,
1432 .ddrphy_cfg_num = ARRAY_SIZE(ddr_ddrphy_cfg_1gb_single_die),
1433 .fsp_msg = ddr_dram_fsp_msg_1gb_single_die,
1434 .fsp_msg_num = ARRAY_SIZE(ddr_dram_fsp_msg_1gb_single_die),
1435 .ddrphy_trained_csr = ddr_ddrphy_trained_csr,
1436 .ddrphy_trained_csr_num = ARRAY_SIZE(ddr_ddrphy_trained_csr),
1437 .ddrphy_pie = ddr_phy_pie,
1438 .ddrphy_pie_num = ARRAY_SIZE(ddr_phy_pie),
1439 .fsp_table = { 3200, 400, 100, },
1440};
1441
1442/*
1443 * Generated code from MX8M_DDR_tool v3.20 using RPAv15
1444 * - imx8mn-gw7902 - 2x Micron MT53E1G16D1FW 16bit single-die for total of 2GiB
1445 */
1446static struct dram_cfg_param ddr_ddrc_cfg_2gb_single_die[] = {
1447 /** Initialize DDRC registers **/
1448 { 0x3d400304, 0x1 },
1449 { 0x3d400030, 0x1 },
1450 { 0x3d400000, 0xa1080020 },
1451 { 0x3d400020, 0x203 },
1452 { 0x3d400024, 0x3e800 },
1453 { 0x3d400064, 0x610130 },
1454 { 0x3d4000d0, 0xc003061c },
1455 { 0x3d4000d4, 0x9e0000 },
1456 { 0x3d4000dc, 0xd4002d },
1457 { 0x3d4000e0, 0x310000 },
1458 { 0x3d4000e8, 0x66004d },
1459 { 0x3d4000ec, 0x16004d },
1460 { 0x3d400100, 0x1a201b22 },
1461 { 0x3d400104, 0x60633 },
1462 { 0x3d40010c, 0xc0c000 },
1463 { 0x3d400110, 0xf04080f },
1464 { 0x3d400114, 0x2040c0c },
1465 { 0x3d400118, 0x1010007 },
1466 { 0x3d40011c, 0x401 },
1467 { 0x3d400130, 0x20600 },
1468 { 0x3d400134, 0xc100002 },
1469 { 0x3d400138, 0x136 },
1470 { 0x3d400144, 0xa00050 },
1471 { 0x3d400180, 0x3200018 },
1472 { 0x3d400184, 0x28061a8 },
1473 { 0x3d400188, 0x0 },
1474 { 0x3d400190, 0x497820a },
1475 { 0x3d400194, 0x80303 },
1476 { 0x3d4001b4, 0x170a },
1477 { 0x3d4001a0, 0xe0400018 },
1478 { 0x3d4001a4, 0xdf00e4 },
1479 { 0x3d4001a8, 0x80000000 },
1480 { 0x3d4001b0, 0x11 },
1481 { 0x3d4001c0, 0x1 },
1482 { 0x3d4001c4, 0x1 },
1483 { 0x3d4000f4, 0xc99 },
1484 { 0x3d400108, 0x70e1617 },
1485 { 0x3d400200, 0x1f },
1486 { 0x3d40020c, 0x0 },
1487 { 0x3d400210, 0x1f1f },
1488 { 0x3d400204, 0x80808 },
1489 { 0x3d400214, 0x7070707 },
1490 { 0x3d400218, 0x7070707 },
1491 { 0x3d40021c, 0x7 },
1492 { 0x3d400250, 0x29001701 },
1493 { 0x3d400254, 0x2c },
1494 { 0x3d40025c, 0x4000030 },
1495 { 0x3d400264, 0x900093e7 },
1496 { 0x3d40026c, 0x2005574 },
1497 { 0x3d400400, 0x111 },
1498 { 0x3d400408, 0x72ff },
1499 { 0x3d400494, 0x2100e07 },
1500 { 0x3d400498, 0x620096 },
1501 { 0x3d40049c, 0x1100e07 },
1502 { 0x3d4004a0, 0xc8012c },
1503 { 0x3d402020, 0x1 },
1504 { 0x3d402024, 0x7d00 },
1505 { 0x3d402050, 0x20d040 },
1506 { 0x3d402064, 0xc0026 },
1507 { 0x3d4020dc, 0x840000 },
1508 { 0x3d4020e0, 0x310000 },
1509 { 0x3d4020e8, 0x66004d },
1510 { 0x3d4020ec, 0x16004d },
1511 { 0x3d402100, 0xa040305 },
1512 { 0x3d402104, 0x30407 },
1513 { 0x3d402108, 0x203060b },
1514 { 0x3d40210c, 0x505000 },
1515 { 0x3d402110, 0x2040202 },
1516 { 0x3d402114, 0x2030202 },
1517 { 0x3d402118, 0x1010004 },
1518 { 0x3d40211c, 0x301 },
1519 { 0x3d402130, 0x20300 },
1520 { 0x3d402134, 0xa100002 },
1521 { 0x3d402138, 0x27 },
1522 { 0x3d402144, 0x14000a },
1523 { 0x3d402180, 0x640004 },
1524 { 0x3d402190, 0x3818200 },
1525 { 0x3d402194, 0x80303 },
1526 { 0x3d4021b4, 0x100 },
1527 { 0x3d4020f4, 0xc99 },
1528 { 0x3d403020, 0x1 },
1529 { 0x3d403024, 0x1f40 },
1530 { 0x3d403050, 0x20d040 },
1531 { 0x3d403064, 0x3000a },
1532 { 0x3d4030dc, 0x840000 },
1533 { 0x3d4030e0, 0x310000 },
1534 { 0x3d4030e8, 0x66004d },
1535 { 0x3d4030ec, 0x16004d },
1536 { 0x3d403100, 0xa010102 },
1537 { 0x3d403104, 0x30404 },
1538 { 0x3d403108, 0x203060b },
1539 { 0x3d40310c, 0x505000 },
1540 { 0x3d403110, 0x2040202 },
1541 { 0x3d403114, 0x2030202 },
1542 { 0x3d403118, 0x1010004 },
1543 { 0x3d40311c, 0x301 },
1544 { 0x3d403130, 0x20300 },
1545 { 0x3d403134, 0xa100002 },
1546 { 0x3d403138, 0xa },
1547 { 0x3d403144, 0x50003 },
1548 { 0x3d403180, 0x190004 },
1549 { 0x3d403190, 0x3818200 },
1550 { 0x3d403194, 0x80303 },
1551 { 0x3d4031b4, 0x100 },
1552 { 0x3d4030f4, 0xc99 },
1553 { 0x3d400028, 0x0 },
1554};
1555
1556/* PHY Initialize Configuration */
1557static struct dram_cfg_param ddr_ddrphy_cfg_2gb_single_die[] = {
1558 { 0x100a0, 0x0 },
1559 { 0x100a1, 0x1 },
1560 { 0x100a2, 0x2 },
1561 { 0x100a3, 0x3 },
1562 { 0x100a4, 0x4 },
1563 { 0x100a5, 0x5 },
1564 { 0x100a6, 0x6 },
1565 { 0x100a7, 0x7 },
1566 { 0x110a0, 0x0 },
1567 { 0x110a1, 0x1 },
1568 { 0x110a2, 0x3 },
1569 { 0x110a3, 0x4 },
1570 { 0x110a4, 0x5 },
1571 { 0x110a5, 0x2 },
1572 { 0x110a6, 0x7 },
1573 { 0x110a7, 0x6 },
1574 { 0x1005f, 0x1ff },
1575 { 0x1015f, 0x1ff },
1576 { 0x1105f, 0x1ff },
1577 { 0x1115f, 0x1ff },
1578 { 0x11005f, 0x1ff },
1579 { 0x11015f, 0x1ff },
1580 { 0x11105f, 0x1ff },
1581 { 0x11115f, 0x1ff },
1582 { 0x21005f, 0x1ff },
1583 { 0x21015f, 0x1ff },
1584 { 0x21105f, 0x1ff },
1585 { 0x21115f, 0x1ff },
1586 { 0x55, 0x1ff },
1587 { 0x1055, 0x1ff },
1588 { 0x2055, 0x1ff },
1589 { 0x3055, 0x1ff },
1590 { 0x4055, 0x1ff },
1591 { 0x5055, 0x1ff },
1592 { 0x6055, 0x1ff },
1593 { 0x7055, 0x1ff },
1594 { 0x8055, 0x1ff },
1595 { 0x9055, 0x1ff },
1596 { 0x200c5, 0x19 },
1597 { 0x1200c5, 0x7 },
1598 { 0x2200c5, 0x7 },
1599 { 0x2002e, 0x2 },
1600 { 0x12002e, 0x2 },
1601 { 0x22002e, 0x2 },
1602 { 0x90204, 0x0 },
1603 { 0x190204, 0x0 },
1604 { 0x290204, 0x0 },
1605 { 0x20024, 0x1a3 },
1606 { 0x2003a, 0x2 },
1607 { 0x120024, 0x1a3 },
1608 { 0x2003a, 0x2 },
1609 { 0x220024, 0x1a3 },
1610 { 0x2003a, 0x2 },
1611 { 0x20056, 0x3 },
1612 { 0x120056, 0x3 },
1613 { 0x220056, 0x3 },
1614 { 0x1004d, 0xe00 },
1615 { 0x1014d, 0xe00 },
1616 { 0x1104d, 0xe00 },
1617 { 0x1114d, 0xe00 },
1618 { 0x11004d, 0xe00 },
1619 { 0x11014d, 0xe00 },
1620 { 0x11104d, 0xe00 },
1621 { 0x11114d, 0xe00 },
1622 { 0x21004d, 0xe00 },
1623 { 0x21014d, 0xe00 },
1624 { 0x21104d, 0xe00 },
1625 { 0x21114d, 0xe00 },
1626 { 0x10049, 0xeba },
1627 { 0x10149, 0xeba },
1628 { 0x11049, 0xeba },
1629 { 0x11149, 0xeba },
1630 { 0x110049, 0xeba },
1631 { 0x110149, 0xeba },
1632 { 0x111049, 0xeba },
1633 { 0x111149, 0xeba },
1634 { 0x210049, 0xeba },
1635 { 0x210149, 0xeba },
1636 { 0x211049, 0xeba },
1637 { 0x211149, 0xeba },
1638 { 0x43, 0x63 },
1639 { 0x1043, 0x63 },
1640 { 0x2043, 0x63 },
1641 { 0x3043, 0x63 },
1642 { 0x4043, 0x63 },
1643 { 0x5043, 0x63 },
1644 { 0x6043, 0x63 },
1645 { 0x7043, 0x63 },
1646 { 0x8043, 0x63 },
1647 { 0x9043, 0x63 },
1648 { 0x20018, 0x1 },
1649 { 0x20075, 0x4 },
1650 { 0x20050, 0x0 },
1651 { 0x20008, 0x320 },
1652 { 0x120008, 0x64 },
1653 { 0x220008, 0x19 },
1654 { 0x20088, 0x9 },
1655 { 0x200b2, 0xdc },
1656 { 0x10043, 0x5a1 },
1657 { 0x10143, 0x5a1 },
1658 { 0x11043, 0x5a1 },
1659 { 0x11143, 0x5a1 },
1660 { 0x1200b2, 0xdc },
1661 { 0x110043, 0x5a1 },
1662 { 0x110143, 0x5a1 },
1663 { 0x111043, 0x5a1 },
1664 { 0x111143, 0x5a1 },
1665 { 0x2200b2, 0xdc },
1666 { 0x210043, 0x5a1 },
1667 { 0x210143, 0x5a1 },
1668 { 0x211043, 0x5a1 },
1669 { 0x211143, 0x5a1 },
1670 { 0x200fa, 0x1 },
1671 { 0x1200fa, 0x1 },
1672 { 0x2200fa, 0x1 },
1673 { 0x20019, 0x1 },
1674 { 0x120019, 0x1 },
1675 { 0x220019, 0x1 },
1676 { 0x200f0, 0x660 },
1677 { 0x200f1, 0x0 },
1678 { 0x200f2, 0x4444 },
1679 { 0x200f3, 0x8888 },
1680 { 0x200f4, 0x5665 },
1681 { 0x200f5, 0x0 },
1682 { 0x200f6, 0x0 },
1683 { 0x200f7, 0xf000 },
1684 { 0x20025, 0x0 },
1685 { 0x2002d, 0x0 },
1686 { 0x12002d, 0x0 },
1687 { 0x22002d, 0x0 },
1688 { 0x2005b, 0x7529 },
1689 { 0x2005c, 0x0 },
1690 { 0x200c7, 0x21 },
1691 { 0x200ca, 0x24 },
1692 { 0x200cc, 0x1f7 },
1693 { 0x1200c7, 0x21 },
1694 { 0x1200ca, 0x24 },
1695 { 0x1200cc, 0x1f7 },
1696 { 0x2200c7, 0x21 },
1697 { 0x2200ca, 0x24 },
1698 { 0x2200cc, 0x1f7 },
1699 { 0x2007d, 0x212 },
1700 { 0x12007d, 0x212 },
1701 { 0x22007d, 0x212 },
1702 { 0x2007c, 0x61 },
1703 { 0x12007c, 0x61 },
1704 { 0x22007c, 0x61 },
1705 { 0x1004a, 0x500 },
1706 { 0x1104a, 0x500 },
1707 { 0x2002c, 0x0 },
1708};
1709
1710/* P0 message block paremeter for training firmware */
1711static struct dram_cfg_param ddr_fsp0_cfg_2gb_single_die[] = {
1712 { 0xd0000, 0x0 },
1713 { 0x54003, 0xc80 },
1714 { 0x54004, 0x2 },
1715 { 0x54005, 0x2228 },
1716 { 0x54006, 0x11 },
1717 { 0x54008, 0x131f },
1718 { 0x54009, 0xc8 },
1719 { 0x5400b, 0x2 },
1720 { 0x5400f, 0x100 },
1721 { 0x54012, 0x110 },
1722 { 0x54019, 0x2dd4 },
1723 { 0x5401a, 0x31 },
1724 { 0x5401b, 0x4d66 },
1725 { 0x5401c, 0x4d00 },
1726 { 0x5401e, 0x16 },
1727 { 0x5401f, 0x2dd4 },
1728 { 0x54020, 0x31 },
1729 { 0x54021, 0x4d66 },
1730 { 0x54022, 0x4d00 },
1731 { 0x54024, 0x16 },
1732 { 0x54032, 0xd400 },
1733 { 0x54033, 0x312d },
1734 { 0x54034, 0x6600 },
1735 { 0x54035, 0x4d },
1736 { 0x54036, 0x4d },
1737 { 0x54037, 0x1600 },
1738 { 0x54038, 0xd400 },
1739 { 0x54039, 0x312d },
1740 { 0x5403a, 0x6600 },
1741 { 0x5403b, 0x4d },
1742 { 0x5403c, 0x4d },
1743 { 0x5403d, 0x1600 },
1744 { 0xd0000, 0x1 },
1745};
1746
1747/* P1 message block paremeter for training firmware */
1748static struct dram_cfg_param ddr_fsp1_cfg_2gb_single_die[] = {
1749 { 0xd0000, 0x0 },
1750 { 0x54002, 0x101 },
1751 { 0x54003, 0x190 },
1752 { 0x54004, 0x2 },
1753 { 0x54005, 0x2228 },
1754 { 0x54006, 0x11 },
1755 { 0x54008, 0x121f },
1756 { 0x54009, 0xc8 },
1757 { 0x5400b, 0x2 },
1758 { 0x5400f, 0x100 },
1759 { 0x54012, 0x110 },
1760 { 0x54019, 0x84 },
1761 { 0x5401a, 0x31 },
1762 { 0x5401b, 0x4d66 },
1763 { 0x5401c, 0x4d00 },
1764 { 0x5401e, 0x16 },
1765 { 0x5401f, 0x84 },
1766 { 0x54020, 0x31 },
1767 { 0x54021, 0x4d66 },
1768 { 0x54022, 0x4d00 },
1769 { 0x54024, 0x16 },
1770 { 0x54032, 0x8400 },
1771 { 0x54033, 0x3100 },
1772 { 0x54034, 0x6600 },
1773 { 0x54035, 0x4d },
1774 { 0x54036, 0x4d },
1775 { 0x54037, 0x1600 },
1776 { 0x54038, 0x8400 },
1777 { 0x54039, 0x3100 },
1778 { 0x5403a, 0x6600 },
1779 { 0x5403b, 0x4d },
1780 { 0x5403c, 0x4d },
1781 { 0x5403d, 0x1600 },
1782 { 0xd0000, 0x1 },
1783};
1784
1785/* P2 message block paremeter for training firmware */
1786static struct dram_cfg_param ddr_fsp2_cfg_2gb_single_die[] = {
1787 { 0xd0000, 0x0 },
1788 { 0x54002, 0x102 },
1789 { 0x54003, 0x64 },
1790 { 0x54004, 0x2 },
1791 { 0x54005, 0x2228 },
1792 { 0x54006, 0x11 },
1793 { 0x54008, 0x121f },
1794 { 0x54009, 0xc8 },
1795 { 0x5400b, 0x2 },
1796 { 0x5400f, 0x100 },
1797 { 0x54012, 0x110 },
1798 { 0x54019, 0x84 },
1799 { 0x5401a, 0x31 },
1800 { 0x5401b, 0x4d66 },
1801 { 0x5401c, 0x4d00 },
1802 { 0x5401e, 0x16 },
1803 { 0x5401f, 0x84 },
1804 { 0x54020, 0x31 },
1805 { 0x54021, 0x4d66 },
1806 { 0x54022, 0x4d00 },
1807 { 0x54024, 0x16 },
1808 { 0x54032, 0x8400 },
1809 { 0x54033, 0x3100 },
1810 { 0x54034, 0x6600 },
1811 { 0x54035, 0x4d },
1812 { 0x54036, 0x4d },
1813 { 0x54037, 0x1600 },
1814 { 0x54038, 0x8400 },
1815 { 0x54039, 0x3100 },
1816 { 0x5403a, 0x6600 },
1817 { 0x5403b, 0x4d },
1818 { 0x5403c, 0x4d },
1819 { 0x5403d, 0x1600 },
1820 { 0xd0000, 0x1 },
1821};
1822
1823/* P0 2D message block paremeter for training firmware */
1824static struct dram_cfg_param ddr_fsp0_2d_cfg_2gb_single_die[] = {
1825 { 0xd0000, 0x0 },
1826 { 0x54003, 0xc80 },
1827 { 0x54004, 0x2 },
1828 { 0x54005, 0x2228 },
1829 { 0x54006, 0x11 },
1830 { 0x54008, 0x61 },
1831 { 0x54009, 0xc8 },
1832 { 0x5400b, 0x2 },
1833 { 0x5400f, 0x100 },
1834 { 0x54010, 0x1f7f },
1835 { 0x54012, 0x110 },
1836 { 0x54019, 0x2dd4 },
1837 { 0x5401a, 0x31 },
1838 { 0x5401b, 0x4d66 },
1839 { 0x5401c, 0x4d00 },
1840 { 0x5401e, 0x16 },
1841 { 0x5401f, 0x2dd4 },
1842 { 0x54020, 0x31 },
1843 { 0x54021, 0x4d66 },
1844 { 0x54022, 0x4d00 },
1845 { 0x54024, 0x16 },
1846 { 0x54032, 0xd400 },
1847 { 0x54033, 0x312d },
1848 { 0x54034, 0x6600 },
1849 { 0x54035, 0x4d },
1850 { 0x54036, 0x4d },
1851 { 0x54037, 0x1600 },
1852 { 0x54038, 0xd400 },
1853 { 0x54039, 0x312d },
1854 { 0x5403a, 0x6600 },
1855 { 0x5403b, 0x4d },
1856 { 0x5403c, 0x4d },
1857 { 0x5403d, 0x1600 },
1858 { 0xd0000, 0x1 },
1859};
1860
1861static struct dram_fsp_msg ddr_dram_fsp_msg_2gb_single_die[] = {
1862 {
1863 /* P0 3200mts 1D */
1864 .drate = 3200,
1865 .fw_type = FW_1D_IMAGE,
1866 .fsp_cfg = ddr_fsp0_cfg_2gb_single_die,
1867 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_cfg_2gb_single_die),
1868 },
1869 {
1870 /* P1 400mts 1D */
1871 .drate = 400,
1872 .fw_type = FW_1D_IMAGE,
1873 .fsp_cfg = ddr_fsp1_cfg_2gb_single_die,
1874 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp1_cfg_2gb_single_die),
1875 },
1876 {
1877 /* P2 100mts 1D */
1878 .drate = 100,
1879 .fw_type = FW_1D_IMAGE,
1880 .fsp_cfg = ddr_fsp2_cfg_2gb_single_die,
1881 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp2_cfg_2gb_single_die),
1882 },
1883 {
1884 /* P0 3200mts 2D */
1885 .drate = 3200,
1886 .fw_type = FW_2D_IMAGE,
1887 .fsp_cfg = ddr_fsp0_2d_cfg_2gb_single_die,
1888 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_2d_cfg_2gb_single_die),
1889 },
1890};
1891
1892/* ddr timing config params */
1893struct dram_timing_info dram_timing_2gb_single_die = {
1894 .ddrc_cfg = ddr_ddrc_cfg_2gb_single_die,
1895 .ddrc_cfg_num = ARRAY_SIZE(ddr_ddrc_cfg_2gb_single_die),
1896 .ddrphy_cfg = ddr_ddrphy_cfg_2gb_single_die,
1897 .ddrphy_cfg_num = ARRAY_SIZE(ddr_ddrphy_cfg_2gb_single_die),
1898 .fsp_msg = ddr_dram_fsp_msg_2gb_single_die,
1899 .fsp_msg_num = ARRAY_SIZE(ddr_dram_fsp_msg_2gb_single_die),
1900 .ddrphy_trained_csr = ddr_ddrphy_trained_csr,
1901 .ddrphy_trained_csr_num = ARRAY_SIZE(ddr_ddrphy_trained_csr),
1902 .ddrphy_pie = ddr_phy_pie,
1903 .ddrphy_pie_num = ARRAY_SIZE(ddr_phy_pie),
1904 .fsp_table = { 3200, 400, 100, },
1905};
1906
1907/*
1908 * Generated code from MX8M_DDR_tool v3.20 using RPAv15
1909 * - imx8mn-gw7902 2x Kingston C1612PC2WDGTKR 16bit dual-die for total of 2GiB
1910 */
1911static struct dram_cfg_param ddr_ddrc_cfg_2gb_dual_die[] = {
1912 /** Initialize DDRC registers **/
1913 { 0x3d400304, 0x1 },
1914 { 0x3d400030, 0x1 },
1915 { 0x3d400000, 0xa3080020 },
1916 { 0x3d400020, 0x203 },
1917 { 0x3d400024, 0x3e800 },
1918 { 0x3d400064, 0x6100e0 },
1919 { 0x3d4000d0, 0xc003061c },
1920 { 0x3d4000d4, 0x9e0000 },
1921 { 0x3d4000dc, 0xd4002d },
1922 { 0x3d4000e0, 0x310000 },
1923 { 0x3d4000e8, 0x66004d },
1924 { 0x3d4000ec, 0x16004d },
1925 { 0x3d400100, 0x1a201b22 },
1926 { 0x3d400104, 0x60633 },
1927 { 0x3d40010c, 0xc0c000 },
1928 { 0x3d400110, 0xf04080f },
1929 { 0x3d400114, 0x2040c0c },
1930 { 0x3d400118, 0x1010007 },
1931 { 0x3d40011c, 0x401 },
1932 { 0x3d400130, 0x20600 },
1933 { 0x3d400134, 0xc100002 },
1934 { 0x3d400138, 0xe6 },
1935 { 0x3d400144, 0xa00050 },
1936 { 0x3d400180, 0x3200018 },
1937 { 0x3d400184, 0x28061a8 },
1938 { 0x3d400188, 0x0 },
1939 { 0x3d400190, 0x497820a },
1940 { 0x3d400194, 0x80303 },
1941 { 0x3d4001b4, 0x170a },
1942 { 0x3d4001a0, 0xe0400018 },
1943 { 0x3d4001a4, 0xdf00e4 },
1944 { 0x3d4001a8, 0x80000000 },
1945 { 0x3d4001b0, 0x11 },
1946 { 0x3d4001c0, 0x1 },
1947 { 0x3d4001c4, 0x1 },
1948 { 0x3d4000f4, 0xc99 },
1949 { 0x3d400108, 0x70e1617 },
1950 { 0x3d400200, 0x17 },
1951 { 0x3d40020c, 0x0 },
1952 { 0x3d400210, 0x1f1f },
1953 { 0x3d400204, 0x80808 },
1954 { 0x3d400214, 0x7070707 },
1955 { 0x3d400218, 0x7070707 },
1956 { 0x3d400250, 0x29001701 },
1957 { 0x3d400254, 0x2c },
1958 { 0x3d40025c, 0x4000030 },
1959 { 0x3d400264, 0x900093e7 },
1960 { 0x3d40026c, 0x2005574 },
1961 { 0x3d400400, 0x111 },
1962 { 0x3d400408, 0x72ff },
1963 { 0x3d400494, 0x2100e07 },
1964 { 0x3d400498, 0x620096 },
1965 { 0x3d40049c, 0x1100e07 },
1966 { 0x3d4004a0, 0xc8012c },
1967 { 0x3d402020, 0x1 },
1968 { 0x3d402024, 0x7d00 },
1969 { 0x3d402050, 0x20d040 },
1970 { 0x3d402064, 0xc001c },
1971 { 0x3d4020dc, 0x840000 },
1972 { 0x3d4020e0, 0x310000 },
1973 { 0x3d4020e8, 0x66004d },
1974 { 0x3d4020ec, 0x16004d },
1975 { 0x3d402100, 0xa040305 },
1976 { 0x3d402104, 0x30407 },
1977 { 0x3d402108, 0x203060b },
1978 { 0x3d40210c, 0x505000 },
1979 { 0x3d402110, 0x2040202 },
1980 { 0x3d402114, 0x2030202 },
1981 { 0x3d402118, 0x1010004 },
1982 { 0x3d40211c, 0x301 },
1983 { 0x3d402130, 0x20300 },
1984 { 0x3d402134, 0xa100002 },
1985 { 0x3d402138, 0x1d },
1986 { 0x3d402144, 0x14000a },
1987 { 0x3d402180, 0x640004 },
1988 { 0x3d402190, 0x3818200 },
1989 { 0x3d402194, 0x80303 },
1990 { 0x3d4021b4, 0x100 },
1991 { 0x3d4020f4, 0xc99 },
1992 { 0x3d403020, 0x1 },
1993 { 0x3d403024, 0x1f40 },
1994 { 0x3d403050, 0x20d040 },
1995 { 0x3d403064, 0x30007 },
1996 { 0x3d4030dc, 0x840000 },
1997 { 0x3d4030e0, 0x310000 },
1998 { 0x3d4030e8, 0x66004d },
1999 { 0x3d4030ec, 0x16004d },
2000 { 0x3d403100, 0xa010102 },
2001 { 0x3d403104, 0x30404 },
2002 { 0x3d403108, 0x203060b },
2003 { 0x3d40310c, 0x505000 },
2004 { 0x3d403110, 0x2040202 },
2005 { 0x3d403114, 0x2030202 },
2006 { 0x3d403118, 0x1010004 },
2007 { 0x3d40311c, 0x301 },
2008 { 0x3d403130, 0x20300 },
2009 { 0x3d403134, 0xa100002 },
2010 { 0x3d403138, 0x8 },
2011 { 0x3d403144, 0x50003 },
2012 { 0x3d403180, 0x190004 },
2013 { 0x3d403190, 0x3818200 },
2014 { 0x3d403194, 0x80303 },
2015 { 0x3d4031b4, 0x100 },
2016 { 0x3d4030f4, 0xc99 },
2017 { 0x3d400028, 0x0 },
2018};
2019
2020/* PHY Initialize Configuration */
2021static struct dram_cfg_param ddr_ddrphy_cfg_2gb_dual_die[] = {
2022 { 0x100a0, 0x0 },
2023 { 0x100a1, 0x1 },
2024 { 0x100a2, 0x2 },
2025 { 0x100a3, 0x3 },
2026 { 0x100a4, 0x4 },
2027 { 0x100a5, 0x5 },
2028 { 0x100a6, 0x6 },
2029 { 0x100a7, 0x7 },
2030 { 0x110a0, 0x0 },
2031 { 0x110a1, 0x1 },
2032 { 0x110a2, 0x3 },
2033 { 0x110a3, 0x4 },
2034 { 0x110a4, 0x5 },
2035 { 0x110a5, 0x2 },
2036 { 0x110a6, 0x7 },
2037 { 0x110a7, 0x6 },
2038 { 0x1005f, 0x1ff },
2039 { 0x1015f, 0x1ff },
2040 { 0x1105f, 0x1ff },
2041 { 0x1115f, 0x1ff },
2042 { 0x11005f, 0x1ff },
2043 { 0x11015f, 0x1ff },
2044 { 0x11105f, 0x1ff },
2045 { 0x11115f, 0x1ff },
2046 { 0x21005f, 0x1ff },
2047 { 0x21015f, 0x1ff },
2048 { 0x21105f, 0x1ff },
2049 { 0x21115f, 0x1ff },
2050 { 0x55, 0x1ff },
2051 { 0x1055, 0x1ff },
2052 { 0x2055, 0x1ff },
2053 { 0x3055, 0x1ff },
2054 { 0x4055, 0x1ff },
2055 { 0x5055, 0x1ff },
2056 { 0x6055, 0x1ff },
2057 { 0x7055, 0x1ff },
2058 { 0x8055, 0x1ff },
2059 { 0x9055, 0x1ff },
2060 { 0x200c5, 0x19 },
2061 { 0x1200c5, 0x7 },
2062 { 0x2200c5, 0x7 },
2063 { 0x2002e, 0x2 },
2064 { 0x12002e, 0x2 },
2065 { 0x22002e, 0x2 },
2066 { 0x90204, 0x0 },
2067 { 0x190204, 0x0 },
2068 { 0x290204, 0x0 },
2069 { 0x20024, 0x1a3 },
2070 { 0x2003a, 0x2 },
2071 { 0x120024, 0x1a3 },
2072 { 0x2003a, 0x2 },
2073 { 0x220024, 0x1a3 },
2074 { 0x2003a, 0x2 },
2075 { 0x20056, 0x3 },
2076 { 0x120056, 0x3 },
2077 { 0x220056, 0x3 },
2078 { 0x1004d, 0xe00 },
2079 { 0x1014d, 0xe00 },
2080 { 0x1104d, 0xe00 },
2081 { 0x1114d, 0xe00 },
2082 { 0x11004d, 0xe00 },
2083 { 0x11014d, 0xe00 },
2084 { 0x11104d, 0xe00 },
2085 { 0x11114d, 0xe00 },
2086 { 0x21004d, 0xe00 },
2087 { 0x21014d, 0xe00 },
2088 { 0x21104d, 0xe00 },
2089 { 0x21114d, 0xe00 },
2090 { 0x10049, 0xeba },
2091 { 0x10149, 0xeba },
2092 { 0x11049, 0xeba },
2093 { 0x11149, 0xeba },
2094 { 0x110049, 0xeba },
2095 { 0x110149, 0xeba },
2096 { 0x111049, 0xeba },
2097 { 0x111149, 0xeba },
2098 { 0x210049, 0xeba },
2099 { 0x210149, 0xeba },
2100 { 0x211049, 0xeba },
2101 { 0x211149, 0xeba },
2102 { 0x43, 0x63 },
2103 { 0x1043, 0x63 },
2104 { 0x2043, 0x63 },
2105 { 0x3043, 0x63 },
2106 { 0x4043, 0x63 },
2107 { 0x5043, 0x63 },
2108 { 0x6043, 0x63 },
2109 { 0x7043, 0x63 },
2110 { 0x8043, 0x63 },
2111 { 0x9043, 0x63 },
2112 { 0x20018, 0x1 },
2113 { 0x20075, 0x4 },
2114 { 0x20050, 0x0 },
2115 { 0x20008, 0x320 },
2116 { 0x120008, 0x64 },
2117 { 0x220008, 0x19 },
2118 { 0x20088, 0x9 },
2119 { 0x200b2, 0xdc },
2120 { 0x10043, 0x5a1 },
2121 { 0x10143, 0x5a1 },
2122 { 0x11043, 0x5a1 },
2123 { 0x11143, 0x5a1 },
2124 { 0x1200b2, 0xdc },
2125 { 0x110043, 0x5a1 },
2126 { 0x110143, 0x5a1 },
2127 { 0x111043, 0x5a1 },
2128 { 0x111143, 0x5a1 },
2129 { 0x2200b2, 0xdc },
2130 { 0x210043, 0x5a1 },
2131 { 0x210143, 0x5a1 },
2132 { 0x211043, 0x5a1 },
2133 { 0x211143, 0x5a1 },
2134 { 0x200fa, 0x1 },
2135 { 0x1200fa, 0x1 },
2136 { 0x2200fa, 0x1 },
2137 { 0x20019, 0x1 },
2138 { 0x120019, 0x1 },
2139 { 0x220019, 0x1 },
2140 { 0x200f0, 0x660 },
2141 { 0x200f1, 0x0 },
2142 { 0x200f2, 0x4444 },
2143 { 0x200f3, 0x8888 },
2144 { 0x200f4, 0x5665 },
2145 { 0x200f5, 0x0 },
2146 { 0x200f6, 0x0 },
2147 { 0x200f7, 0xf000 },
2148 { 0x20025, 0x0 },
2149 { 0x2002d, 0x0 },
2150 { 0x12002d, 0x0 },
2151 { 0x22002d, 0x0 },
2152 { 0x2005b, 0x7529 },
2153 { 0x2005c, 0x0 },
2154 { 0x200c7, 0x21 },
2155 { 0x200ca, 0x24 },
2156 { 0x200cc, 0x1f7 },
2157 { 0x1200c7, 0x21 },
2158 { 0x1200ca, 0x24 },
2159 { 0x1200cc, 0x1f7 },
2160 { 0x2200c7, 0x21 },
2161 { 0x2200ca, 0x24 },
2162 { 0x2200cc, 0x1f7 },
2163 { 0x2007d, 0x212 },
2164 { 0x12007d, 0x212 },
2165 { 0x22007d, 0x212 },
2166 { 0x2007c, 0x61 },
2167 { 0x12007c, 0x61 },
2168 { 0x22007c, 0x61 },
2169 { 0x1004a, 0x500 },
2170 { 0x1104a, 0x500 },
2171 { 0x2002c, 0x0 },
2172};
2173
2174/* P0 message block paremeter for training firmware */
2175static struct dram_cfg_param ddr_fsp0_cfg_2gb_dual_die[] = {
2176 { 0xd0000, 0x0 },
2177 { 0x54003, 0xc80 },
2178 { 0x54004, 0x2 },
2179 { 0x54005, 0x2228 },
2180 { 0x54006, 0x11 },
2181 { 0x54008, 0x131f },
2182 { 0x54009, 0xc8 },
2183 { 0x5400b, 0x2 },
2184 { 0x5400f, 0x100 },
2185 { 0x54012, 0x310 },
2186 { 0x54019, 0x2dd4 },
2187 { 0x5401a, 0x31 },
2188 { 0x5401b, 0x4d66 },
2189 { 0x5401c, 0x4d00 },
2190 { 0x5401e, 0x16 },
2191 { 0x5401f, 0x2dd4 },
2192 { 0x54020, 0x31 },
2193 { 0x54021, 0x4d66 },
2194 { 0x54022, 0x4d00 },
2195 { 0x54024, 0x16 },
2196 { 0x54032, 0xd400 },
2197 { 0x54033, 0x312d },
2198 { 0x54034, 0x6600 },
2199 { 0x54035, 0x4d },
2200 { 0x54036, 0x4d },
2201 { 0x54037, 0x1600 },
2202 { 0x54038, 0xd400 },
2203 { 0x54039, 0x312d },
2204 { 0x5403a, 0x6600 },
2205 { 0x5403b, 0x4d },
2206 { 0x5403c, 0x4d },
2207 { 0x5403d, 0x1600 },
2208 { 0xd0000, 0x1 },
2209};
2210
2211/* P1 message block paremeter for training firmware */
2212static struct dram_cfg_param ddr_fsp1_cfg_2gb_dual_die[] = {
2213 { 0xd0000, 0x0 },
2214 { 0x54002, 0x101 },
2215 { 0x54003, 0x190 },
2216 { 0x54004, 0x2 },
2217 { 0x54005, 0x2228 },
2218 { 0x54006, 0x11 },
2219 { 0x54008, 0x121f },
2220 { 0x54009, 0xc8 },
2221 { 0x5400b, 0x2 },
2222 { 0x5400f, 0x100 },
2223 { 0x54012, 0x310 },
2224 { 0x54019, 0x84 },
2225 { 0x5401a, 0x31 },
2226 { 0x5401b, 0x4d66 },
2227 { 0x5401c, 0x4d00 },
2228 { 0x5401e, 0x16 },
2229 { 0x5401f, 0x84 },
2230 { 0x54020, 0x31 },
2231 { 0x54021, 0x4d66 },
2232 { 0x54022, 0x4d00 },
2233 { 0x54024, 0x16 },
2234 { 0x54032, 0x8400 },
2235 { 0x54033, 0x3100 },
2236 { 0x54034, 0x6600 },
2237 { 0x54035, 0x4d },
2238 { 0x54036, 0x4d },
2239 { 0x54037, 0x1600 },
2240 { 0x54038, 0x8400 },
2241 { 0x54039, 0x3100 },
2242 { 0x5403a, 0x6600 },
2243 { 0x5403b, 0x4d },
2244 { 0x5403c, 0x4d },
2245 { 0x5403d, 0x1600 },
2246 { 0xd0000, 0x1 },
2247};
2248
2249/* P2 message block paremeter for training firmware */
2250static struct dram_cfg_param ddr_fsp2_cfg_2gb_dual_die[] = {
2251 { 0xd0000, 0x0 },
2252 { 0x54002, 0x102 },
2253 { 0x54003, 0x64 },
2254 { 0x54004, 0x2 },
2255 { 0x54005, 0x2228 },
2256 { 0x54006, 0x11 },
2257 { 0x54008, 0x121f },
2258 { 0x54009, 0xc8 },
2259 { 0x5400b, 0x2 },
2260 { 0x5400f, 0x100 },
2261 { 0x54012, 0x310 },
2262 { 0x54019, 0x84 },
2263 { 0x5401a, 0x31 },
2264 { 0x5401b, 0x4d66 },
2265 { 0x5401c, 0x4d00 },
2266 { 0x5401e, 0x16 },
2267 { 0x5401f, 0x84 },
2268 { 0x54020, 0x31 },
2269 { 0x54021, 0x4d66 },
2270 { 0x54022, 0x4d00 },
2271 { 0x54024, 0x16 },
2272 { 0x54032, 0x8400 },
2273 { 0x54033, 0x3100 },
2274 { 0x54034, 0x6600 },
2275 { 0x54035, 0x4d },
2276 { 0x54036, 0x4d },
2277 { 0x54037, 0x1600 },
2278 { 0x54038, 0x8400 },
2279 { 0x54039, 0x3100 },
2280 { 0x5403a, 0x6600 },
2281 { 0x5403b, 0x4d },
2282 { 0x5403c, 0x4d },
2283 { 0x5403d, 0x1600 },
2284 { 0xd0000, 0x1 },
2285};
2286
2287/* P0 2D message block paremeter for training firmware */
2288static struct dram_cfg_param ddr_fsp0_2d_cfg_2gb_dual_die[] = {
2289 { 0xd0000, 0x0 },
2290 { 0x54003, 0xc80 },
2291 { 0x54004, 0x2 },
2292 { 0x54005, 0x2228 },
2293 { 0x54006, 0x11 },
2294 { 0x54008, 0x61 },
2295 { 0x54009, 0xc8 },
2296 { 0x5400b, 0x2 },
2297 { 0x5400f, 0x100 },
2298 { 0x54010, 0x1f7f },
2299 { 0x54012, 0x310 },
2300 { 0x54019, 0x2dd4 },
2301 { 0x5401a, 0x31 },
2302 { 0x5401b, 0x4d66 },
2303 { 0x5401c, 0x4d00 },
2304 { 0x5401e, 0x16 },
2305 { 0x5401f, 0x2dd4 },
2306 { 0x54020, 0x31 },
2307 { 0x54021, 0x4d66 },
2308 { 0x54022, 0x4d00 },
2309 { 0x54024, 0x16 },
2310 { 0x54032, 0xd400 },
2311 { 0x54033, 0x312d },
2312 { 0x54034, 0x6600 },
2313 { 0x54035, 0x4d },
2314 { 0x54036, 0x4d },
2315 { 0x54037, 0x1600 },
2316 { 0x54038, 0xd400 },
2317 { 0x54039, 0x312d },
2318 { 0x5403a, 0x6600 },
2319 { 0x5403b, 0x4d },
2320 { 0x5403c, 0x4d },
2321 { 0x5403d, 0x1600 },
2322 { 0xd0000, 0x1 },
2323};
2324
2325static struct dram_fsp_msg ddr_dram_fsp_msg_2gb_dual_die[] = {
2326 {
2327 /* P0 3200mts 1D */
2328 .drate = 3200,
2329 .fw_type = FW_1D_IMAGE,
2330 .fsp_cfg = ddr_fsp0_cfg_2gb_dual_die,
2331 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_cfg_2gb_dual_die),
2332 },
2333 {
2334 /* P1 400mts 1D */
2335 .drate = 400,
2336 .fw_type = FW_1D_IMAGE,
2337 .fsp_cfg = ddr_fsp1_cfg_2gb_dual_die,
2338 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp1_cfg_2gb_dual_die),
2339 },
2340 {
2341 /* P2 100mts 1D */
2342 .drate = 100,
2343 .fw_type = FW_1D_IMAGE,
2344 .fsp_cfg = ddr_fsp2_cfg_2gb_dual_die,
2345 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp2_cfg_2gb_dual_die),
2346 },
2347 {
2348 /* P0 3200mts 2D */
2349 .drate = 3200,
2350 .fw_type = FW_2D_IMAGE,
2351 .fsp_cfg = ddr_fsp0_2d_cfg_2gb_dual_die,
2352 .fsp_cfg_num = ARRAY_SIZE(ddr_fsp0_2d_cfg_2gb_dual_die),
2353 },
2354};
2355
2356/* ddr timing config params */
2357struct dram_timing_info dram_timing_2gb_dual_die = {
2358 .ddrc_cfg = ddr_ddrc_cfg_2gb_dual_die,
2359 .ddrc_cfg_num = ARRAY_SIZE(ddr_ddrc_cfg_2gb_dual_die),
2360 .ddrphy_cfg = ddr_ddrphy_cfg_2gb_dual_die,
2361 .ddrphy_cfg_num = ARRAY_SIZE(ddr_ddrphy_cfg_2gb_dual_die),
2362 .fsp_msg = ddr_dram_fsp_msg_2gb_dual_die,
2363 .fsp_msg_num = ARRAY_SIZE(ddr_dram_fsp_msg_2gb_dual_die),
2364 .ddrphy_trained_csr = ddr_ddrphy_trained_csr,
2365 .ddrphy_trained_csr_num = ARRAY_SIZE(ddr_ddrphy_trained_csr),
2366 .ddrphy_pie = ddr_phy_pie,
2367 .ddrphy_pie_num = ARRAY_SIZE(ddr_phy_pie),
2368 .fsp_table = { 3200, 400, 100, },
2369};