1 // SPDX-License-Identifier: GPL-2.0+ 2 /* 3 * Copyright 2018 NXP 4 */ 5 6 #include <linux/kernel.h> 7 #include <common.h> 8 #include <asm/arch/ddr.h> 9 #include <asm/arch/lpddr4_define.h> 10 11 #define WR_POST_EXT_3200 /* recommened to define */ 12 13 static struct dram_cfg_param lpddr4_ddrc_cfg[] = { 14 /* Start to config, default 3200mbps */ 15 /* dis_dq=1, indicates no reads or writes are issued to SDRAM */ 16 { DDRC_DBG1(0), 0x00000001 }, 17 /* selfref_en=1, SDRAM enter self-refresh state */ 18 { DDRC_PWRCTL(0), 0x00000001 }, 19 { DDRC_MSTR(0), 0xa3080020 }, 20 { DDRC_MSTR2(0), 0x00000000 }, 21 { DDRC_RFSHTMG(0), 0x006100E0 }, 22 { DDRC_INIT0(0), 0xC003061B }, 23 { DDRC_INIT1(0), 0x009D0000 }, 24 { DDRC_INIT3(0), 0x00D4002D }, 25 #ifdef WR_POST_EXT_3200 /* recommened to define */ 26 { DDRC_INIT4(0), 0x00330008 }, 27 #else 28 { DDRC_INIT4(0), 0x00310008 }, 29 #endif 30 { DDRC_INIT6(0), 0x0066004a }, 31 { DDRC_INIT7(0), 0x0006004a }, 32 33 { DDRC_DRAMTMG0(0), 0x1A201B22 }, 34 { DDRC_DRAMTMG1(0), 0x00060633 }, 35 { DDRC_DRAMTMG3(0), 0x00C0C000 }, 36 { DDRC_DRAMTMG4(0), 0x0F04080F }, 37 { DDRC_DRAMTMG5(0), 0x02040C0C }, 38 { DDRC_DRAMTMG6(0), 0x01010007 }, 39 { DDRC_DRAMTMG7(0), 0x00000401 }, 40 { DDRC_DRAMTMG12(0), 0x00020600 }, 41 { DDRC_DRAMTMG13(0), 0x0C100002 }, 42 { DDRC_DRAMTMG14(0), 0x000000E6 }, 43 { DDRC_DRAMTMG17(0), 0x00A00050 }, 44 45 { DDRC_ZQCTL0(0), 0x03200018 }, 46 { DDRC_ZQCTL1(0), 0x028061A8 }, 47 { DDRC_ZQCTL2(0), 0x00000000 }, 48 49 { DDRC_DFITMG0(0), 0x0497820A }, 50 { DDRC_DFITMG1(0), 0x00080303 }, 51 { DDRC_DFIUPD0(0), 0xE0400018 }, 52 { DDRC_DFIUPD1(0), 0x00DF00E4 }, 53 { DDRC_DFIUPD2(0), 0x80000000 }, 54 { DDRC_DFIMISC(0), 0x00000011 }, 55 { DDRC_DFITMG2(0), 0x0000170A }, 56 57 { DDRC_DBICTL(0), 0x00000001 }, 58 { DDRC_DFIPHYMSTR(0), 0x00000001 }, 59 60 /* need be refined by ddrphy trained value */ 61 { DDRC_RANKCTL(0), 0x00000c99 }, 62 { DDRC_DRAMTMG2(0), 0x070E171a }, 63 64 /* address mapping */ 65 /* Address map is from MSB 29: r15, r14, cs, r13-r0, b2-b0, c9-c0 */ 66 { DDRC_ADDRMAP0(0), 0x00000015 }, 67 { DDRC_ADDRMAP3(0), 0x00000000 }, 68 /* addrmap_col_b10 addrmap_col_b11 set to de-activated (5-bit width) */ 69 { DDRC_ADDRMAP4(0), 0x00001F1F }, 70 /* bank interleave */ 71 /* addrmap_bank_b2, addrmap_bank_b1, addrmap_bank_b0 */ 72 { DDRC_ADDRMAP1(0), 0x00080808 }, 73 /* addrmap_row_b11 addrmap_row_b10_b2 addrmap_row_b1 addrmap_row_b0 */ 74 { DDRC_ADDRMAP5(0), 0x07070707 }, 75 /* addrmap_row_b15 addrmap_row_b14 addrmap_row_b13 addrmap_row_b12 */ 76 { DDRC_ADDRMAP6(0), 0x08080707 }, 77 78 /* 667mts frequency setting */ 79 { DDRC_FREQ1_DERATEEN(0), 0x0000000 }, 80 { DDRC_FREQ1_DERATEINT(0), 0x0800000 }, 81 { DDRC_FREQ1_RFSHCTL0(0), 0x0210000 }, 82 { DDRC_FREQ1_RFSHTMG(0), 0x014001E }, 83 { DDRC_FREQ1_INIT3(0), 0x0140009 }, 84 { DDRC_FREQ1_INIT4(0), 0x00310008 }, 85 { DDRC_FREQ1_INIT6(0), 0x0066004a }, 86 { DDRC_FREQ1_INIT7(0), 0x0006004a }, 87 { DDRC_FREQ1_DRAMTMG0(0), 0xB070A07 }, 88 { DDRC_FREQ1_DRAMTMG1(0), 0x003040A }, 89 { DDRC_FREQ1_DRAMTMG2(0), 0x305080C }, 90 { DDRC_FREQ1_DRAMTMG3(0), 0x0505000 }, 91 { DDRC_FREQ1_DRAMTMG4(0), 0x3040203 }, 92 { DDRC_FREQ1_DRAMTMG5(0), 0x2030303 }, 93 { DDRC_FREQ1_DRAMTMG6(0), 0x2020004 }, 94 { DDRC_FREQ1_DRAMTMG7(0), 0x0000302 }, 95 { DDRC_FREQ1_DRAMTMG12(0), 0x0020310 }, 96 { DDRC_FREQ1_DRAMTMG13(0), 0xA100002 }, 97 { DDRC_FREQ1_DRAMTMG14(0), 0x0000020 }, 98 { DDRC_FREQ1_DRAMTMG17(0), 0x0220011 }, 99 { DDRC_FREQ1_ZQCTL0(0), 0x0A70005 }, 100 { DDRC_FREQ1_DFITMG0(0), 0x3858202 }, 101 { DDRC_FREQ1_DFITMG1(0), 0x0000404 }, 102 { DDRC_FREQ1_DFITMG2(0), 0x0000502 }, 103 104 /* performance setting */ 105 { DDRC_ODTCFG(0), 0x0b060908 }, 106 { DDRC_ODTMAP(0), 0x00000000 }, 107 { DDRC_SCHED(0), 0x29511505 }, 108 { DDRC_SCHED1(0), 0x0000002c }, 109 { DDRC_PERFHPR1(0), 0x5900575b }, 110 /* 150T starve and 0x90 max tran len */ 111 { DDRC_PERFLPR1(0), 0x90000096 }, 112 /* 300T starve and 0x10 max tran len */ 113 { DDRC_PERFWR1(0), 0x1000012c }, 114 { DDRC_DBG0(0), 0x00000016 }, 115 { DDRC_DBG1(0), 0x00000000 }, 116 { DDRC_DBGCMD(0), 0x00000000 }, 117 { DDRC_SWCTL(0), 0x00000001 }, 118 { DDRC_POISONCFG(0), 0x00000011 }, 119 { DDRC_PCCFG(0), 0x00000111 }, 120 { DDRC_PCFGR_0(0), 0x000010f3 }, 121 { DDRC_PCFGW_0(0), 0x000072ff }, 122 { DDRC_PCTRL_0(0), 0x00000001 }, 123 /* disable Read Qos*/ 124 { DDRC_PCFGQOS0_0(0), 0x00000e00 }, 125 { DDRC_PCFGQOS1_0(0), 0x0062ffff }, 126 /* disable Write Qos*/ 127 { DDRC_PCFGWQOS0_0(0), 0x00000e00 }, 128 { DDRC_PCFGWQOS1_0(0), 0x0000ffff }, 129 { DDRC_FREQ1_DERATEEN(0), 0x00000202 }, 130 { DDRC_FREQ1_DERATEINT(0), 0xec78f4b5 }, 131 { DDRC_FREQ1_RFSHCTL0(0), 0x00618040 }, 132 { DDRC_FREQ1_RFSHTMG(0), 0x00610090 }, 133 }; 134 135 /* PHY Initialize Configuration */ 136 static struct dram_cfg_param lpddr4_ddrphy_cfg[] = { 137 { 0x20110, 0x02 }, /* MapCAB0toDFI */ 138 { 0x20111, 0x03 }, /* MapCAB1toDFI */ 139 { 0x20112, 0x04 }, /* MapCAB2toDFI */ 140 { 0x20113, 0x05 }, /* MapCAB3toDFI */ 141 { 0x20114, 0x00 }, /* MapCAB4toDFI */ 142 { 0x20115, 0x01 }, /* MapCAB5toDFI */ 143 144 /* Initialize PHY Configuration */ 145 { 0x1005f, 0x1ff }, 146 { 0x1015f, 0x1ff }, 147 { 0x1105f, 0x1ff }, 148 { 0x1115f, 0x1ff }, 149 { 0x1205f, 0x1ff }, 150 { 0x1215f, 0x1ff }, 151 { 0x1305f, 0x1ff }, 152 { 0x1315f, 0x1ff }, 153 154 { 0x11005f, 0x1ff }, 155 { 0x11015f, 0x1ff }, 156 { 0x11105f, 0x1ff }, 157 { 0x11115f, 0x1ff }, 158 { 0x11205f, 0x1ff }, 159 { 0x11215f, 0x1ff }, 160 { 0x11305f, 0x1ff }, 161 { 0x11315f, 0x1ff }, 162 163 { 0x21005f, 0x1ff }, 164 { 0x21015f, 0x1ff }, 165 { 0x21105f, 0x1ff }, 166 { 0x21115f, 0x1ff }, 167 { 0x21205f, 0x1ff }, 168 { 0x21215f, 0x1ff }, 169 { 0x21305f, 0x1ff }, 170 { 0x21315f, 0x1ff }, 171 172 { 0x55, 0x1ff }, 173 { 0x1055, 0x1ff }, 174 { 0x2055, 0x1ff }, 175 { 0x3055, 0x1ff }, 176 { 0x4055, 0x1ff }, 177 { 0x5055, 0x1ff }, 178 { 0x6055, 0x1ff }, 179 { 0x7055, 0x1ff }, 180 { 0x8055, 0x1ff }, 181 { 0x9055, 0x1ff }, 182 { 0x200c5, 0x19 }, 183 { 0x1200c5, 0x7 }, 184 { 0x2200c5, 0x7 }, 185 { 0x2002e, 0x2 }, 186 { 0x12002e, 0x1 }, 187 { 0x22002e, 0x2 }, 188 { 0x90204, 0x0 }, 189 { 0x190204, 0x0 }, 190 { 0x290204, 0x0 }, 191 192 { 0x20024, 0xe3 }, 193 { 0x2003a, 0x2 }, 194 { 0x120024, 0xa3 }, 195 { 0x2003a, 0x2 }, 196 { 0x220024, 0xa3 }, 197 { 0x2003a, 0x2 }, 198 199 { 0x20056, 0x3 }, 200 { 0x120056, 0xa }, 201 { 0x220056, 0xa }, 202 203 { 0x1004d, 0xe00 }, 204 { 0x1014d, 0xe00 }, 205 { 0x1104d, 0xe00 }, 206 { 0x1114d, 0xe00 }, 207 { 0x1204d, 0xe00 }, 208 { 0x1214d, 0xe00 }, 209 { 0x1304d, 0xe00 }, 210 { 0x1314d, 0xe00 }, 211 { 0x11004d, 0xe00 }, 212 { 0x11014d, 0xe00 }, 213 { 0x11104d, 0xe00 }, 214 { 0x11114d, 0xe00 }, 215 { 0x11204d, 0xe00 }, 216 { 0x11214d, 0xe00 }, 217 { 0x11304d, 0xe00 }, 218 { 0x11314d, 0xe00 }, 219 { 0x21004d, 0xe00 }, 220 { 0x21014d, 0xe00 }, 221 { 0x21104d, 0xe00 }, 222 { 0x21114d, 0xe00 }, 223 { 0x21204d, 0xe00 }, 224 { 0x21214d, 0xe00 }, 225 { 0x21304d, 0xe00 }, 226 { 0x21314d, 0xe00 }, 227 228 { 0x10049, 0xfbe }, 229 { 0x10149, 0xfbe }, 230 { 0x11049, 0xfbe }, 231 { 0x11149, 0xfbe }, 232 { 0x12049, 0xfbe }, 233 { 0x12149, 0xfbe }, 234 { 0x13049, 0xfbe }, 235 { 0x13149, 0xfbe }, 236 237 { 0x110049, 0xfbe }, 238 { 0x110149, 0xfbe }, 239 { 0x111049, 0xfbe }, 240 { 0x111149, 0xfbe }, 241 { 0x112049, 0xfbe }, 242 { 0x112149, 0xfbe }, 243 { 0x113049, 0xfbe }, 244 { 0x113149, 0xfbe }, 245 246 { 0x210049, 0xfbe }, 247 { 0x210149, 0xfbe }, 248 { 0x211049, 0xfbe }, 249 { 0x211149, 0xfbe }, 250 { 0x212049, 0xfbe }, 251 { 0x212149, 0xfbe }, 252 { 0x213049, 0xfbe }, 253 { 0x213149, 0xfbe }, 254 255 { 0x43, 0x63 }, 256 { 0x1043, 0x63 }, 257 { 0x2043, 0x63 }, 258 { 0x3043, 0x63 }, 259 { 0x4043, 0x63 }, 260 { 0x5043, 0x63 }, 261 { 0x6043, 0x63 }, 262 { 0x7043, 0x63 }, 263 { 0x8043, 0x63 }, 264 { 0x9043, 0x63 }, 265 266 { 0x20018, 0x3 }, 267 { 0x20075, 0x4 }, 268 { 0x20050, 0x0 }, 269 { 0x20008, 0x320 }, 270 { 0x120008, 0xa7 }, 271 { 0x220008, 0x19 }, 272 { 0x20088, 0x9 }, 273 { 0x200b2, 0x104 }, 274 { 0x10043, 0x5a1 }, 275 { 0x10143, 0x5a1 }, 276 { 0x11043, 0x5a1 }, 277 { 0x11143, 0x5a1 }, 278 { 0x12043, 0x5a1 }, 279 { 0x12143, 0x5a1 }, 280 { 0x13043, 0x5a1 }, 281 { 0x13143, 0x5a1 }, 282 { 0x1200b2, 0x104 }, 283 { 0x110043, 0x5a1 }, 284 { 0x110143, 0x5a1 }, 285 { 0x111043, 0x5a1 }, 286 { 0x111143, 0x5a1 }, 287 { 0x112043, 0x5a1 }, 288 { 0x112143, 0x5a1 }, 289 { 0x113043, 0x5a1 }, 290 { 0x113143, 0x5a1 }, 291 { 0x2200b2, 0x104 }, 292 { 0x210043, 0x5a1 }, 293 { 0x210143, 0x5a1 }, 294 { 0x211043, 0x5a1 }, 295 { 0x211143, 0x5a1 }, 296 { 0x212043, 0x5a1 }, 297 { 0x212143, 0x5a1 }, 298 { 0x213043, 0x5a1 }, 299 { 0x213143, 0x5a1 }, 300 { 0x200fa, 0x1 }, 301 { 0x1200fa, 0x1 }, 302 { 0x2200fa, 0x1 }, 303 { 0x20019, 0x1 }, 304 { 0x120019, 0x1 }, 305 { 0x220019, 0x1 }, 306 { 0x200f0, 0x600 }, 307 { 0x200f1, 0x0 }, 308 { 0x200f2, 0x4444 }, 309 { 0x200f3, 0x8888 }, 310 { 0x200f4, 0x5655 }, 311 { 0x200f5, 0x0 }, 312 { 0x200f6, 0x0 }, 313 { 0x200f7, 0xf000 }, 314 { 0x20025, 0x0 }, 315 { 0x2002d, 0x0 }, 316 { 0x12002d, 0x0 }, 317 { 0x22002d, 0x0 }, 318 }; 319 320 /* P0 message block paremeter for training firmware */ 321 static struct dram_cfg_param lpddr4_fsp0_cfg[] = { 322 { 0xd0000, 0x0 }, 323 { 0x54000, 0x0 }, 324 { 0x54001, 0x0 }, 325 { 0x54002, 0x0 }, 326 { 0x54003, 0xc80 }, 327 { 0x54004, 0x2 }, 328 { 0x54005, ((LPDDR4_PHY_RON << 8) | LPDDR4_PHY_RTT) }, 329 { 0x54006, LPDDR4_PHY_VREF_VALUE }, 330 { 0x54007, 0x0 }, 331 { 0x54008, 0x131f }, 332 { 0x54009, LPDDR4_HDT_CTL_3200_1D }, 333 { 0x5400a, 0x0 }, 334 { 0x5400b, 0x2 }, 335 { 0x5400c, 0x0 }, 336 { 0x5400d, (LPDDR4_CATRAIN_3200_1d << 8) }, 337 { 0x5400e, 0x0 }, 338 { 0x5400f, 0x0 }, 339 { 0x54010, 0x0 }, 340 { 0x54011, 0x0 }, 341 { 0x54012, 0x310 }, 342 { 0x54013, 0x0 }, 343 { 0x54014, 0x0 }, 344 { 0x54015, 0x0 }, 345 { 0x54016, 0x0 }, 346 { 0x54017, 0x0 }, 347 { 0x54018, 0x0 }, 348 { 0x54019, 0x2dd4 }, 349 { 0x5401a, (((LPDDR4_RON) << 3) | 0x3) }, 350 { 0x5401b, ((LPDDR4_VREF_VALUE_CA << 8) | 351 (LPDDR4_RTT_CA_BANK0 << 4) | LPDDR4_RTT_DQ) }, 352 { 0x5401c, ((LPDDR4_VREF_VALUE_DQ_RANK0 << 8) | 0x08) }, 353 { 0x5401d, 0x0 }, 354 { 0x5401e, LPDDR4_MR22_RANK0 }, 355 { 0x5401f, 0x2dd4 }, 356 { 0x54020, (((LPDDR4_RON) << 3) | 0x3) }, 357 { 0x54021, ((LPDDR4_VREF_VALUE_CA << 8) | 358 (LPDDR4_RTT_CA_BANK1 << 4) | LPDDR4_RTT_DQ) }, 359 { 0x54022, ((LPDDR4_VREF_VALUE_DQ_RANK1 << 8) | 0x08) }, 360 { 0x54023, 0x0 }, 361 { 0x54024, LPDDR4_MR22_RANK1 }, 362 { 0x54025, 0x0 }, 363 { 0x54026, 0x0 }, 364 { 0x54027, 0x0 }, 365 { 0x54028, 0x0 }, 366 { 0x54029, 0x0 }, 367 { 0x5402a, 0x0 }, 368 { 0x5402b, 0x1000 }, 369 { 0x5402c, 0x3 }, 370 { 0x5402d, 0x0 }, 371 { 0x5402e, 0x0 }, 372 { 0x5402f, 0x0 }, 373 { 0x54030, 0x0 }, 374 { 0x54031, 0x0 }, 375 { 0x54032, 0xd400 }, 376 { 0x54033, ((((LPDDR4_RON) << 3) | 0x3) << 8) | 0x2d }, 377 { 0x54034, (((LPDDR4_RTT_CA_BANK0 << 4) | LPDDR4_RTT_DQ) << 8) }, 378 { 0x54035, (0x0800 | LPDDR4_VREF_VALUE_CA) }, 379 { 0x54036, LPDDR4_VREF_VALUE_DQ_RANK0 }, 380 { 0x54037, (LPDDR4_MR22_RANK0 << 8) }, 381 { 0x54038, 0xd400 }, 382 { 0x54039, ((((LPDDR4_RON) << 3) | 0x3) << 8) | 0x2d }, 383 { 0x5403a, (((LPDDR4_RTT_CA_BANK1 << 4) | LPDDR4_RTT_DQ) << 8) }, 384 { 0x5403b, (0x0800 | LPDDR4_VREF_VALUE_CA) }, 385 { 0x5403c, LPDDR4_VREF_VALUE_DQ_RANK1 }, 386 { 0x5403d, (LPDDR4_MR22_RANK1 << 8) }, 387 { 0x5403d, (LPDDR4_MR22_RANK1 << 8) }, 388 { 0x5403e, 0x0 }, 389 { 0x5403f, 0x0 }, 390 { 0x54040, 0x0 }, 391 { 0x54041, 0x0 }, 392 { 0x54042, 0x0 }, 393 { 0x54043, 0x0 }, 394 { 0x54044, 0x0 }, 395 { 0xd0000, 0x1 }, 396 }; 397 398 /* P1 message block paremeter for training firmware */ 399 static struct dram_cfg_param lpddr4_fsp1_cfg[] = { 400 { 0xd0000, 0x0 }, 401 { 0x54000, 0x0 }, 402 { 0x54001, 0x0 }, 403 { 0x54002, 0x1 }, 404 { 0x54003, 0x29c }, 405 { 0x54004, 0x2 }, 406 { 0x54005, ((LPDDR4_PHY_RON << 8) | LPDDR4_PHY_RTT) }, 407 { 0x54006, LPDDR4_PHY_VREF_VALUE }, 408 { 0x54007, 0x0 }, 409 { 0x54008, 0x121f }, 410 { 0x54009, 0xc8 }, 411 { 0x5400a, 0x0 }, 412 { 0x5400b, 0x2 }, 413 { 0x5400c, 0x0 }, 414 { 0x5400d, 0x0 }, 415 { 0x5400e, 0x0 }, 416 { 0x5400f, 0x0 }, 417 { 0x54010, 0x0 }, 418 { 0x54011, 0x0 }, 419 { 0x54012, 0x310 }, 420 { 0x54013, 0x0 }, 421 { 0x54014, 0x0 }, 422 { 0x54015, 0x0 }, 423 { 0x54016, 0x0 }, 424 { 0x54017, 0x0 }, 425 { 0x54018, 0x0 }, 426 { 0x54019, 0x914 }, 427 { 0x5401a, (((LPDDR4_RON) << 3) | 0x1) }, 428 { 0x5401b, ((LPDDR4_VREF_VALUE_CA << 8) | 429 (LPDDR4_RTT_CA_BANK0 << 4) | LPDDR4_RTT_DQ) }, 430 { 0x5401c, ((LPDDR4_VREF_VALUE_DQ_RANK0 << 8) | 0x08) }, 431 { 0x5401e, 0x6 }, 432 { 0x5401f, 0x914 }, 433 { 0x54020, (((LPDDR4_RON) << 3) | 0x1) }, 434 { 0x54021, ((LPDDR4_VREF_VALUE_CA << 8) | 435 (LPDDR4_RTT_CA_BANK1 << 4) | LPDDR4_RTT_DQ) }, 436 { 0x54022, ((LPDDR4_VREF_VALUE_DQ_RANK1 << 8) | 0x08) }, 437 { 0x54023, 0x0 }, 438 { 0x54024, LPDDR4_MR22_RANK1 }, 439 { 0x54025, 0x0 }, 440 { 0x54026, 0x0 }, 441 { 0x54027, 0x0 }, 442 { 0x54028, 0x0 }, 443 { 0x54029, 0x0 }, 444 { 0x5402a, 0x0 }, 445 { 0x5402b, 0x1000 }, 446 { 0x5402c, 0x3 }, 447 { 0x5402d, 0x0 }, 448 { 0x5402e, 0x0 }, 449 { 0x5402f, 0x0 }, 450 { 0x54030, 0x0 }, 451 { 0x54031, 0x0 }, 452 { 0x54032, 0x1400 }, 453 { 0x54033, ((((LPDDR4_RON) << 3) | 0x1) << 8) | 0x09 }, 454 { 0x54034, (((LPDDR4_RTT_CA_BANK0 << 4) | LPDDR4_RTT_DQ) << 8) }, 455 { 0x54035, (0x0800 | LPDDR4_VREF_VALUE_CA) }, 456 { 0x54036, LPDDR4_VREF_VALUE_DQ_RANK0 }, 457 { 0x54037, 0x600 }, 458 { 0x54038, 0x1400 }, 459 { 0x54039, ((((LPDDR4_RON) << 3) | 0x1) << 8) | 0x09 }, 460 { 0x5403a, (((LPDDR4_RTT_CA_BANK1 << 4) | LPDDR4_RTT_DQ) << 8) }, 461 { 0x5403b, (0x0800 | LPDDR4_VREF_VALUE_CA) }, 462 { 0x5403c, LPDDR4_VREF_VALUE_DQ_RANK1 }, 463 { 0x5403d, (LPDDR4_MR22_RANK1 << 8) }, 464 { 0x5403e, 0x0 }, 465 { 0x5403f, 0x0 }, 466 { 0x54040, 0x0 }, 467 { 0x54041, 0x0 }, 468 { 0x54042, 0x0 }, 469 { 0x54043, 0x0 }, 470 { 0xd0000, 0x1 }, 471 472 }; 473 474 /* P0 2D message block paremeter for training firmware */ 475 static struct dram_cfg_param lpddr4_fsp0_2d_cfg[] = { 476 { 0xd0000, 0x0 }, 477 { 0x54000, 0x0 }, 478 { 0x54001, 0x0 }, 479 { 0x54002, 0x0 }, 480 { 0x54003, 0xc80 }, 481 { 0x54004, 0x2 }, 482 { 0x54005, ((LPDDR4_PHY_RON << 8) | LPDDR4_PHY_RTT) }, 483 { 0x54006, LPDDR4_PHY_VREF_VALUE }, 484 { 0x54007, 0x0 }, 485 { 0x54008, 0x61 }, 486 { 0x54009, LPDDR4_HDT_CTL_2D }, 487 { 0x5400a, 0x0 }, 488 { 0x5400b, 0x2 }, 489 { 0x5400c, 0x0 }, 490 { 0x5400d, (LPDDR4_CATRAIN_3200_2d << 8) }, 491 { 0x5400e, 0x0 }, 492 { 0x5400f, (LPDDR4_2D_SHARE << 8) | 0x00 }, 493 { 0x54010, LPDDR4_2D_WEIGHT }, 494 { 0x54011, 0x0 }, 495 { 0x54012, 0x310 }, 496 { 0x54013, 0x0 }, 497 { 0x54014, 0x0 }, 498 { 0x54015, 0x0 }, 499 { 0x54016, 0x0 }, 500 { 0x54017, 0x0 }, 501 { 0x54018, 0x0 }, 502 { 0x54024, 0x5 }, 503 { 0x54019, 0x2dd4 }, 504 { 0x5401a, (((LPDDR4_RON) << 3) | 0x3) }, 505 { 0x5401b, ((LPDDR4_VREF_VALUE_CA << 8) | 506 (LPDDR4_RTT_CA_BANK0 << 4) | LPDDR4_RTT_DQ) }, 507 { 0x5401c, ((LPDDR4_VREF_VALUE_DQ_RANK0 << 8) | 0x08) }, 508 { 0x5401d, 0x0 }, 509 { 0x5401e, LPDDR4_MR22_RANK0 }, 510 { 0x5401f, 0x2dd4 }, 511 { 0x54020, (((LPDDR4_RON) << 3) | 0x3) }, 512 { 0x54021, ((LPDDR4_VREF_VALUE_CA << 8) | 513 (LPDDR4_RTT_CA_BANK1 << 4) | LPDDR4_RTT_DQ) }, 514 { 0x54022, ((LPDDR4_VREF_VALUE_DQ_RANK1 << 8) | 0x08) }, 515 { 0x54023, 0x0 }, 516 { 0x54024, LPDDR4_MR22_RANK1 }, 517 { 0x54025, 0x0 }, 518 { 0x54026, 0x0 }, 519 { 0x54027, 0x0 }, 520 { 0x54028, 0x0 }, 521 { 0x54029, 0x0 }, 522 { 0x5402a, 0x0 }, 523 { 0x5402b, 0x1000 }, 524 { 0x5402c, 0x3 }, 525 { 0x5402d, 0x0 }, 526 { 0x5402e, 0x0 }, 527 { 0x5402f, 0x0 }, 528 { 0x54030, 0x0 }, 529 { 0x54031, 0x0 }, 530 { 0x54032, 0xd400 }, 531 { 0x54033, ((((LPDDR4_RON) << 3) | 0x3) << 8) | 0x2d }, 532 { 0x54034, (((LPDDR4_RTT_CA_BANK0 << 4) | LPDDR4_RTT_DQ) << 8) }, 533 { 0x54035, (0x0800 | LPDDR4_VREF_VALUE_CA) }, 534 { 0x54036, LPDDR4_VREF_VALUE_DQ_RANK0 }, 535 { 0x54037, (LPDDR4_MR22_RANK0 << 8) }, 536 { 0x54038, 0xd400 }, 537 { 0x54039, ((((LPDDR4_RON) << 3) | 0x3) << 8) | 0x2d }, 538 { 0x5403a, (((LPDDR4_RTT_CA_BANK1 << 4) | LPDDR4_RTT_DQ) << 8) }, 539 { 0x5403b, (0x0800 | LPDDR4_VREF_VALUE_CA) }, 540 { 0x5403c, LPDDR4_VREF_VALUE_DQ_RANK1 }, 541 { 0x5403d, (LPDDR4_MR22_RANK1 << 8) }, 542 { 0x5403e, 0x0 }, 543 { 0x5403f, 0x0 }, 544 { 0x54040, 0x0 }, 545 { 0x54041, 0x0 }, 546 { 0x54042, 0x0 }, 547 { 0x54043, 0x0 }, 548 { 0x54044, 0x0 }, 549 { 0xd0000, 0x1 }, 550 551 }; 552 553 /* DRAM PHY init engine image */ 554 static struct dram_cfg_param lpddr4_phy_pie[] = { 555 { 0xd0000, 0x0 }, 556 { 0x90000, 0x10 }, 557 { 0x90001, 0x400 }, 558 { 0x90002, 0x10e }, 559 { 0x90003, 0x0 }, 560 { 0x90004, 0x0 }, 561 { 0x90005, 0x8 }, 562 { 0x90029, 0xb }, 563 { 0x9002a, 0x480 }, 564 { 0x9002b, 0x109 }, 565 { 0x9002c, 0x8 }, 566 { 0x9002d, 0x448 }, 567 { 0x9002e, 0x139 }, 568 { 0x9002f, 0x8 }, 569 { 0x90030, 0x478 }, 570 { 0x90031, 0x109 }, 571 { 0x90032, 0x0 }, 572 { 0x90033, 0xe8 }, 573 { 0x90034, 0x109 }, 574 { 0x90035, 0x2 }, 575 { 0x90036, 0x10 }, 576 { 0x90037, 0x139 }, 577 { 0x90038, 0xb }, 578 { 0x90039, 0x7c0 }, 579 { 0x9003a, 0x139 }, 580 { 0x9003b, 0x44 }, 581 { 0x9003c, 0x630 }, 582 { 0x9003d, 0x159 }, 583 { 0x9003e, 0x14f }, 584 { 0x9003f, 0x630 }, 585 { 0x90040, 0x159 }, 586 { 0x90041, 0x47 }, 587 { 0x90042, 0x630 }, 588 { 0x90043, 0x149 }, 589 { 0x90044, 0x4f }, 590 { 0x90045, 0x630 }, 591 { 0x90046, 0x179 }, 592 { 0x90047, 0x8 }, 593 { 0x90048, 0xe0 }, 594 { 0x90049, 0x109 }, 595 { 0x9004a, 0x0 }, 596 { 0x9004b, 0x7c8 }, 597 { 0x9004c, 0x109 }, 598 { 0x9004d, 0x0 }, 599 { 0x9004e, 0x1 }, 600 { 0x9004f, 0x8 }, 601 { 0x90050, 0x0 }, 602 { 0x90051, 0x45a }, 603 { 0x90052, 0x9 }, 604 { 0x90053, 0x0 }, 605 { 0x90054, 0x448 }, 606 { 0x90055, 0x109 }, 607 { 0x90056, 0x40 }, 608 { 0x90057, 0x630 }, 609 { 0x90058, 0x179 }, 610 { 0x90059, 0x1 }, 611 { 0x9005a, 0x618 }, 612 { 0x9005b, 0x109 }, 613 { 0x9005c, 0x40c0 }, 614 { 0x9005d, 0x630 }, 615 { 0x9005e, 0x149 }, 616 { 0x9005f, 0x8 }, 617 { 0x90060, 0x4 }, 618 { 0x90061, 0x48 }, 619 { 0x90062, 0x4040 }, 620 { 0x90063, 0x630 }, 621 { 0x90064, 0x149 }, 622 { 0x90065, 0x0 }, 623 { 0x90066, 0x4 }, 624 { 0x90067, 0x48 }, 625 { 0x90068, 0x40 }, 626 { 0x90069, 0x630 }, 627 { 0x9006a, 0x149 }, 628 { 0x9006b, 0x10 }, 629 { 0x9006c, 0x4 }, 630 { 0x9006d, 0x18 }, 631 { 0x9006e, 0x0 }, 632 { 0x9006f, 0x4 }, 633 { 0x90070, 0x78 }, 634 { 0x90071, 0x549 }, 635 { 0x90072, 0x630 }, 636 { 0x90073, 0x159 }, 637 { 0x90074, 0xd49 }, 638 { 0x90075, 0x630 }, 639 { 0x90076, 0x159 }, 640 { 0x90077, 0x94a }, 641 { 0x90078, 0x630 }, 642 { 0x90079, 0x159 }, 643 { 0x9007a, 0x441 }, 644 { 0x9007b, 0x630 }, 645 { 0x9007c, 0x149 }, 646 { 0x9007d, 0x42 }, 647 { 0x9007e, 0x630 }, 648 { 0x9007f, 0x149 }, 649 { 0x90080, 0x1 }, 650 { 0x90081, 0x630 }, 651 { 0x90082, 0x149 }, 652 { 0x90083, 0x0 }, 653 { 0x90084, 0xe0 }, 654 { 0x90085, 0x109 }, 655 { 0x90086, 0xa }, 656 { 0x90087, 0x10 }, 657 { 0x90088, 0x109 }, 658 { 0x90089, 0x9 }, 659 { 0x9008a, 0x3c0 }, 660 { 0x9008b, 0x149 }, 661 { 0x9008c, 0x9 }, 662 { 0x9008d, 0x3c0 }, 663 { 0x9008e, 0x159 }, 664 { 0x9008f, 0x18 }, 665 { 0x90090, 0x10 }, 666 { 0x90091, 0x109 }, 667 { 0x90092, 0x0 }, 668 { 0x90093, 0x3c0 }, 669 { 0x90094, 0x109 }, 670 { 0x90095, 0x18 }, 671 { 0x90096, 0x4 }, 672 { 0x90097, 0x48 }, 673 { 0x90098, 0x18 }, 674 { 0x90099, 0x4 }, 675 { 0x9009a, 0x58 }, 676 { 0x9009b, 0xa }, 677 { 0x9009c, 0x10 }, 678 { 0x9009d, 0x109 }, 679 { 0x9009e, 0x2 }, 680 { 0x9009f, 0x10 }, 681 { 0x900a0, 0x109 }, 682 { 0x900a1, 0x5 }, 683 { 0x900a2, 0x7c0 }, 684 { 0x900a3, 0x109 }, 685 { 0x900a4, 0xd }, 686 { 0x900a5, 0x7c0 }, 687 { 0x900a6, 0x109 }, 688 { 0x900a7, 0x4 }, 689 { 0x900a8, 0x7c0 }, 690 { 0x900a9, 0x109 }, 691 { 0x40000, 0x811 }, 692 { 0x40020, 0x880 }, 693 { 0x40040, 0x0 }, 694 { 0x40060, 0x0 }, 695 { 0x40001, 0x4008 }, 696 { 0x40021, 0x83 }, 697 { 0x40041, 0x4f }, 698 { 0x40061, 0x0 }, 699 { 0x40002, 0x4040 }, 700 { 0x40022, 0x83 }, 701 { 0x40042, 0x51 }, 702 { 0x40062, 0x0 }, 703 { 0x40003, 0x811 }, 704 { 0x40023, 0x880 }, 705 { 0x40043, 0x0 }, 706 { 0x40063, 0x0 }, 707 { 0x40004, 0x720 }, 708 { 0x40024, 0xf }, 709 { 0x40044, 0x1740 }, 710 { 0x40064, 0x0 }, 711 { 0x40005, 0x16 }, 712 { 0x40025, 0x83 }, 713 { 0x40045, 0x4b }, 714 { 0x40065, 0x0 }, 715 { 0x40006, 0x716 }, 716 { 0x40026, 0xf }, 717 { 0x40046, 0x2001 }, 718 { 0x40066, 0x0 }, 719 { 0x40007, 0x716 }, 720 { 0x40027, 0xf }, 721 { 0x40047, 0x2800 }, 722 { 0x40067, 0x0 }, 723 { 0x40008, 0x716 }, 724 { 0x40028, 0xf }, 725 { 0x40048, 0xf00 }, 726 { 0x40068, 0x0 }, 727 { 0x40009, 0x720 }, 728 { 0x40029, 0xf }, 729 { 0x40049, 0x1400 }, 730 { 0x40069, 0x0 }, 731 { 0x4000a, 0xe08 }, 732 { 0x4002a, 0xc15 }, 733 { 0x4004a, 0x0 }, 734 { 0x4006a, 0x0 }, 735 { 0x4000b, 0x623 }, 736 { 0x4002b, 0x15 }, 737 { 0x4004b, 0x0 }, 738 { 0x4006b, 0x0 }, 739 { 0x4000c, 0x4028 }, 740 { 0x4002c, 0x80 }, 741 { 0x4004c, 0x0 }, 742 { 0x4006c, 0x0 }, 743 { 0x4000d, 0xe08 }, 744 { 0x4002d, 0xc1a }, 745 { 0x4004d, 0x0 }, 746 { 0x4006d, 0x0 }, 747 { 0x4000e, 0x623 }, 748 { 0x4002e, 0x1a }, 749 { 0x4004e, 0x0 }, 750 { 0x4006e, 0x0 }, 751 { 0x4000f, 0x4040 }, 752 { 0x4002f, 0x80 }, 753 { 0x4004f, 0x0 }, 754 { 0x4006f, 0x0 }, 755 { 0x40010, 0x2604 }, 756 { 0x40030, 0x15 }, 757 { 0x40050, 0x0 }, 758 { 0x40070, 0x0 }, 759 { 0x40011, 0x708 }, 760 { 0x40031, 0x5 }, 761 { 0x40051, 0x0 }, 762 { 0x40071, 0x2002 }, 763 { 0x40012, 0x8 }, 764 { 0x40032, 0x80 }, 765 { 0x40052, 0x0 }, 766 { 0x40072, 0x0 }, 767 { 0x40013, 0x2604 }, 768 { 0x40033, 0x1a }, 769 { 0x40053, 0x0 }, 770 { 0x40073, 0x0 }, 771 { 0x40014, 0x708 }, 772 { 0x40034, 0xa }, 773 { 0x40054, 0x0 }, 774 { 0x40074, 0x2002 }, 775 { 0x40015, 0x4040 }, 776 { 0x40035, 0x80 }, 777 { 0x40055, 0x0 }, 778 { 0x40075, 0x0 }, 779 { 0x40016, 0x60a }, 780 { 0x40036, 0x15 }, 781 { 0x40056, 0x1200 }, 782 { 0x40076, 0x0 }, 783 { 0x40017, 0x61a }, 784 { 0x40037, 0x15 }, 785 { 0x40057, 0x1300 }, 786 { 0x40077, 0x0 }, 787 { 0x40018, 0x60a }, 788 { 0x40038, 0x1a }, 789 { 0x40058, 0x1200 }, 790 { 0x40078, 0x0 }, 791 { 0x40019, 0x642 }, 792 { 0x40039, 0x1a }, 793 { 0x40059, 0x1300 }, 794 { 0x40079, 0x0 }, 795 { 0x4001a, 0x4808 }, 796 { 0x4003a, 0x880 }, 797 { 0x4005a, 0x0 }, 798 { 0x4007a, 0x0 }, 799 { 0x900aa, 0x0 }, 800 { 0x900ab, 0x790 }, 801 { 0x900ac, 0x11a }, 802 { 0x900ad, 0x8 }, 803 { 0x900ae, 0x7aa }, 804 { 0x900af, 0x2a }, 805 { 0x900b0, 0x10 }, 806 { 0x900b1, 0x7b2 }, 807 { 0x900b2, 0x2a }, 808 { 0x900b3, 0x0 }, 809 { 0x900b4, 0x7c8 }, 810 { 0x900b5, 0x109 }, 811 { 0x900b6, 0x10 }, 812 { 0x900b7, 0x10 }, 813 { 0x900b8, 0x109 }, 814 { 0x900b9, 0x10 }, 815 { 0x900ba, 0x2a8 }, 816 { 0x900bb, 0x129 }, 817 { 0x900bc, 0x8 }, 818 { 0x900bd, 0x370 }, 819 { 0x900be, 0x129 }, 820 { 0x900bf, 0xa }, 821 { 0x900c0, 0x3c8 }, 822 { 0x900c1, 0x1a9 }, 823 { 0x900c2, 0xc }, 824 { 0x900c3, 0x408 }, 825 { 0x900c4, 0x199 }, 826 { 0x900c5, 0x14 }, 827 { 0x900c6, 0x790 }, 828 { 0x900c7, 0x11a }, 829 { 0x900c8, 0x8 }, 830 { 0x900c9, 0x4 }, 831 { 0x900ca, 0x18 }, 832 { 0x900cb, 0xe }, 833 { 0x900cc, 0x408 }, 834 { 0x900cd, 0x199 }, 835 { 0x900ce, 0x8 }, 836 { 0x900cf, 0x8568 }, 837 { 0x900d0, 0x108 }, 838 { 0x900d1, 0x18 }, 839 { 0x900d2, 0x790 }, 840 { 0x900d3, 0x16a }, 841 { 0x900d4, 0x8 }, 842 { 0x900d5, 0x1d8 }, 843 { 0x900d6, 0x169 }, 844 { 0x900d7, 0x10 }, 845 { 0x900d8, 0x8558 }, 846 { 0x900d9, 0x168 }, 847 { 0x900da, 0x70 }, 848 { 0x900db, 0x788 }, 849 { 0x900dc, 0x16a }, 850 { 0x900dd, 0x1ff8 }, 851 { 0x900de, 0x85a8 }, 852 { 0x900df, 0x1e8 }, 853 { 0x900e0, 0x50 }, 854 { 0x900e1, 0x798 }, 855 { 0x900e2, 0x16a }, 856 { 0x900e3, 0x60 }, 857 { 0x900e4, 0x7a0 }, 858 { 0x900e5, 0x16a }, 859 { 0x900e6, 0x8 }, 860 { 0x900e7, 0x8310 }, 861 { 0x900e8, 0x168 }, 862 { 0x900e9, 0x8 }, 863 { 0x900ea, 0xa310 }, 864 { 0x900eb, 0x168 }, 865 { 0x900ec, 0xa }, 866 { 0x900ed, 0x408 }, 867 { 0x900ee, 0x169 }, 868 { 0x900ef, 0x6e }, 869 { 0x900f0, 0x0 }, 870 { 0x900f1, 0x68 }, 871 { 0x900f2, 0x0 }, 872 { 0x900f3, 0x408 }, 873 { 0x900f4, 0x169 }, 874 { 0x900f5, 0x0 }, 875 { 0x900f6, 0x8310 }, 876 { 0x900f7, 0x168 }, 877 { 0x900f8, 0x0 }, 878 { 0x900f9, 0xa310 }, 879 { 0x900fa, 0x168 }, 880 { 0x900fb, 0x1ff8 }, 881 { 0x900fc, 0x85a8 }, 882 { 0x900fd, 0x1e8 }, 883 { 0x900fe, 0x68 }, 884 { 0x900ff, 0x798 }, 885 { 0x90100, 0x16a }, 886 { 0x90101, 0x78 }, 887 { 0x90102, 0x7a0 }, 888 { 0x90103, 0x16a }, 889 { 0x90104, 0x68 }, 890 { 0x90105, 0x790 }, 891 { 0x90106, 0x16a }, 892 { 0x90107, 0x8 }, 893 { 0x90108, 0x8b10 }, 894 { 0x90109, 0x168 }, 895 { 0x9010a, 0x8 }, 896 { 0x9010b, 0xab10 }, 897 { 0x9010c, 0x168 }, 898 { 0x9010d, 0xa }, 899 { 0x9010e, 0x408 }, 900 { 0x9010f, 0x169 }, 901 { 0x90110, 0x58 }, 902 { 0x90111, 0x0 }, 903 { 0x90112, 0x68 }, 904 { 0x90113, 0x0 }, 905 { 0x90114, 0x408 }, 906 { 0x90115, 0x169 }, 907 { 0x90116, 0x0 }, 908 { 0x90117, 0x8b10 }, 909 { 0x90118, 0x168 }, 910 { 0x90119, 0x0 }, 911 { 0x9011a, 0xab10 }, 912 { 0x9011b, 0x168 }, 913 { 0x9011c, 0x0 }, 914 { 0x9011d, 0x1d8 }, 915 { 0x9011e, 0x169 }, 916 { 0x9011f, 0x80 }, 917 { 0x90120, 0x790 }, 918 { 0x90121, 0x16a }, 919 { 0x90122, 0x18 }, 920 { 0x90123, 0x7aa }, 921 { 0x90124, 0x6a }, 922 { 0x90125, 0xa }, 923 { 0x90126, 0x0 }, 924 { 0x90127, 0x1e9 }, 925 { 0x90128, 0x8 }, 926 { 0x90129, 0x8080 }, 927 { 0x9012a, 0x108 }, 928 { 0x9012b, 0xf }, 929 { 0x9012c, 0x408 }, 930 { 0x9012d, 0x169 }, 931 { 0x9012e, 0xc }, 932 { 0x9012f, 0x0 }, 933 { 0x90130, 0x68 }, 934 { 0x90131, 0x9 }, 935 { 0x90132, 0x0 }, 936 { 0x90133, 0x1a9 }, 937 { 0x90134, 0x0 }, 938 { 0x90135, 0x408 }, 939 { 0x90136, 0x169 }, 940 { 0x90137, 0x0 }, 941 { 0x90138, 0x8080 }, 942 { 0x90139, 0x108 }, 943 { 0x9013a, 0x8 }, 944 { 0x9013b, 0x7aa }, 945 { 0x9013c, 0x6a }, 946 { 0x9013d, 0x0 }, 947 { 0x9013e, 0x8568 }, 948 { 0x9013f, 0x108 }, 949 { 0x90140, 0xb7 }, 950 { 0x90141, 0x790 }, 951 { 0x90142, 0x16a }, 952 { 0x90143, 0x1f }, 953 { 0x90144, 0x0 }, 954 { 0x90145, 0x68 }, 955 { 0x90146, 0x8 }, 956 { 0x90147, 0x8558 }, 957 { 0x90148, 0x168 }, 958 { 0x90149, 0xf }, 959 { 0x9014a, 0x408 }, 960 { 0x9014b, 0x169 }, 961 { 0x9014c, 0xc }, 962 { 0x9014d, 0x0 }, 963 { 0x9014e, 0x68 }, 964 { 0x9014f, 0x0 }, 965 { 0x90150, 0x408 }, 966 { 0x90151, 0x169 }, 967 { 0x90152, 0x0 }, 968 { 0x90153, 0x8558 }, 969 { 0x90154, 0x168 }, 970 { 0x90155, 0x8 }, 971 { 0x90156, 0x3c8 }, 972 { 0x90157, 0x1a9 }, 973 { 0x90158, 0x3 }, 974 { 0x90159, 0x370 }, 975 { 0x9015a, 0x129 }, 976 { 0x9015b, 0x20 }, 977 { 0x9015c, 0x2aa }, 978 { 0x9015d, 0x9 }, 979 { 0x9015e, 0x0 }, 980 { 0x9015f, 0x400 }, 981 { 0x90160, 0x10e }, 982 { 0x90161, 0x8 }, 983 { 0x90162, 0xe8 }, 984 { 0x90163, 0x109 }, 985 { 0x90164, 0x0 }, 986 { 0x90165, 0x8140 }, 987 { 0x90166, 0x10c }, 988 { 0x90167, 0x10 }, 989 { 0x90168, 0x8138 }, 990 { 0x90169, 0x10c }, 991 { 0x9016a, 0x8 }, 992 { 0x9016b, 0x7c8 }, 993 { 0x9016c, 0x101 }, 994 { 0x9016d, 0x8 }, 995 { 0x9016e, 0x0 }, 996 { 0x9016f, 0x8 }, 997 { 0x90170, 0x8 }, 998 { 0x90171, 0x448 }, 999 { 0x90172, 0x109 }, 1000 { 0x90173, 0xf }, 1001 { 0x90174, 0x7c0 }, 1002 { 0x90175, 0x109 }, 1003 { 0x90176, 0x0 }, 1004 { 0x90177, 0xe8 }, 1005 { 0x90178, 0x109 }, 1006 { 0x90179, 0x47 }, 1007 { 0x9017a, 0x630 }, 1008 { 0x9017b, 0x109 }, 1009 { 0x9017c, 0x8 }, 1010 { 0x9017d, 0x618 }, 1011 { 0x9017e, 0x109 }, 1012 { 0x9017f, 0x8 }, 1013 { 0x90180, 0xe0 }, 1014 { 0x90181, 0x109 }, 1015 { 0x90182, 0x0 }, 1016 { 0x90183, 0x7c8 }, 1017 { 0x90184, 0x109 }, 1018 { 0x90185, 0x8 }, 1019 { 0x90186, 0x8140 }, 1020 { 0x90187, 0x10c }, 1021 { 0x90188, 0x0 }, 1022 { 0x90189, 0x1 }, 1023 { 0x9018a, 0x8 }, 1024 { 0x9018b, 0x8 }, 1025 { 0x9018c, 0x4 }, 1026 { 0x9018d, 0x8 }, 1027 { 0x9018e, 0x8 }, 1028 { 0x9018f, 0x7c8 }, 1029 { 0x90190, 0x101 }, 1030 { 0x90006, 0x0 }, 1031 { 0x90007, 0x0 }, 1032 { 0x90008, 0x8 }, 1033 { 0x90009, 0x0 }, 1034 { 0x9000a, 0x0 }, 1035 { 0x9000b, 0x0 }, 1036 { 0xd00e7, 0x400 }, 1037 { 0x90017, 0x0 }, 1038 { 0x9001f, 0x2b }, 1039 { 0x90026, 0x6c }, 1040 { 0x400d0, 0x0 }, 1041 { 0x400d1, 0x101 }, 1042 { 0x400d2, 0x105 }, 1043 { 0x400d3, 0x107 }, 1044 { 0x400d4, 0x10f }, 1045 { 0x400d5, 0x202 }, 1046 { 0x400d6, 0x20a }, 1047 { 0x400d7, 0x20b }, 1048 { 0x2003a, 0x2 }, 1049 { 0x2000b, 0x64 }, 1050 { 0x2000c, 0xc8 }, 1051 { 0x2000d, 0x7d0 }, 1052 { 0x2000e, 0x2c }, 1053 { 0x12000b, 0x14 }, 1054 { 0x12000c, 0x29 }, 1055 { 0x12000d, 0x1a1 }, 1056 { 0x12000e, 0x10 }, 1057 { 0x22000b, 0x3 }, 1058 { 0x22000c, 0x6 }, 1059 { 0x22000d, 0x3e }, 1060 { 0x22000e, 0x10 }, 1061 { 0x9000c, 0x0 }, 1062 { 0x9000d, 0x173 }, 1063 { 0x9000e, 0x60 }, 1064 { 0x9000f, 0x6110 }, 1065 { 0x90010, 0x2152 }, 1066 { 0x90011, 0xdfbd }, 1067 { 0x90012, 0x60 }, 1068 { 0x90013, 0x6152 }, 1069 { 0x20010, 0x5a }, 1070 { 0x20011, 0x3 }, 1071 { 0x40080, 0xe0 }, 1072 { 0x40081, 0x12 }, 1073 { 0x40082, 0xe0 }, 1074 { 0x40083, 0x12 }, 1075 { 0x40084, 0xe0 }, 1076 { 0x40085, 0x12 }, 1077 { 0x140080, 0xe0 }, 1078 { 0x140081, 0x12 }, 1079 { 0x140082, 0xe0 }, 1080 { 0x140083, 0x12 }, 1081 { 0x140084, 0xe0 }, 1082 { 0x140085, 0x12 }, 1083 { 0x240080, 0xe0 }, 1084 { 0x240081, 0x12 }, 1085 { 0x240082, 0xe0 }, 1086 { 0x240083, 0x12 }, 1087 { 0x240084, 0xe0 }, 1088 { 0x240085, 0x12 }, 1089 { 0x400fd, 0xf }, 1090 { 0x10011, 0x1 }, 1091 { 0x10012, 0x1 }, 1092 { 0x10013, 0x180 }, 1093 { 0x10018, 0x1 }, 1094 { 0x10002, 0x6209 }, 1095 { 0x100b2, 0x1 }, 1096 { 0x101b4, 0x1 }, 1097 { 0x102b4, 0x1 }, 1098 { 0x103b4, 0x1 }, 1099 { 0x104b4, 0x1 }, 1100 { 0x105b4, 0x1 }, 1101 { 0x106b4, 0x1 }, 1102 { 0x107b4, 0x1 }, 1103 { 0x108b4, 0x1 }, 1104 { 0x11011, 0x1 }, 1105 { 0x11012, 0x1 }, 1106 { 0x11013, 0x180 }, 1107 { 0x11018, 0x1 }, 1108 { 0x11002, 0x6209 }, 1109 { 0x110b2, 0x1 }, 1110 { 0x111b4, 0x1 }, 1111 { 0x112b4, 0x1 }, 1112 { 0x113b4, 0x1 }, 1113 { 0x114b4, 0x1 }, 1114 { 0x115b4, 0x1 }, 1115 { 0x116b4, 0x1 }, 1116 { 0x117b4, 0x1 }, 1117 { 0x118b4, 0x1 }, 1118 { 0x12011, 0x1 }, 1119 { 0x12012, 0x1 }, 1120 { 0x12013, 0x180 }, 1121 { 0x12018, 0x1 }, 1122 { 0x12002, 0x6209 }, 1123 { 0x120b2, 0x1 }, 1124 { 0x121b4, 0x1 }, 1125 { 0x122b4, 0x1 }, 1126 { 0x123b4, 0x1 }, 1127 { 0x124b4, 0x1 }, 1128 { 0x125b4, 0x1 }, 1129 { 0x126b4, 0x1 }, 1130 { 0x127b4, 0x1 }, 1131 { 0x128b4, 0x1 }, 1132 { 0x13011, 0x1 }, 1133 { 0x13012, 0x1 }, 1134 { 0x13013, 0x180 }, 1135 { 0x13018, 0x1 }, 1136 { 0x13002, 0x6209 }, 1137 { 0x130b2, 0x1 }, 1138 { 0x131b4, 0x1 }, 1139 { 0x132b4, 0x1 }, 1140 { 0x133b4, 0x1 }, 1141 { 0x134b4, 0x1 }, 1142 { 0x135b4, 0x1 }, 1143 { 0x136b4, 0x1 }, 1144 { 0x137b4, 0x1 }, 1145 { 0x138b4, 0x1 }, 1146 { 0x20089, 0x1 }, 1147 { 0x20088, 0x19 }, 1148 { 0xc0080, 0x2 }, 1149 { 0xd0000, 0x1 }, 1150 }; 1151 1152 static struct dram_fsp_msg lpddr4_dram_fsp_msg[] = { 1153 { 1154 /* P0 3200mts 1D */ 1155 .drate = 3200, 1156 .fw_type = FW_1D_IMAGE, 1157 .fsp_cfg = lpddr4_fsp0_cfg, 1158 .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp0_cfg), 1159 }, 1160 { 1161 /* P1 667mts 1D */ 1162 .drate = 667, 1163 .fw_type = FW_1D_IMAGE, 1164 .fsp_cfg = lpddr4_fsp1_cfg, 1165 .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp1_cfg), 1166 }, 1167 { 1168 /* P0 3200mts 2D */ 1169 .drate = 3200, 1170 .fw_type = FW_2D_IMAGE, 1171 .fsp_cfg = lpddr4_fsp0_2d_cfg, 1172 .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp0_2d_cfg), 1173 }, 1174 }; 1175 1176 /* lpddr4 timing config params on EVK board */ 1177 struct dram_timing_info dram_timing_b0 = { 1178 .ddrc_cfg = lpddr4_ddrc_cfg, 1179 .ddrc_cfg_num = ARRAY_SIZE(lpddr4_ddrc_cfg), 1180 .ddrphy_cfg = lpddr4_ddrphy_cfg, 1181 .ddrphy_cfg_num = ARRAY_SIZE(lpddr4_ddrphy_cfg), 1182 .fsp_msg = lpddr4_dram_fsp_msg, 1183 .fsp_msg_num = ARRAY_SIZE(lpddr4_dram_fsp_msg), 1184 .ddrphy_pie = lpddr4_phy_pie, 1185 .ddrphy_pie_num = ARRAY_SIZE(lpddr4_phy_pie), 1186 /* 1187 * this table must be initialized if DDRPHY bypass mode is 1188 * not used: all fsp drate > 666MTS. 1189 */ 1190 .fsp_table = { 3200, 667, }, 1191 }; 1192