diff options
author | Roy Spliet <rspliet@eclipso.eu> | 2015-09-30 00:23:47 +0100 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-10-22 09:11:28 +1000 |
commit | 280c4942388c8636ad7608d69ae6b4785e5da059 (patch) | |
tree | 3f190f1080d75387afbc2c4b944fea6f3df91b76 /drm/nouveau/nvkm/subdev/fb | |
parent | 83c9dcec79df0a9cb585161e8d111aeb9648d30c (diff) | |
download | nouveau-280c4942388c8636ad7608d69ae6b4785e5da059.tar.gz |
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: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drm/nouveau/nvkm/subdev/fb')
-rw-r--r-- | drm/nouveau/nvkm/subdev/fb/ramgt215.c | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/drm/nouveau/nvkm/subdev/fb/ramgt215.c b/drm/nouveau/nvkm/subdev/fb/ramgt215.c index 8d81bf1e9..d15ea886d 100644 --- a/drm/nouveau/nvkm/subdev/fb/ramgt215.c +++ b/drm/nouveau/nvkm/subdev/fb/ramgt215.c @@ -771,39 +771,43 @@ gt215_ram_calc(struct nvkm_ram *base, u32 freq) unk71c = ram_rd32(fuc, 0x10071c) & ~0x00000100; r111100 = ram_rd32(fuc, 0x111100) & ~0x3a800000; - if (next->bios.ramcfg_10_02_04) { - switch (ram->base.type) { - case NVKM_RAM_TYPE_DDR3: - if (device->chipset != 0xa8) - r111100 |= 0x00000004; - /* no break */ - case NVKM_RAM_TYPE_DDR2: - r111100 |= 0x08000000; - break; - default: - break; - } - } else { - switch (ram->base.type) { - case NVKM_RAM_TYPE_DDR2: - r111100 |= 0x1a800000; + /* 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; - break; - case NVKM_RAM_TYPE_DDR3: - if (device->chipset == 0xa8) { - r111100 |= 0x08000000; - } else { - r111100 &= ~0x00000004; + } else { + if (next->bios.ramcfg_10_02_04) { + switch (ram->base.type) { + case NVKM_RAM_TYPE_DDR2: + case NVKM_RAM_TYPE_DDR3: + r111100 &= ~0x00000020; + if (next->bios.ramcfg_10_02_10) + r111100 |= 0x08000004; + else + r111100 |= 0x00000024; + break; + default: + break; + } + } else { + switch (ram->base.type) { + case NVKM_RAM_TYPE_DDR2: + case NVKM_RAM_TYPE_DDR3: + r111100 &= ~0x00000024; r111100 |= 0x12800000; + + if (next->bios.ramcfg_10_02_10) + r111100 |= 0x08000000; + unk714 |= 0x00000010; + break; + case NVKM_RAM_TYPE_GDDR3: + r111100 |= 0x30000000; + unk714 |= 0x00000020; + break; + default: + break; } - unk714 |= 0x00000010; - break; - case NVKM_RAM_TYPE_GDDR3: - r111100 |= 0x30000000; - unk714 |= 0x00000020; - break; - default: - break; } } |