Lines Matching refs:ram
154 gt215_link_train(struct gt215_ram *ram) in gt215_link_train() argument
156 struct gt215_ltrain *train = &ram->ltrain; in gt215_link_train()
157 struct gt215_ramfuc *fuc = &ram->fuc; in gt215_link_train()
158 struct nvkm_subdev *subdev = &ram->base.fb->subdev; in gt215_link_train()
194 ret = ram->base.func->calc(&ram->base, (u32) M0205T.freq * 1000); in gt215_link_train()
237 ram->base.func->calc(&ram->base, clk_current); in gt215_link_train()
246 ram_train_result(ram->base.fb, result, 64); in gt215_link_train()
272 gt215_link_train_init(struct gt215_ram *ram) in gt215_link_train_init() argument
280 struct gt215_ltrain *train = &ram->ltrain; in gt215_link_train_init()
281 struct nvkm_device *device = ram->base.fb->subdev.device; in gt215_link_train_init()
302 true, true, &ram->ltrain.memory); in gt215_link_train_init()
306 addr = nvkm_memory_addr(ram->ltrain.memory); in gt215_link_train_init()
338 gt215_link_train_fini(struct gt215_ram *ram) in gt215_link_train_fini() argument
340 nvkm_memory_unref(&ram->ltrain.memory); in gt215_link_train_fini()
348 gt215_ram_timing_calc(struct gt215_ram *ram, u32 *timing) in gt215_ram_timing_calc() argument
350 struct nvbios_ramcfg *cfg = &ram->base.target.bios; in gt215_ram_timing_calc()
351 struct nvkm_subdev *subdev = &ram->base.fb->subdev; in gt215_ram_timing_calc()
362 switch ((!T(CWL)) * ram->base.type) { in gt215_ram_timing_calc()
403 switch (ram->base.type) { in gt215_ram_timing_calc()
494 struct gt215_ram *ram = gt215_ram(base); in gt215_ram_calc() local
495 struct gt215_ramfuc *fuc = &ram->fuc; in gt215_ram_calc()
496 struct gt215_ltrain *train = &ram->ltrain; in gt215_ram_calc()
497 struct nvkm_subdev *subdev = &ram->base.fb->subdev; in gt215_ram_calc()
511 next = &ram->base.target; in gt215_ram_calc()
513 ram->base.next = next; in gt215_ram_calc()
515 if (ram->ltrain.state == NVA3_TRAIN_ONCE) in gt215_ram_calc()
516 gt215_link_train(ram); in gt215_ram_calc()
557 gt215_ram_timing_calc(ram, timing); in gt215_ram_calc()
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()
568 switch (ram->base.type) { in gt215_ram_calc()
570 ret = nvkm_sddr2_calc(&ram->base); in gt215_ram_calc()
573 ret = nvkm_sddr3_calc(&ram->base); in gt215_ram_calc()
576 ret = nvkm_gddr3_calc(&ram->base); in gt215_ram_calc()
630 if (ram->base.type == NVKM_RAM_TYPE_GDDR3) in gt215_ram_calc()
637 switch (next->bios.ramcfg_DLLoff * ram->base.type) { 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()
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()
781 switch (ram->base.type) { in gt215_ram_calc()
794 switch (ram->base.type) { in gt215_ram_calc()
841 if (ram->base.type == NVKM_RAM_TYPE_GDDR3) { in gt215_ram_calc()
847 if (ram->base.type == NVKM_RAM_TYPE_DDR3) { in gt215_ram_calc()
885 struct gt215_ram *ram = gt215_ram(base); in gt215_ram_prog() local
886 struct gt215_ramfuc *fuc = &ram->fuc; in gt215_ram_prog()
887 struct nvkm_device *device = ram->base.fb->subdev.device; in gt215_ram_prog()
910 struct gt215_ram *ram = gt215_ram(base); in gt215_ram_tidy() local
911 ram_exec(&ram->fuc, false); in gt215_ram_tidy()
917 struct gt215_ram *ram = gt215_ram(base); in gt215_ram_init() local
918 gt215_link_train_init(ram); in gt215_ram_init()
925 struct gt215_ram *ram = gt215_ram(base); in gt215_ram_dtor() local
926 gt215_link_train_fini(ram); in gt215_ram_dtor()
927 return ram; in gt215_ram_dtor()
942 struct gt215_ram *ram; in gt215_ram_new() local
945 if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) in gt215_ram_new()
947 *pram = &ram->base; in gt215_ram_new()
949 ret = nv50_ram_ctor(>215_ram_func, fb, &ram->base); in gt215_ram_new()
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()
990 if (ram->base.ranks > 1) { 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()