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