Commit 0b0b78cd authored by Roy Spliet's avatar Roy Spliet Committed by Ben Skeggs

drm/nouveau/fb/ramgt215: Restructure r111100 calculation for DDR2

Seems to be mostly equal to DDR3 on < GT218, should improve stability for
DDR2 reclocks.
Signed-off-by: default avatarRoy Spliet <rspliet@eclipso.eu>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ef6e8f4c
...@@ -771,14 +771,21 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq) ...@@ -771,14 +771,21 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq)
unk71c = ram_rd32(fuc, 0x10071c) & ~0x00000100; unk71c = ram_rd32(fuc, 0x10071c) & ~0x00000100;
r111100 = ram_rd32(fuc, 0x111100) & ~0x3a800000; r111100 = ram_rd32(fuc, 0x111100) & ~0x3a800000;
/* NVA8 seems to skip various bits related to ramcfg_10_02_04 */
if (device->chipset == 0xa8) {
r111100 |= 0x08000000;
if (!next->bios.ramcfg_10_02_04)
unk714 |= 0x00000010;
} else {
if (next->bios.ramcfg_10_02_04) { if (next->bios.ramcfg_10_02_04) {
switch (ram->base.type) { switch (ram->base.type) {
case NVKM_RAM_TYPE_DDR3:
if (device->chipset != 0xa8)
r111100 |= 0x00000004;
/* no break */
case NVKM_RAM_TYPE_DDR2: case NVKM_RAM_TYPE_DDR2:
r111100 |= 0x08000000; case NVKM_RAM_TYPE_DDR3:
r111100 &= ~0x00000020;
if (next->bios.ramcfg_10_02_10)
r111100 |= 0x08000004;
else
r111100 |= 0x00000024;
break; break;
default: default:
break; break;
...@@ -786,16 +793,12 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq) ...@@ -786,16 +793,12 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq)
} else { } else {
switch (ram->base.type) { switch (ram->base.type) {
case NVKM_RAM_TYPE_DDR2: case NVKM_RAM_TYPE_DDR2:
r111100 |= 0x1a800000;
unk714 |= 0x00000010;
break;
case NVKM_RAM_TYPE_DDR3: case NVKM_RAM_TYPE_DDR3:
if (device->chipset == 0xa8) { r111100 &= ~0x00000024;
r111100 |= 0x08000000;
} else {
r111100 &= ~0x00000004;
r111100 |= 0x12800000; r111100 |= 0x12800000;
}
if (next->bios.ramcfg_10_02_10)
r111100 |= 0x08000000;
unk714 |= 0x00000010; unk714 |= 0x00000010;
break; break;
case NVKM_RAM_TYPE_GDDR3: case NVKM_RAM_TYPE_GDDR3:
...@@ -806,6 +809,7 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq) ...@@ -806,6 +809,7 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq)
break; break;
} }
} }
}
unk714 |= (next->bios.ramcfg_10_04_01) << 8; unk714 |= (next->bios.ramcfg_10_04_01) << 8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment