Lines Matching refs:fuc

95 	struct gt215_ramfuc fuc;  member
157 struct gt215_ramfuc *fuc = &ram->fuc; in gt215_link_train() local
207 r1700 = ram_rd32(fuc, 0x001700); in gt215_link_train()
209 ram_mask(fuc, 0x100200, 0x00000800, 0x00000000); in gt215_link_train()
210 ram_wr32(fuc, 0x611200, 0x3300); in gt215_link_train()
211 ram_wait_vblank(fuc); in gt215_link_train()
212 ram_wait(fuc, 0x611200, 0x00000003, 0x00000000, 500000); in gt215_link_train()
213 ram_mask(fuc, 0x001610, 0x00000083, 0x00000003); in gt215_link_train()
214 ram_mask(fuc, 0x100080, 0x00000020, 0x00000000); in gt215_link_train()
215 ram_mask(fuc, 0x10f804, 0x80000000, 0x00000000); in gt215_link_train()
216 ram_wr32(fuc, 0x001700, 0x00000000); in gt215_link_train()
218 ram_train(fuc); in gt215_link_train()
221 ram_mask(fuc, 0x10f804, 0x80000000, 0x80000000); in gt215_link_train()
222 ram_wr32(fuc, 0x10053c, 0x0); in gt215_link_train()
223 ram_wr32(fuc, 0x100720, train->r_100720); in gt215_link_train()
224 ram_wr32(fuc, 0x1111e0, train->r_1111e0); in gt215_link_train()
225 ram_wr32(fuc, 0x111400, train->r_111400); in gt215_link_train()
226 ram_nuke(fuc, 0x100080); in gt215_link_train()
227 ram_mask(fuc, 0x100080, 0x00000020, 0x00000020); in gt215_link_train()
228 ram_nsec(fuc, 1000); in gt215_link_train()
230 ram_wr32(fuc, 0x001700, r1700); in gt215_link_train()
231 ram_mask(fuc, 0x001610, 0x00000083, 0x00000080); in gt215_link_train()
232 ram_wr32(fuc, 0x611200, 0x3330); in gt215_link_train()
233 ram_mask(fuc, 0x100200, 0x00000800, 0x00000800); in gt215_link_train()
235 ram_exec(fuc, true); in gt215_link_train()
238 ram_exec(fuc, true); in gt215_link_train()
424 nvkm_sddr2_dll_reset(struct gt215_ramfuc *fuc) in nvkm_sddr2_dll_reset() argument
426 ram_mask(fuc, mr[0], 0x100, 0x100); in nvkm_sddr2_dll_reset()
427 ram_nsec(fuc, 1000); in nvkm_sddr2_dll_reset()
428 ram_mask(fuc, mr[0], 0x100, 0x000); in nvkm_sddr2_dll_reset()
429 ram_nsec(fuc, 1000); in nvkm_sddr2_dll_reset()
433 nvkm_sddr3_dll_disable(struct gt215_ramfuc *fuc, u32 *mr) in nvkm_sddr3_dll_disable() argument
435 u32 mr1_old = ram_rd32(fuc, mr[1]); in nvkm_sddr3_dll_disable()
438 ram_wr32(fuc, 0x1002d4, 0x00000001); in nvkm_sddr3_dll_disable()
439 ram_wr32(fuc, mr[1], mr[1]); in nvkm_sddr3_dll_disable()
440 ram_nsec(fuc, 1000); in nvkm_sddr3_dll_disable()
445 nvkm_gddr3_dll_disable(struct gt215_ramfuc *fuc, u32 *mr) in nvkm_gddr3_dll_disable() argument
447 u32 mr1_old = ram_rd32(fuc, mr[1]); in nvkm_gddr3_dll_disable()
450 ram_wr32(fuc, mr[1], mr[1]); in nvkm_gddr3_dll_disable()
451 ram_nsec(fuc, 1000); in nvkm_gddr3_dll_disable()
456 gt215_ram_lock_pll(struct gt215_ramfuc *fuc, struct gt215_clk_info *mclk) in gt215_ram_lock_pll() argument
458 ram_wr32(fuc, 0x004004, mclk->pll); in gt215_ram_lock_pll()
459 ram_mask(fuc, 0x004000, 0x00000001, 0x00000001); in gt215_ram_lock_pll()
460 ram_mask(fuc, 0x004000, 0x00000010, 0x00000000); in gt215_ram_lock_pll()
461 ram_wait(fuc, 0x004000, 0x00020000, 0x00020000, 64000); in gt215_ram_lock_pll()
462 ram_mask(fuc, 0x004000, 0x00000010, 0x00000010); in gt215_ram_lock_pll()
466 gt215_ram_gpio(struct gt215_ramfuc *fuc, u8 tag, u32 val) in gt215_ram_gpio() argument
468 struct nvkm_gpio *gpio = fuc->base.fb->subdev.device->gpio; in gt215_ram_gpio()
480 gpio_val = ram_rd32(fuc, gpio[reg]); in gt215_ram_gpio()
486 ram_mask(fuc, gpio[reg], (0x3 << sh), ((val | 0x2) << sh)); in gt215_ram_gpio()
487 ram_nsec(fuc, 20000); in gt215_ram_gpio()
495 struct gt215_ramfuc *fuc = &ram->fuc; in gt215_ram_calc() local
559 ret = ram_init(fuc, ram->base.fb); in gt215_ram_calc()
564 ram->base.mr[0] = ram_rd32(fuc, mr[0]); in gt215_ram_calc()
565 ram->base.mr[1] = ram_rd32(fuc, mr[1]); in gt215_ram_calc()
566 ram->base.mr[2] = ram_rd32(fuc, mr[2]); in gt215_ram_calc()
601 ctrl = ram_rd32(fuc, 0x004000); in gt215_ram_calc()
606 ram_mask(fuc, 0x111104, 0x00000600, 0x00000000); in gt215_ram_calc()
608 ram_mask(fuc, 0x111100, 0x40000000, 0x40000000); in gt215_ram_calc()
609 ram_mask(fuc, 0x111104, 0x00000180, 0x00000000); in gt215_ram_calc()
612 ram_mask(fuc, 0x100200, 0x00000800, 0x00000000); in gt215_ram_calc()
616 ram_mask(fuc, 0x004128, 0x003f3141, mclk.clk | 0x00000101); in gt215_ram_calc()
617 gt215_ram_lock_pll(fuc, &mclk); in gt215_ram_calc()
621 ram_wait_vblank(fuc); in gt215_ram_calc()
622 ram_wr32(fuc, 0x611200, 0x3300); in gt215_ram_calc()
623 ram_mask(fuc, 0x002504, 0x1, 0x1); in gt215_ram_calc()
624 ram_nsec(fuc, 10000); in gt215_ram_calc()
625 ram_wait(fuc, 0x002504, 0x10, 0x10, 20000); /* XXX: or longer? */ in gt215_ram_calc()
626 ram_block(fuc); in gt215_ram_calc()
627 ram_nsec(fuc, 2000); in gt215_ram_calc()
631 ram_mask(fuc, 0x111100, 0x04020000, 0x00020000); in gt215_ram_calc()
633 ram_mask(fuc, 0x111100, 0x04020000, 0x04020000); in gt215_ram_calc()
639 nvkm_sddr3_dll_disable(fuc, ram->base.mr); in gt215_ram_calc()
642 nvkm_gddr3_dll_disable(fuc, ram->base.mr); in gt215_ram_calc()
647 gt215_ram_gpio(fuc, 0x2e, 1); in gt215_ram_calc()
650 ram_wr32(fuc, 0x1002d4, 0x00000001); in gt215_ram_calc()
651 ram_wr32(fuc, 0x1002d0, 0x00000001); in gt215_ram_calc()
652 ram_wr32(fuc, 0x1002d0, 0x00000001); in gt215_ram_calc()
653 ram_wr32(fuc, 0x100210, 0x00000000); in gt215_ram_calc()
654 ram_wr32(fuc, 0x1002dc, 0x00000001); in gt215_ram_calc()
655 ram_nsec(fuc, 2000); in gt215_ram_calc()
658 ram_mask(fuc, 0x100700, 0x00000006, 0x00000006); in gt215_ram_calc()
664 data = ram_rd32(fuc, 0x004000) & 0x9; in gt215_ram_calc()
667 ram_mask(fuc, 0x004000, 0x8, 0x8); in gt215_ram_calc()
669 ram_mask(fuc, 0x004000, 0x1, 0x0); in gt215_ram_calc()
671 gt215_ram_gpio(fuc, 0x18, !next->bios.ramcfg_FBVDDQ); in gt215_ram_calc()
674 ram_mask(fuc, 0x004000, 0x1, 0x1); in gt215_ram_calc()
686 ram_mask(fuc, 0x004000, 0x00000004, 0x00000004); in gt215_ram_calc()
687 ram_mask(fuc, 0x004168, 0x003f3141, 0x00083101); in gt215_ram_calc()
688 ram_mask(fuc, 0x004000, 0x00000008, 0x00000008); in gt215_ram_calc()
689 ram_mask(fuc, 0x1110e0, 0x00088000, 0x00088000); in gt215_ram_calc()
690 ram_wr32(fuc, 0x004018, 0x00001000); in gt215_ram_calc()
691 gt215_ram_lock_pll(fuc, &mclk); in gt215_ram_calc()
695 ram_mask(fuc, 0x004000, 0x00000105, 0x00000105); in gt215_ram_calc()
696 ram_wr32(fuc, 0x004018, 0x00001000 | r004018); in gt215_ram_calc()
697 ram_wr32(fuc, 0x100da0, r100da0); in gt215_ram_calc()
699 ram_mask(fuc, 0x004168, 0x003f3141, mclk.clk | 0x00000101); in gt215_ram_calc()
700 ram_mask(fuc, 0x004000, 0x00000108, 0x00000008); in gt215_ram_calc()
701 ram_mask(fuc, 0x1110e0, 0x00088000, 0x00088000); in gt215_ram_calc()
702 ram_wr32(fuc, 0x004018, 0x00009000 | r004018); in gt215_ram_calc()
703 ram_wr32(fuc, 0x100da0, r100da0); in gt215_ram_calc()
705 ram_nsec(fuc, 20000); in gt215_ram_calc()
708 ram_wr32(fuc, 0x1005a0, next->bios.ramcfg_10_06 << 16 | in gt215_ram_calc()
711 ram_wr32(fuc, 0x1005a4, next->bios.ramcfg_10_08 << 8 | in gt215_ram_calc()
713 ram_wr32(fuc, 0x10f804, next->bios.ramcfg_10_09_f0 << 20 | in gt215_ram_calc()
717 ram_mask(fuc, 0x10053c, 0x00001000, 0x00000000); in gt215_ram_calc()
720 ram_wr32(fuc, 0x100080, 0x1020); in gt215_ram_calc()
721 ram_mask(fuc, 0x111400, 0xffffffff, train->r_111400); in gt215_ram_calc()
722 ram_mask(fuc, 0x1111e0, 0xffffffff, train->r_1111e0); in gt215_ram_calc()
723 ram_mask(fuc, 0x100720, 0xffffffff, train->r_100720); in gt215_ram_calc()
725 ram_mask(fuc, 0x10053c, 0x00001000, 0x00001000); in gt215_ram_calc()
726 ram_mask(fuc, 0x10f804, 0x80000000, 0x00000000); in gt215_ram_calc()
727 ram_mask(fuc, 0x100760, 0x22222222, r100760); in gt215_ram_calc()
728 ram_mask(fuc, 0x1007a0, 0x22222222, r100760); in gt215_ram_calc()
729 ram_mask(fuc, 0x1007e0, 0x22222222, r100760); in gt215_ram_calc()
733 ram_mask(fuc, 0x100700, 0x00000006, 0x00000000); in gt215_ram_calc()
738 ram_mask(fuc, 0x1110e0, 0x00088000, 0x00011000); in gt215_ram_calc()
739 ram_mask(fuc, 0x004000, 0x00000008, 0x00000000); in gt215_ram_calc()
742 ram_wr32(fuc, 0x1002dc, 0x00000000); in gt215_ram_calc()
743 ram_wr32(fuc, 0x1002d4, 0x00000001); in gt215_ram_calc()
744 ram_wr32(fuc, 0x100210, 0x80000000); in gt215_ram_calc()
745 ram_nsec(fuc, 2000); in gt215_ram_calc()
749 if (ram_rd32(fuc, mr[i]) != ram->base.mr[i]) { in gt215_ram_calc()
750 ram_wr32(fuc, mr[i], ram->base.mr[i]); in gt215_ram_calc()
751 ram_nsec(fuc, 1000); in gt215_ram_calc()
755 ram_wr32(fuc, 0x100220[3], timing[3]); in gt215_ram_calc()
756 ram_wr32(fuc, 0x100220[1], timing[1]); in gt215_ram_calc()
757 ram_wr32(fuc, 0x100220[6], timing[6]); in gt215_ram_calc()
758 ram_wr32(fuc, 0x100220[7], timing[7]); in gt215_ram_calc()
759 ram_wr32(fuc, 0x100220[2], timing[2]); in gt215_ram_calc()
760 ram_wr32(fuc, 0x100220[4], timing[4]); in gt215_ram_calc()
761 ram_wr32(fuc, 0x100220[5], timing[5]); in gt215_ram_calc()
762 ram_wr32(fuc, 0x100220[0], timing[0]); in gt215_ram_calc()
763 ram_wr32(fuc, 0x100220[8], timing[8]); in gt215_ram_calc()
766 ram_mask(fuc, 0x100200, 0x00001000, !next->bios.ramcfg_10_02_08 << 12); in gt215_ram_calc()
769 unk714 = ram_rd32(fuc, 0x100714) & ~0xf0000130; in gt215_ram_calc()
770 unk718 = ram_rd32(fuc, 0x100718) & ~0x00000100; in gt215_ram_calc()
771 unk71c = ram_rd32(fuc, 0x10071c) & ~0x00000100; in gt215_ram_calc()
772 r111100 = ram_rd32(fuc, 0x111100) & ~0x3a800000; in gt215_ram_calc()
829 ram_mask(fuc, 0x100714, 0xffffffff, unk714); in gt215_ram_calc()
830 ram_mask(fuc, 0x10071c, 0xffffffff, unk71c); in gt215_ram_calc()
831 ram_mask(fuc, 0x100718, 0xffffffff, unk718); in gt215_ram_calc()
832 ram_mask(fuc, 0x111100, 0xffffffff, r111100); in gt215_ram_calc()
835 gt215_ram_gpio(fuc, 0x2e, 0); in gt215_ram_calc()
839 nvkm_sddr2_dll_reset(fuc); in gt215_ram_calc()
842 ram_nsec(fuc, 31000); in gt215_ram_calc()
844 ram_nsec(fuc, 14000); in gt215_ram_calc()
848 ram_wr32(fuc, 0x100264, 0x1); in gt215_ram_calc()
849 ram_nsec(fuc, 2000); in gt215_ram_calc()
852 ram_nuke(fuc, 0x100700); in gt215_ram_calc()
853 ram_mask(fuc, 0x100700, 0x01000000, 0x01000000); in gt215_ram_calc()
854 ram_mask(fuc, 0x100700, 0x01000000, 0x00000000); in gt215_ram_calc()
857 ram_unblock(fuc); in gt215_ram_calc()
858 ram_wr32(fuc, 0x611200, 0x3330); in gt215_ram_calc()
862 ram_mask(fuc, 0x100200, 0x00000800, 0x00000800); in gt215_ram_calc()
864 ram_mask(fuc, 0x111104, 0x00000180, 0x00000180); in gt215_ram_calc()
865 ram_mask(fuc, 0x111100, 0x40000000, 0x00000000); in gt215_ram_calc()
867 ram_mask(fuc, 0x111104, 0x00000600, 0x00000600); in gt215_ram_calc()
871 ram_mask(fuc, 0x004168, 0x00000001, 0x00000000); in gt215_ram_calc()
872 ram_mask(fuc, 0x004168, 0x00000100, 0x00000000); in gt215_ram_calc()
874 ram_mask(fuc, 0x004000, 0x00000001, 0x00000000); in gt215_ram_calc()
875 ram_mask(fuc, 0x004128, 0x00000001, 0x00000000); in gt215_ram_calc()
876 ram_mask(fuc, 0x004128, 0x00000100, 0x00000000); in gt215_ram_calc()
886 struct gt215_ramfuc *fuc = &ram->fuc; in gt215_ram_prog() local
893 ram_exec(fuc, true); in gt215_ram_prog()
902 ram_exec(fuc, false); in gt215_ram_prog()
911 ram_exec(&ram->fuc, false); in gt215_ram_tidy()
953 ram->fuc.r_0x001610 = ramfuc_reg(0x001610); in gt215_ram_new()
954 ram->fuc.r_0x001700 = ramfuc_reg(0x001700); in gt215_ram_new()
955 ram->fuc.r_0x002504 = ramfuc_reg(0x002504); in gt215_ram_new()
956 ram->fuc.r_0x004000 = ramfuc_reg(0x004000); in gt215_ram_new()
957 ram->fuc.r_0x004004 = ramfuc_reg(0x004004); in gt215_ram_new()
958 ram->fuc.r_0x004018 = ramfuc_reg(0x004018); in gt215_ram_new()
959 ram->fuc.r_0x004128 = ramfuc_reg(0x004128); in gt215_ram_new()
960 ram->fuc.r_0x004168 = ramfuc_reg(0x004168); in gt215_ram_new()
961 ram->fuc.r_0x100080 = ramfuc_reg(0x100080); in gt215_ram_new()
962 ram->fuc.r_0x100200 = ramfuc_reg(0x100200); in gt215_ram_new()
963 ram->fuc.r_0x100210 = ramfuc_reg(0x100210); in gt215_ram_new()
965 ram->fuc.r_0x100220[i] = ramfuc_reg(0x100220 + (i * 4)); in gt215_ram_new()
966 ram->fuc.r_0x100264 = ramfuc_reg(0x100264); in gt215_ram_new()
967 ram->fuc.r_0x1002d0 = ramfuc_reg(0x1002d0); in gt215_ram_new()
968 ram->fuc.r_0x1002d4 = ramfuc_reg(0x1002d4); in gt215_ram_new()
969 ram->fuc.r_0x1002dc = ramfuc_reg(0x1002dc); in gt215_ram_new()
970 ram->fuc.r_0x10053c = ramfuc_reg(0x10053c); in gt215_ram_new()
971 ram->fuc.r_0x1005a0 = ramfuc_reg(0x1005a0); in gt215_ram_new()
972 ram->fuc.r_0x1005a4 = ramfuc_reg(0x1005a4); in gt215_ram_new()
973 ram->fuc.r_0x100700 = ramfuc_reg(0x100700); in gt215_ram_new()
974 ram->fuc.r_0x100714 = ramfuc_reg(0x100714); in gt215_ram_new()
975 ram->fuc.r_0x100718 = ramfuc_reg(0x100718); in gt215_ram_new()
976 ram->fuc.r_0x10071c = ramfuc_reg(0x10071c); in gt215_ram_new()
977 ram->fuc.r_0x100720 = ramfuc_reg(0x100720); in gt215_ram_new()
978 ram->fuc.r_0x100760 = ramfuc_stride(0x100760, 4, ram->base.part_mask); in gt215_ram_new()
979 ram->fuc.r_0x1007a0 = ramfuc_stride(0x1007a0, 4, ram->base.part_mask); in gt215_ram_new()
980 ram->fuc.r_0x1007e0 = ramfuc_stride(0x1007e0, 4, ram->base.part_mask); in gt215_ram_new()
981 ram->fuc.r_0x100da0 = ramfuc_stride(0x100da0, 4, ram->base.part_mask); in gt215_ram_new()
982 ram->fuc.r_0x10f804 = ramfuc_reg(0x10f804); in gt215_ram_new()
983 ram->fuc.r_0x1110e0 = ramfuc_stride(0x1110e0, 4, ram->base.part_mask); in gt215_ram_new()
984 ram->fuc.r_0x111100 = ramfuc_reg(0x111100); in gt215_ram_new()
985 ram->fuc.r_0x111104 = ramfuc_reg(0x111104); in gt215_ram_new()
986 ram->fuc.r_0x1111e0 = ramfuc_reg(0x1111e0); in gt215_ram_new()
987 ram->fuc.r_0x111400 = ramfuc_reg(0x111400); in gt215_ram_new()
988 ram->fuc.r_0x611200 = ramfuc_reg(0x611200); in gt215_ram_new()
991 ram->fuc.r_mr[0] = ramfuc_reg2(0x1002c0, 0x1002c8); in gt215_ram_new()
992 ram->fuc.r_mr[1] = ramfuc_reg2(0x1002c4, 0x1002cc); in gt215_ram_new()
993 ram->fuc.r_mr[2] = ramfuc_reg2(0x1002e0, 0x1002e8); in gt215_ram_new()
994 ram->fuc.r_mr[3] = ramfuc_reg2(0x1002e4, 0x1002ec); in gt215_ram_new()
996 ram->fuc.r_mr[0] = ramfuc_reg(0x1002c0); in gt215_ram_new()
997 ram->fuc.r_mr[1] = ramfuc_reg(0x1002c4); in gt215_ram_new()
998 ram->fuc.r_mr[2] = ramfuc_reg(0x1002e0); in gt215_ram_new()
999 ram->fuc.r_mr[3] = ramfuc_reg(0x1002e4); in gt215_ram_new()
1001 ram->fuc.r_gpio[0] = ramfuc_reg(0x00e104); in gt215_ram_new()
1002 ram->fuc.r_gpio[1] = ramfuc_reg(0x00e108); in gt215_ram_new()
1003 ram->fuc.r_gpio[2] = ramfuc_reg(0x00e120); in gt215_ram_new()
1004 ram->fuc.r_gpio[3] = ramfuc_reg(0x00e124); in gt215_ram_new()