Signed-off-by: Roy Spliet <rspl...@eclipso.eu>
---
 drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c         | 3 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/timing.c         | 2 ++
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c            | 6 ++++--
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h 
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
index 26e233a..3a9abd3 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
@@ -38,6 +38,7 @@ struct nvbios_ramcfg {
        unsigned ramcfg_hdr;
        unsigned ramcfg_timing;
        unsigned ramcfg_DLLoff;
+       unsigned ramcfg_RON;
        union {
                struct {
                        unsigned ramcfg_00_03_01:1;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c
index 8da8b26..5815f42 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c
@@ -164,12 +164,13 @@ nvbios_rammapSp_from_perf(struct nvkm_bios *bios, u32 
data, u8 size, int idx,
        if (size < 11)
                return NULL;
 
+       p->ramcfg_ver = 0;
        p->ramcfg_timing   =  nv_ro08(bios, data + 0x01);
        p->ramcfg_00_03_01 = (nv_ro08(bios, data + 0x03) & 0x01) >> 0;
        p->ramcfg_00_03_02 = (nv_ro08(bios, data + 0x03) & 0x02) >> 1;
        p->ramcfg_DLLoff   = (nv_ro08(bios, data + 0x03) & 0x04) >> 2;
        p->ramcfg_00_03_08 = (nv_ro08(bios, data + 0x03) & 0x08) >> 3;
-       p->ramcfg_00_03_10 = (nv_ro08(bios, data + 0x03) & 0x10) >> 4;
+       p->ramcfg_RON      = (nv_ro08(bios, data + 0x03) & 0x10) >> 3;
        p->ramcfg_00_04_02 = (nv_ro08(bios, data + 0x04) & 0x02) >> 1;
        p->ramcfg_00_04_04 = (nv_ro08(bios, data + 0x04) & 0x04) >> 2;
        p->ramcfg_00_04_20 = (nv_ro08(bios, data + 0x04) & 0x20) >> 5;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/timing.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/timing.c
index 763fd29..bacd433 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/timing.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/timing.c
@@ -102,6 +102,8 @@ nvbios_timingEp(struct nvkm_bios *bios, int idx,
                p->timing_10_RRD   = nv_ro08(bios, data + 0x0c);
                p->timing_10_13    = nv_ro08(bios, data + 0x0d);
                p->timing_10_ODT   = nv_ro08(bios, data + 0x0e) & 0x07;
+               if (p->ramcfg_ver >= 0x10)
+                       p->ramcfg_RON = nv_ro08(bios, data + 0x0e) & 0x07;
 
                p->timing_10_24  = 0xff;
                p->timing_10_21  = 0;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c
index e1d11f7..8d759f8a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c
@@ -70,7 +70,7 @@ ramgddr3_wr_lo[] = {
 int
 nvkm_gddr3_calc(struct nvkm_ram *ram)
 {
-       int CL, WR, CWL, DLL = 0, ODT = 0, hi;
+       int CL, WR, CWL, DLL = 0, ODT = 0, RON, hi;
 
        switch (ram->next->bios.timing_ver) {
        case 0x10:
@@ -79,6 +79,7 @@ nvkm_gddr3_calc(struct nvkm_ram *ram)
                WR  = ram->next->bios.timing_10_WR;
                DLL = !ram->next->bios.ramcfg_DLLoff;
                ODT = ram->next->bios.timing_10_ODT;
+               RON = ram->next->bios.ramcfg_RON;
                break;
        case 0x20:
                CWL = (ram->next->bios.timing[1] & 0x00000f80) >> 7;
@@ -89,6 +90,7 @@ nvkm_gddr3_calc(struct nvkm_ram *ram)
                ODT =  (ram->mr[1] & 0x004) >> 2 |
                       (ram->mr[1] & 0x040) >> 5 |
                       (ram->mr[1] & 0x200) >> 7;
+               RON = !(ram->mr[1] & 0x300) >> 8;
                break;
        default:
                return -ENOSYS;
@@ -107,7 +109,7 @@ nvkm_gddr3_calc(struct nvkm_ram *ram)
 
        ram->mr[1] &= ~0x3fc;
        ram->mr[1] |= (ODT & 0x03) << 2;
-       ram->mr[1] |= (ODT & 0x03) << 8;
+       ram->mr[1] |= (RON & 0x03) << 8;
        ram->mr[1] |= (WR  & 0x03) << 4;
        ram->mr[1] |= (WR  & 0x04) << 5;
        ram->mr[1] |= !DLL << 6;
-- 
2.1.0



_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to