Lines Matching refs:fuc

123 	struct gk104_ramfuc fuc;  member
141 gk104_ram_train(struct gk104_ramfuc *fuc, u32 mask, u32 data) in gk104_ram_train() argument
143 struct gk104_ram *ram = container_of(fuc, typeof(*ram), fuc); in gk104_ram_train()
146 ram_mask(fuc, 0x10f910, mask, data); in gk104_ram_train()
147 ram_mask(fuc, 0x10f914, mask, data); in gk104_ram_train()
152 ram_wait(fuc, addr, 0x0000000f, 0x00000000, 500000); in gk104_ram_train()
157 r1373f4_init(struct gk104_ramfuc *fuc) in r1373f4_init() argument
159 struct gk104_ram *ram = container_of(fuc, typeof(*ram), fuc); in r1373f4_init()
166 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00001100); in r1373f4_init()
167 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00000010); in r1373f4_init()
169 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00010010); in r1373f4_init()
172 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000000); in r1373f4_init()
173 ram_mask(fuc, 0x1373f4, 0x00000010, 0x00000000); in r1373f4_init()
176 if ((ram_rd32(fuc, 0x132024) & 0xffffffff) != rcoef || in r1373f4_init()
177 (ram_rd32(fuc, 0x132034) & 0x0000ffff) != runk1) { in r1373f4_init()
178 ram_mask(fuc, 0x132000, 0x00000001, 0x00000000); in r1373f4_init()
179 ram_mask(fuc, 0x132020, 0x00000001, 0x00000000); in r1373f4_init()
180 ram_wr32(fuc, 0x137320, 0x00000000); in r1373f4_init()
181 ram_mask(fuc, 0x132030, 0xffff0000, runk0); in r1373f4_init()
182 ram_mask(fuc, 0x132034, 0x0000ffff, runk1); in r1373f4_init()
183 ram_wr32(fuc, 0x132024, rcoef); in r1373f4_init()
184 ram_mask(fuc, 0x132028, 0x00080000, 0x00080000); in r1373f4_init()
185 ram_mask(fuc, 0x132020, 0x00000001, 0x00000001); in r1373f4_init()
186 ram_wait(fuc, 0x137390, 0x00020000, 0x00020000, 64000); in r1373f4_init()
187 ram_mask(fuc, 0x132028, 0x00080000, 0x00000000); in r1373f4_init()
192 ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000); in r1373f4_init()
193 ram_mask(fuc, 0x132000, 0x80000000, 0x80000000); in r1373f4_init()
194 ram_mask(fuc, 0x132000, 0x00000001, 0x00000000); in r1373f4_init()
195 ram_mask(fuc, 0x132004, 0x103fffff, mcoef); in r1373f4_init()
196 ram_mask(fuc, 0x132000, 0x00000001, 0x00000001); in r1373f4_init()
197 ram_wait(fuc, 0x137390, 0x00000002, 0x00000002, 64000); in r1373f4_init()
198 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00001100); in r1373f4_init()
200 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00010100); in r1373f4_init()
203 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00000010); in r1373f4_init()
207 r1373f4_fini(struct gk104_ramfuc *fuc) in r1373f4_fini() argument
209 struct gk104_ram *ram = container_of(fuc, typeof(*ram), fuc); in r1373f4_fini()
215 tmp = ram_rd32(fuc, 0x1373ec) & ~0x00030000; in r1373f4_fini()
216 ram_wr32(fuc, 0x1373ec, tmp | (v1 << 16)); in r1373f4_fini()
217 ram_mask(fuc, 0x1373f0, (~ram->mode & 3), 0x00000000); in r1373f4_fini()
219 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000002); in r1373f4_fini()
220 ram_mask(fuc, 0x1373f4, 0x00001100, 0x00000000); in r1373f4_fini()
222 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000001); in r1373f4_fini()
223 ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000); in r1373f4_fini()
225 ram_mask(fuc, 0x10f800, 0x00000030, (v0 ^ v1) << 4); in r1373f4_fini()
233 struct ramfuc *fuc = &ram->fuc.base; in gk104_ram_nuts() local
244 nvkm_memx_wr32(fuc->memx, addr, next); in gk104_ram_nuts()
249 gk104_ram_nuts((s), &(s)->fuc.r_##r, (m), (d), (c))
254 struct gk104_ramfuc *fuc = &ram->fuc; in gk104_ram_calc_gddr5() local
260 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); in gk104_ram_calc_gddr5()
261 ram_block(fuc); in gk104_ram_calc_gddr5()
264 ram_wr32(fuc, 0x62c000, 0x0f0f0000); in gk104_ram_calc_gddr5()
268 ram_mask(fuc, mr[1], 0x03c, ram->base.mr[1] & 0x03c); in gk104_ram_calc_gddr5()
272 if (vc == 1 && ram_have(fuc, gpio2E)) { in gk104_ram_calc_gddr5()
273 u32 temp = ram_mask(fuc, gpio2E, 0x3000, fuc->r_func2E[1]); in gk104_ram_calc_gddr5()
274 if (temp != ram_rd32(fuc, gpio2E)) { in gk104_ram_calc_gddr5()
275 ram_wr32(fuc, gpiotrig, 1); in gk104_ram_calc_gddr5()
276 ram_nsec(fuc, 20000); in gk104_ram_calc_gddr5()
280 ram_mask(fuc, 0x10f200, 0x00000800, 0x00000000); in gk104_ram_calc_gddr5()
282 gk104_ram_train(fuc, 0x01020000, 0x000c0000); in gk104_ram_calc_gddr5()
284 ram_wr32(fuc, 0x10f210, 0x00000000); /* REFRESH_AUTO = 0 */ in gk104_ram_calc_gddr5()
285 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
286 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ in gk104_ram_calc_gddr5()
287 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
289 ram_mask(fuc, 0x10f200, 0x80000000, 0x80000000); in gk104_ram_calc_gddr5()
290 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */ in gk104_ram_calc_gddr5()
291 ram_mask(fuc, 0x10f200, 0x80000000, 0x00000000); in gk104_ram_calc_gddr5()
292 ram_wr32(fuc, 0x10f090, 0x00000061); in gk104_ram_calc_gddr5()
293 ram_wr32(fuc, 0x10f090, 0xc000007f); in gk104_ram_calc_gddr5()
294 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
296 ram_wr32(fuc, 0x10f698, 0x00000000); in gk104_ram_calc_gddr5()
297 ram_wr32(fuc, 0x10f69c, 0x00000000); in gk104_ram_calc_gddr5()
306 if (ram_rd32(fuc, 0x10f978) & 0x00800000) in gk104_ram_calc_gddr5()
336 if (ram_rd32(fuc, 0x10f978) & 0x00800000) in gk104_ram_calc_gddr5()
339 ram_mask(fuc, 0x10f824, mask, data); in gk104_ram_calc_gddr5()
341 ram_mask(fuc, 0x132040, 0x00010000, 0x00000000); in gk104_ram_calc_gddr5()
344 ram_mask(fuc, 0x10f808, 0x00080000, 0x00000000); in gk104_ram_calc_gddr5()
345 ram_mask(fuc, 0x10f200, 0x18008000, 0x00008000); in gk104_ram_calc_gddr5()
346 ram_mask(fuc, 0x10f800, 0x00000000, 0x00000004); in gk104_ram_calc_gddr5()
347 ram_mask(fuc, 0x10f830, 0x00008000, 0x01040010); in gk104_ram_calc_gddr5()
348 ram_mask(fuc, 0x10f830, 0x01000000, 0x00000000); in gk104_ram_calc_gddr5()
349 r1373f4_init(fuc); in gk104_ram_calc_gddr5()
350 ram_mask(fuc, 0x1373f0, 0x00000002, 0x00000001); in gk104_ram_calc_gddr5()
351 r1373f4_fini(fuc); in gk104_ram_calc_gddr5()
352 ram_mask(fuc, 0x10f830, 0x00c00000, 0x00240001); in gk104_ram_calc_gddr5()
355 r1373f4_init(fuc); in gk104_ram_calc_gddr5()
356 r1373f4_fini(fuc); in gk104_ram_calc_gddr5()
359 if (ram_have(fuc, gpioMV)) { in gk104_ram_calc_gddr5()
360 u32 temp = ram_mask(fuc, gpioMV, 0x3000, fuc->r_funcMV[mv]); in gk104_ram_calc_gddr5()
361 if (temp != ram_rd32(fuc, gpioMV)) { in gk104_ram_calc_gddr5()
362 ram_wr32(fuc, gpiotrig, 1); in gk104_ram_calc_gddr5()
363 ram_nsec(fuc, 64000); in gk104_ram_calc_gddr5()
369 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000); in gk104_ram_calc_gddr5()
370 ram_nsec(fuc, 20000); in gk104_ram_calc_gddr5()
375 ram_mask(fuc, 0x10f200, 0x18000000, 0x18000000); in gk104_ram_calc_gddr5()
376 ram_mask(fuc, 0x10f800, 0x00000004, 0x00000000); in gk104_ram_calc_gddr5()
377 ram_mask(fuc, 0x1373f0, 0x00000000, 0x00000002); in gk104_ram_calc_gddr5()
378 ram_mask(fuc, 0x10f830, 0x00800001, 0x00408010); in gk104_ram_calc_gddr5()
379 r1373f4_init(fuc); in gk104_ram_calc_gddr5()
380 r1373f4_fini(fuc); in gk104_ram_calc_gddr5()
381 ram_mask(fuc, 0x10f808, 0x00000000, 0x00080000); in gk104_ram_calc_gddr5()
382 ram_mask(fuc, 0x10f200, 0x00808000, 0x00800000); in gk104_ram_calc_gddr5()
385 ram_mask(fuc, 0x10f800, 0x00000004, 0x00000000); in gk104_ram_calc_gddr5()
386 r1373f4_init(fuc); in gk104_ram_calc_gddr5()
387 r1373f4_fini(fuc); in gk104_ram_calc_gddr5()
392 ram_mask(fuc, 0x10f670, 0x80000000, 0x80000000); in gk104_ram_calc_gddr5()
395 ram_wr32(fuc, 0x10f65c, 0x00000011 * next->bios.rammap_11_11_0c); in gk104_ram_calc_gddr5()
396 ram_wr32(fuc, 0x10f6b8, 0x01010101 * next->bios.ramcfg_11_09); in gk104_ram_calc_gddr5()
397 ram_wr32(fuc, 0x10f6bc, 0x01010101 * next->bios.ramcfg_11_09); in gk104_ram_calc_gddr5()
400 ram_wr32(fuc, 0x10f698, 0x01010101 * next->bios.ramcfg_11_04); in gk104_ram_calc_gddr5()
401 ram_wr32(fuc, 0x10f69c, 0x01010101 * next->bios.ramcfg_11_04); in gk104_ram_calc_gddr5()
404 ram_wr32(fuc, 0x10f698, 0x00000000); in gk104_ram_calc_gddr5()
405 ram_wr32(fuc, 0x10f69c, 0x00000000); in gk104_ram_calc_gddr5()
410 ram_nuke(fuc, 0x10f694); in gk104_ram_calc_gddr5()
411 ram_mask(fuc, 0x10f694, 0xff00ff00, data); in gk104_ram_calc_gddr5()
418 ram_mask(fuc, 0x10f60c, 0x00000080, data); in gk104_ram_calc_gddr5()
432 ram_mask(fuc, 0x10f824, mask, data); in gk104_ram_calc_gddr5()
438 ram_mask(fuc, 0x10f200, 0x00001000, data); in gk104_ram_calc_gddr5()
440 if (ram_rd32(fuc, 0x10f670) & 0x80000000) { in gk104_ram_calc_gddr5()
441 ram_nsec(fuc, 10000); in gk104_ram_calc_gddr5()
442 ram_mask(fuc, 0x10f670, 0x80000000, 0x00000000); in gk104_ram_calc_gddr5()
449 ram_mask(fuc, 0x10f82c, 0x00100000, data); in gk104_ram_calc_gddr5()
458 ram_mask(fuc, 0x10f830, 0x00007000, data); in gk104_ram_calc_gddr5()
461 ram_mask(fuc, 0x10f248, 0xffffffff, next->bios.timing[10]); in gk104_ram_calc_gddr5()
462 ram_mask(fuc, 0x10f290, 0xffffffff, next->bios.timing[0]); in gk104_ram_calc_gddr5()
463 ram_mask(fuc, 0x10f294, 0xffffffff, next->bios.timing[1]); in gk104_ram_calc_gddr5()
464 ram_mask(fuc, 0x10f298, 0xffffffff, next->bios.timing[2]); in gk104_ram_calc_gddr5()
465 ram_mask(fuc, 0x10f29c, 0xffffffff, next->bios.timing[3]); in gk104_ram_calc_gddr5()
466 ram_mask(fuc, 0x10f2a0, 0xffffffff, next->bios.timing[4]); in gk104_ram_calc_gddr5()
467 ram_mask(fuc, 0x10f2a4, 0xffffffff, next->bios.timing[5]); in gk104_ram_calc_gddr5()
468 ram_mask(fuc, 0x10f2a8, 0xffffffff, next->bios.timing[6]); in gk104_ram_calc_gddr5()
469 ram_mask(fuc, 0x10f2ac, 0xffffffff, next->bios.timing[7]); in gk104_ram_calc_gddr5()
470 ram_mask(fuc, 0x10f2cc, 0xffffffff, next->bios.timing[8]); in gk104_ram_calc_gddr5()
471 ram_mask(fuc, 0x10f2e8, 0xffffffff, next->bios.timing[9]); in gk104_ram_calc_gddr5()
479 ram_mask(fuc, 0x10f200, mask, data); in gk104_ram_calc_gddr5()
491 ram_mask(fuc, 0x10f604, mask, data); in gk104_ram_calc_gddr5()
503 ram_mask(fuc, 0x10f614, mask, data); in gk104_ram_calc_gddr5()
515 ram_mask(fuc, 0x10f610, mask, data); in gk104_ram_calc_gddr5()
539 ram_mask(fuc, 0x10f808, mask, data); in gk104_ram_calc_gddr5()
541 ram_wr32(fuc, 0x10f870, 0x11111111 * next->bios.ramcfg_11_03_0f); in gk104_ram_calc_gddr5()
554 if ((ram_mask(fuc, 0x100770, mask, data) & mask & 4) != (data & 4)) { in gk104_ram_calc_gddr5()
555 ram_mask(fuc, 0x100750, 0x00000008, 0x00000008); in gk104_ram_calc_gddr5()
556 ram_wr32(fuc, 0x100710, 0x00000000); in gk104_ram_calc_gddr5()
557 ram_wait(fuc, 0x100710, 0x80000000, 0x80000000, 200000); in gk104_ram_calc_gddr5()
563 ram_mask(fuc, 0x100778, 0x00000700, data); in gk104_ram_calc_gddr5()
565 ram_mask(fuc, 0x10f250, 0x000003f0, next->bios.timing_20_2c_003f << 4); in gk104_ram_calc_gddr5()
569 ram_mask(fuc, 0x10f24c, 0x7f000000, data << 24); in gk104_ram_calc_gddr5()
570 ram_mask(fuc, 0x10f224, 0x001f0000, next->bios.timing_20_30_f8 << 16); in gk104_ram_calc_gddr5()
572 ram_mask(fuc, 0x10fec4, 0x041e0f07, next->bios.timing_20_31_0800 << 26 | in gk104_ram_calc_gddr5()
576 ram_mask(fuc, 0x10fec8, 0x00000027, next->bios.timing_20_31_8000 << 5 | in gk104_ram_calc_gddr5()
579 ram_wr32(fuc, 0x10f090, 0x4000007e); in gk104_ram_calc_gddr5()
580 ram_nsec(fuc, 2000); in gk104_ram_calc_gddr5()
581 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */ in gk104_ram_calc_gddr5()
582 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ in gk104_ram_calc_gddr5()
583 ram_wr32(fuc, 0x10f210, 0x80000000); /* REFRESH_AUTO = 1 */ in gk104_ram_calc_gddr5()
586 u32 temp = ram_mask(fuc, 0x10f294, 0xff000000, 0x24000000); in gk104_ram_calc_gddr5()
587 gk104_ram_train(fuc, 0xbc0e0000, 0xa4010000); /*XXX*/ in gk104_ram_calc_gddr5()
588 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
589 ram_wr32(fuc, 0x10f294, temp); in gk104_ram_calc_gddr5()
592 ram_mask(fuc, mr[3], 0xfff, ram->base.mr[3]); in gk104_ram_calc_gddr5()
593 ram_wr32(fuc, mr[0], ram->base.mr[0]); in gk104_ram_calc_gddr5()
594 ram_mask(fuc, mr[8], 0xfff, ram->base.mr[8]); in gk104_ram_calc_gddr5()
595 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
596 ram_mask(fuc, mr[1], 0xfff, ram->base.mr[1]); in gk104_ram_calc_gddr5()
597 ram_mask(fuc, mr[5], 0xfff, ram->base.mr[5] & ~0x004); /* LP3 later */ in gk104_ram_calc_gddr5()
598 ram_mask(fuc, mr[6], 0xfff, ram->base.mr[6]); in gk104_ram_calc_gddr5()
599 ram_mask(fuc, mr[7], 0xfff, ram->base.mr[7]); in gk104_ram_calc_gddr5()
601 if (vc == 0 && ram_have(fuc, gpio2E)) { in gk104_ram_calc_gddr5()
602 u32 temp = ram_mask(fuc, gpio2E, 0x3000, fuc->r_func2E[0]); in gk104_ram_calc_gddr5()
603 if (temp != ram_rd32(fuc, gpio2E)) { in gk104_ram_calc_gddr5()
604 ram_wr32(fuc, gpiotrig, 1); in gk104_ram_calc_gddr5()
605 ram_nsec(fuc, 20000); in gk104_ram_calc_gddr5()
609 ram_mask(fuc, 0x10f200, 0x80000000, 0x80000000); in gk104_ram_calc_gddr5()
610 ram_wr32(fuc, 0x10f318, 0x00000001); /* NOP? */ in gk104_ram_calc_gddr5()
611 ram_mask(fuc, 0x10f200, 0x80000000, 0x00000000); in gk104_ram_calc_gddr5()
612 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
615 data = ram_rd32(fuc, 0x10f978); in gk104_ram_calc_gddr5()
626 ram_wr32(fuc, 0x10f978, data); in gk104_ram_calc_gddr5()
629 data = ram_rd32(fuc, 0x10f830) | 0x00000001; in gk104_ram_calc_gddr5()
630 ram_wr32(fuc, 0x10f830, data); in gk104_ram_calc_gddr5()
642 gk104_ram_train(fuc, 0xbc0f0000, data); in gk104_ram_calc_gddr5()
644 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
647 ram_mask(fuc, 0x10f800, 0x00000004, 0x00000004); in gk104_ram_calc_gddr5()
651 if (ram_mask(fuc, mr[5], 0x004, ram->base.mr[5]) != ram->base.mr[5]) in gk104_ram_calc_gddr5()
652 ram_nsec(fuc, 1000); in gk104_ram_calc_gddr5()
655 ram_mask(fuc, 0x10f830, 0x01000000, 0x01000000); in gk104_ram_calc_gddr5()
656 ram_mask(fuc, 0x10f830, 0x01000000, 0x00000000); in gk104_ram_calc_gddr5()
660 gk104_ram_train(fuc, 0x80020000, 0x01000000); in gk104_ram_calc_gddr5()
662 ram_unblock(fuc); in gk104_ram_calc_gddr5()
665 ram_wr32(fuc, 0x62c000, 0x0f0f0f00); in gk104_ram_calc_gddr5()
671 ram_mask(fuc, 0x10f200, 0x00000800, data); in gk104_ram_calc_gddr5()
681 nvkm_sddr3_dll_reset(struct gk104_ramfuc *fuc) in nvkm_sddr3_dll_reset() argument
683 ram_nuke(fuc, mr[0]); in nvkm_sddr3_dll_reset()
684 ram_mask(fuc, mr[0], 0x100, 0x100); in nvkm_sddr3_dll_reset()
685 ram_mask(fuc, mr[0], 0x100, 0x000); in nvkm_sddr3_dll_reset()
689 nvkm_sddr3_dll_disable(struct gk104_ramfuc *fuc) in nvkm_sddr3_dll_disable() argument
691 u32 mr1_old = ram_rd32(fuc, mr[1]); in nvkm_sddr3_dll_disable()
694 ram_mask(fuc, mr[1], 0x1, 0x1); in nvkm_sddr3_dll_disable()
695 ram_nsec(fuc, 1000); in nvkm_sddr3_dll_disable()
702 struct gk104_ramfuc *fuc = &ram->fuc; in gk104_ram_calc_sddr3() local
711 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); in gk104_ram_calc_sddr3()
712 ram_block(fuc); in gk104_ram_calc_sddr3()
715 ram_wr32(fuc, 0x62c000, 0x0f0f0000); in gk104_ram_calc_sddr3()
717 if (vc == 1 && ram_have(fuc, gpio2E)) { in gk104_ram_calc_sddr3()
718 u32 temp = ram_mask(fuc, gpio2E, 0x3000, fuc->r_func2E[1]); in gk104_ram_calc_sddr3()
719 if (temp != ram_rd32(fuc, gpio2E)) { in gk104_ram_calc_sddr3()
720 ram_wr32(fuc, gpiotrig, 1); in gk104_ram_calc_sddr3()
721 ram_nsec(fuc, 20000); in gk104_ram_calc_sddr3()
725 ram_mask(fuc, 0x10f200, 0x00000800, 0x00000000); in gk104_ram_calc_sddr3()
727 ram_mask(fuc, 0x10f808, 0x04000000, 0x04000000); in gk104_ram_calc_sddr3()
729 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */ in gk104_ram_calc_sddr3()
732 nvkm_sddr3_dll_disable(fuc); in gk104_ram_calc_sddr3()
734 ram_wr32(fuc, 0x10f210, 0x00000000); /* REFRESH_AUTO = 0 */ in gk104_ram_calc_sddr3()
735 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ in gk104_ram_calc_sddr3()
736 ram_mask(fuc, 0x10f200, 0x80000000, 0x80000000); in gk104_ram_calc_sddr3()
737 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ in gk104_ram_calc_sddr3()
738 ram_mask(fuc, 0x10f200, 0x80000000, 0x00000000); in gk104_ram_calc_sddr3()
739 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
741 ram_wr32(fuc, 0x10f090, 0x00000060); in gk104_ram_calc_sddr3()
742 ram_wr32(fuc, 0x10f090, 0xc000007e); in gk104_ram_calc_sddr3()
780 ram_mask(fuc, 0x10f824, mask, data); in gk104_ram_calc_sddr3()
782 ram_mask(fuc, 0x132040, 0x00010000, 0x00000000); in gk104_ram_calc_sddr3()
784 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00010010); in gk104_ram_calc_sddr3()
785 data = ram_rd32(fuc, 0x1373ec) & ~0x00030000; in gk104_ram_calc_sddr3()
787 ram_wr32(fuc, 0x1373ec, data); in gk104_ram_calc_sddr3()
788 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000000); in gk104_ram_calc_sddr3()
789 ram_mask(fuc, 0x1373f4, 0x00000010, 0x00000000); in gk104_ram_calc_sddr3()
792 if ((ram_rd32(fuc, 0x132024) & 0xffffffff) != rcoef || in gk104_ram_calc_sddr3()
793 (ram_rd32(fuc, 0x132034) & 0x0000ffff) != runk1) { in gk104_ram_calc_sddr3()
794 ram_mask(fuc, 0x132000, 0x00000001, 0x00000000); in gk104_ram_calc_sddr3()
795 ram_mask(fuc, 0x132020, 0x00000001, 0x00000000); in gk104_ram_calc_sddr3()
796 ram_wr32(fuc, 0x137320, 0x00000000); in gk104_ram_calc_sddr3()
797 ram_mask(fuc, 0x132030, 0xffff0000, runk0); in gk104_ram_calc_sddr3()
798 ram_mask(fuc, 0x132034, 0x0000ffff, runk1); in gk104_ram_calc_sddr3()
799 ram_wr32(fuc, 0x132024, rcoef); in gk104_ram_calc_sddr3()
800 ram_mask(fuc, 0x132028, 0x00080000, 0x00080000); in gk104_ram_calc_sddr3()
801 ram_mask(fuc, 0x132020, 0x00000001, 0x00000001); in gk104_ram_calc_sddr3()
802 ram_wait(fuc, 0x137390, 0x00020000, 0x00020000, 64000); in gk104_ram_calc_sddr3()
803 ram_mask(fuc, 0x132028, 0x00080000, 0x00000000); in gk104_ram_calc_sddr3()
806 ram_mask(fuc, 0x1373f4, 0x00000010, 0x00000010); in gk104_ram_calc_sddr3()
807 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000001); in gk104_ram_calc_sddr3()
808 ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000); in gk104_ram_calc_sddr3()
810 if (ram_have(fuc, gpioMV)) { in gk104_ram_calc_sddr3()
811 u32 temp = ram_mask(fuc, gpioMV, 0x3000, fuc->r_funcMV[mv]); in gk104_ram_calc_sddr3()
812 if (temp != ram_rd32(fuc, gpioMV)) { in gk104_ram_calc_sddr3()
813 ram_wr32(fuc, gpiotrig, 1); in gk104_ram_calc_sddr3()
814 ram_nsec(fuc, 64000); in gk104_ram_calc_sddr3()
820 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000); in gk104_ram_calc_sddr3()
821 ram_nsec(fuc, 20000); in gk104_ram_calc_sddr3()
826 ram_mask(fuc, 0x10f670, 0x80000000, 0x80000000); in gk104_ram_calc_sddr3()
829 ram_wr32(fuc, 0x10f65c, 0x00000011 * next->bios.rammap_11_11_0c); in gk104_ram_calc_sddr3()
830 ram_wr32(fuc, 0x10f6b8, 0x01010101 * next->bios.ramcfg_11_09); in gk104_ram_calc_sddr3()
831 ram_wr32(fuc, 0x10f6bc, 0x01010101 * next->bios.ramcfg_11_09); in gk104_ram_calc_sddr3()
845 ram_mask(fuc, 0x10f824, mask, data); in gk104_ram_calc_sddr3()
846 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
852 ram_mask(fuc, 0x10f82c, 0x00100000, data); in gk104_ram_calc_sddr3()
855 ram_mask(fuc, 0x10f248, 0xffffffff, next->bios.timing[10]); in gk104_ram_calc_sddr3()
856 ram_mask(fuc, 0x10f290, 0xffffffff, next->bios.timing[0]); in gk104_ram_calc_sddr3()
857 ram_mask(fuc, 0x10f294, 0xffffffff, next->bios.timing[1]); in gk104_ram_calc_sddr3()
858 ram_mask(fuc, 0x10f298, 0xffffffff, next->bios.timing[2]); in gk104_ram_calc_sddr3()
859 ram_mask(fuc, 0x10f29c, 0xffffffff, next->bios.timing[3]); in gk104_ram_calc_sddr3()
860 ram_mask(fuc, 0x10f2a0, 0xffffffff, next->bios.timing[4]); in gk104_ram_calc_sddr3()
861 ram_mask(fuc, 0x10f2a4, 0xffffffff, next->bios.timing[5]); in gk104_ram_calc_sddr3()
862 ram_mask(fuc, 0x10f2a8, 0xffffffff, next->bios.timing[6]); in gk104_ram_calc_sddr3()
863 ram_mask(fuc, 0x10f2ac, 0xffffffff, next->bios.timing[7]); in gk104_ram_calc_sddr3()
864 ram_mask(fuc, 0x10f2cc, 0xffffffff, next->bios.timing[8]); in gk104_ram_calc_sddr3()
865 ram_mask(fuc, 0x10f2e8, 0xffffffff, next->bios.timing[9]); in gk104_ram_calc_sddr3()
890 ram_mask(fuc, 0x10f808, mask, data); in gk104_ram_calc_sddr3()
892 ram_wr32(fuc, 0x10f870, 0x11111111 * next->bios.ramcfg_11_03_0f); in gk104_ram_calc_sddr3()
894 ram_mask(fuc, 0x10f250, 0x000003f0, next->bios.timing_20_2c_003f << 4); in gk104_ram_calc_sddr3()
899 ram_mask(fuc, 0x10f24c, 0x7f000000, data << 24); in gk104_ram_calc_sddr3()
901 ram_mask(fuc, 0x10f224, 0x001f0000, next->bios.timing_20_30_f8 << 16); in gk104_ram_calc_sddr3()
903 ram_wr32(fuc, 0x10f090, 0x4000007f); in gk104_ram_calc_sddr3()
904 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
906 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */ in gk104_ram_calc_sddr3()
907 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ in gk104_ram_calc_sddr3()
908 ram_wr32(fuc, 0x10f210, 0x80000000); /* REFRESH_AUTO = 1 */ in gk104_ram_calc_sddr3()
909 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
912 ram_mask(fuc, mr[1], 0x1, 0x0); in gk104_ram_calc_sddr3()
913 nvkm_sddr3_dll_reset(fuc); in gk104_ram_calc_sddr3()
916 ram_mask(fuc, mr[2], 0x00000fff, ram->base.mr[2]); in gk104_ram_calc_sddr3()
917 ram_mask(fuc, mr[1], 0xffffffff, ram->base.mr[1]); in gk104_ram_calc_sddr3()
918 ram_wr32(fuc, mr[0], ram->base.mr[0]); in gk104_ram_calc_sddr3()
919 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
922 nvkm_sddr3_dll_reset(fuc); in gk104_ram_calc_sddr3()
923 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
926 if (vc == 0 && ram_have(fuc, gpio2E)) { in gk104_ram_calc_sddr3()
927 u32 temp = ram_mask(fuc, gpio2E, 0x3000, fuc->r_func2E[0]); in gk104_ram_calc_sddr3()
928 if (temp != ram_rd32(fuc, gpio2E)) { in gk104_ram_calc_sddr3()
929 ram_wr32(fuc, gpiotrig, 1); in gk104_ram_calc_sddr3()
930 ram_nsec(fuc, 20000); in gk104_ram_calc_sddr3()
935 ram_mask(fuc, 0x10f830, 0x01000000, 0x01000000); in gk104_ram_calc_sddr3()
936 ram_mask(fuc, 0x10f830, 0x01000000, 0x00000000); in gk104_ram_calc_sddr3()
939 ram_mask(fuc, 0x10f200, 0x80000000, 0x80000000); in gk104_ram_calc_sddr3()
940 ram_wr32(fuc, 0x10f318, 0x00000001); /* NOP? */ in gk104_ram_calc_sddr3()
941 ram_mask(fuc, 0x10f200, 0x80000000, 0x00000000); in gk104_ram_calc_sddr3()
942 ram_nsec(fuc, 1000); in gk104_ram_calc_sddr3()
944 ram_unblock(fuc); in gk104_ram_calc_sddr3()
947 ram_wr32(fuc, 0x62c000, 0x0f0f0f00); in gk104_ram_calc_sddr3()
953 ram_mask(fuc, 0x10f200, 0x00000800, data); in gk104_ram_calc_sddr3()
1043 struct gk104_ramfuc *fuc = &ram->fuc; in gk104_ram_calc_xits() local
1048 ret = ram_init(fuc, ram->base.fb); in gk104_ram_calc_xits()
1052 ram->mode = (next->freq > fuc->refpll.vco1.max_freq) ? 2 : 1; in gk104_ram_calc_xits()
1053 ram->from = ram_rd32(fuc, 0x1373f4) & 0x0000000f; in gk104_ram_calc_xits()
1068 fuc->mempll.refclk = ret; in gk104_ram_calc_xits()
1077 ret = gt215_pll_calc(subdev, &fuc->refpll, refclk, &ram->N1, in gk104_ram_calc_xits()
1079 fuc->mempll.refclk = ret; in gk104_ram_calc_xits()
1086 for (i = 0; i < ARRAY_SIZE(fuc->r_mr); i++) { in gk104_ram_calc_xits()
1087 if (ram_have(fuc, mr[i])) in gk104_ram_calc_xits()
1088 ram->base.mr[i] = ram_rd32(fuc, mr[i]); in gk104_ram_calc_xits()
1234 struct gk104_ramfuc *fuc = &ram->fuc; in gk104_ram_prog() local
1239 ram_exec(fuc, false); in gk104_ram_prog()
1244 ram_exec(fuc, true); in gk104_ram_prog()
1255 ram_exec(&ram->fuc, false); in gk104_ram_tidy()
1582 ret = nvbios_pll_parse(bios, 0x0c, &ram->fuc.refpll); in gk104_ram_new_()
1588 ret = nvbios_pll_parse(bios, 0x04, &ram->fuc.mempll); in gk104_ram_new_()
1597 ram->fuc.r_gpioMV = ramfuc_reg(0x00d610 + (gpio.line * 0x04)); in gk104_ram_new_()
1598 ram->fuc.r_funcMV[0] = (gpio.log[0] ^ 2) << 12; in gk104_ram_new_()
1599 ram->fuc.r_funcMV[1] = (gpio.log[1] ^ 2) << 12; in gk104_ram_new_()
1604 ram->fuc.r_gpio2E = ramfuc_reg(0x00d610 + (gpio.line * 0x04)); in gk104_ram_new_()
1605 ram->fuc.r_func2E[0] = (gpio.log[0] ^ 2) << 12; in gk104_ram_new_()
1606 ram->fuc.r_func2E[1] = (gpio.log[1] ^ 2) << 12; in gk104_ram_new_()
1609 ram->fuc.r_gpiotrig = ramfuc_reg(0x00d604); in gk104_ram_new_()
1611 ram->fuc.r_0x132020 = ramfuc_reg(0x132020); in gk104_ram_new_()
1612 ram->fuc.r_0x132028 = ramfuc_reg(0x132028); in gk104_ram_new_()
1613 ram->fuc.r_0x132024 = ramfuc_reg(0x132024); in gk104_ram_new_()
1614 ram->fuc.r_0x132030 = ramfuc_reg(0x132030); in gk104_ram_new_()
1615 ram->fuc.r_0x132034 = ramfuc_reg(0x132034); in gk104_ram_new_()
1616 ram->fuc.r_0x132000 = ramfuc_reg(0x132000); in gk104_ram_new_()
1617 ram->fuc.r_0x132004 = ramfuc_reg(0x132004); in gk104_ram_new_()
1618 ram->fuc.r_0x132040 = ramfuc_reg(0x132040); in gk104_ram_new_()
1620 ram->fuc.r_0x10f248 = ramfuc_reg(0x10f248); in gk104_ram_new_()
1621 ram->fuc.r_0x10f290 = ramfuc_reg(0x10f290); in gk104_ram_new_()
1622 ram->fuc.r_0x10f294 = ramfuc_reg(0x10f294); in gk104_ram_new_()
1623 ram->fuc.r_0x10f298 = ramfuc_reg(0x10f298); in gk104_ram_new_()
1624 ram->fuc.r_0x10f29c = ramfuc_reg(0x10f29c); in gk104_ram_new_()
1625 ram->fuc.r_0x10f2a0 = ramfuc_reg(0x10f2a0); in gk104_ram_new_()
1626 ram->fuc.r_0x10f2a4 = ramfuc_reg(0x10f2a4); in gk104_ram_new_()
1627 ram->fuc.r_0x10f2a8 = ramfuc_reg(0x10f2a8); in gk104_ram_new_()
1628 ram->fuc.r_0x10f2ac = ramfuc_reg(0x10f2ac); in gk104_ram_new_()
1629 ram->fuc.r_0x10f2cc = ramfuc_reg(0x10f2cc); in gk104_ram_new_()
1630 ram->fuc.r_0x10f2e8 = ramfuc_reg(0x10f2e8); in gk104_ram_new_()
1631 ram->fuc.r_0x10f250 = ramfuc_reg(0x10f250); in gk104_ram_new_()
1632 ram->fuc.r_0x10f24c = ramfuc_reg(0x10f24c); in gk104_ram_new_()
1633 ram->fuc.r_0x10fec4 = ramfuc_reg(0x10fec4); in gk104_ram_new_()
1634 ram->fuc.r_0x10fec8 = ramfuc_reg(0x10fec8); in gk104_ram_new_()
1635 ram->fuc.r_0x10f604 = ramfuc_reg(0x10f604); in gk104_ram_new_()
1636 ram->fuc.r_0x10f614 = ramfuc_reg(0x10f614); in gk104_ram_new_()
1637 ram->fuc.r_0x10f610 = ramfuc_reg(0x10f610); in gk104_ram_new_()
1638 ram->fuc.r_0x100770 = ramfuc_reg(0x100770); in gk104_ram_new_()
1639 ram->fuc.r_0x100778 = ramfuc_reg(0x100778); in gk104_ram_new_()
1640 ram->fuc.r_0x10f224 = ramfuc_reg(0x10f224); in gk104_ram_new_()
1642 ram->fuc.r_0x10f870 = ramfuc_reg(0x10f870); in gk104_ram_new_()
1643 ram->fuc.r_0x10f698 = ramfuc_reg(0x10f698); in gk104_ram_new_()
1644 ram->fuc.r_0x10f694 = ramfuc_reg(0x10f694); in gk104_ram_new_()
1645 ram->fuc.r_0x10f6b8 = ramfuc_reg(0x10f6b8); in gk104_ram_new_()
1646 ram->fuc.r_0x10f808 = ramfuc_reg(0x10f808); in gk104_ram_new_()
1647 ram->fuc.r_0x10f670 = ramfuc_reg(0x10f670); in gk104_ram_new_()
1648 ram->fuc.r_0x10f60c = ramfuc_reg(0x10f60c); in gk104_ram_new_()
1649 ram->fuc.r_0x10f830 = ramfuc_reg(0x10f830); in gk104_ram_new_()
1650 ram->fuc.r_0x1373ec = ramfuc_reg(0x1373ec); in gk104_ram_new_()
1651 ram->fuc.r_0x10f800 = ramfuc_reg(0x10f800); in gk104_ram_new_()
1652 ram->fuc.r_0x10f82c = ramfuc_reg(0x10f82c); in gk104_ram_new_()
1654 ram->fuc.r_0x10f978 = ramfuc_reg(0x10f978); in gk104_ram_new_()
1655 ram->fuc.r_0x10f910 = ramfuc_reg(0x10f910); in gk104_ram_new_()
1656 ram->fuc.r_0x10f914 = ramfuc_reg(0x10f914); in gk104_ram_new_()
1660 ram->fuc.r_mr[0] = ramfuc_reg(0x10f300); in gk104_ram_new_()
1661 ram->fuc.r_mr[1] = ramfuc_reg(0x10f330); in gk104_ram_new_()
1662 ram->fuc.r_mr[2] = ramfuc_reg(0x10f334); in gk104_ram_new_()
1663 ram->fuc.r_mr[3] = ramfuc_reg(0x10f338); in gk104_ram_new_()
1664 ram->fuc.r_mr[4] = ramfuc_reg(0x10f33c); in gk104_ram_new_()
1665 ram->fuc.r_mr[5] = ramfuc_reg(0x10f340); in gk104_ram_new_()
1666 ram->fuc.r_mr[6] = ramfuc_reg(0x10f344); in gk104_ram_new_()
1667 ram->fuc.r_mr[7] = ramfuc_reg(0x10f348); in gk104_ram_new_()
1668 ram->fuc.r_mr[8] = ramfuc_reg(0x10f354); in gk104_ram_new_()
1669 ram->fuc.r_mr[15] = ramfuc_reg(0x10f34c); in gk104_ram_new_()
1672 ram->fuc.r_mr[0] = ramfuc_reg(0x10f300); in gk104_ram_new_()
1673 ram->fuc.r_mr[1] = ramfuc_reg(0x10f304); in gk104_ram_new_()
1674 ram->fuc.r_mr[2] = ramfuc_reg(0x10f320); in gk104_ram_new_()
1680 ram->fuc.r_0x62c000 = ramfuc_reg(0x62c000); in gk104_ram_new_()
1681 ram->fuc.r_0x10f200 = ramfuc_reg(0x10f200); in gk104_ram_new_()
1682 ram->fuc.r_0x10f210 = ramfuc_reg(0x10f210); in gk104_ram_new_()
1683 ram->fuc.r_0x10f310 = ramfuc_reg(0x10f310); in gk104_ram_new_()
1684 ram->fuc.r_0x10f314 = ramfuc_reg(0x10f314); in gk104_ram_new_()
1685 ram->fuc.r_0x10f318 = ramfuc_reg(0x10f318); in gk104_ram_new_()
1686 ram->fuc.r_0x10f090 = ramfuc_reg(0x10f090); in gk104_ram_new_()
1687 ram->fuc.r_0x10f69c = ramfuc_reg(0x10f69c); in gk104_ram_new_()
1688 ram->fuc.r_0x10f824 = ramfuc_reg(0x10f824); in gk104_ram_new_()
1689 ram->fuc.r_0x1373f0 = ramfuc_reg(0x1373f0); in gk104_ram_new_()
1690 ram->fuc.r_0x1373f4 = ramfuc_reg(0x1373f4); in gk104_ram_new_()
1691 ram->fuc.r_0x137320 = ramfuc_reg(0x137320); in gk104_ram_new_()
1692 ram->fuc.r_0x10f65c = ramfuc_reg(0x10f65c); in gk104_ram_new_()
1693 ram->fuc.r_0x10f6bc = ramfuc_reg(0x10f6bc); in gk104_ram_new_()
1694 ram->fuc.r_0x100710 = ramfuc_reg(0x100710); in gk104_ram_new_()
1695 ram->fuc.r_0x100750 = ramfuc_reg(0x100750); in gk104_ram_new_()