[02/13] nvkm/ramnv50: Split up various ramcfg bytes in nibbles

Submitted by Roy Spliet on April 10, 2017, 7:50 p.m.

Details

Message ID 20170410195050.29638-3-nouveau@spliet.org
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Roy Spliet April 10, 2017, 7:50 p.m.
In preparation for Fermi

Signed-off-by: Roy Spliet <nouveau@spliet.org>
---
 drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h |  9 ++++++---
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c         |  9 ++++++---
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c         | 12 ++++++++----
 3 files changed, 20 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

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 d8a7c04..4560a52 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
@@ -66,9 +66,12 @@  struct nvbios_ramcfg {
 			unsigned ramcfg_10_02_20:1;
 			unsigned ramcfg_10_03_0f:4;
 			unsigned ramcfg_10_04_01:1;
-			unsigned ramcfg_10_05:8;
-			unsigned ramcfg_10_06:8;
-			unsigned ramcfg_10_07:8;
+			unsigned ramcfg_10_05_0f:4;
+			unsigned ramcfg_10_05_f0:8;
+			unsigned ramcfg_10_06_0f:4;
+			unsigned ramcfg_10_06_f0:4;
+			unsigned ramcfg_10_07_0f:4;
+			unsigned ramcfg_10_07_f0:4;
 			unsigned ramcfg_10_08:8;
 			unsigned ramcfg_10_09_0f:4;
 			unsigned ramcfg_10_09_f0:4;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c
index b57c370..131d967 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/rammap.c
@@ -207,9 +207,12 @@  nvbios_rammapSp(struct nvkm_bios *bios, u32 data,
 		p->ramcfg_10_03_0f = (nvbios_rd08(bios, data + 0x03) & 0x0f) >> 0;
 		p->ramcfg_10_04_01 = (nvbios_rd08(bios, data + 0x04) & 0x01) >> 0;
 		p->ramcfg_FBVDDQ   = (nvbios_rd08(bios, data + 0x04) & 0x08) >> 3;
-		p->ramcfg_10_05    = (nvbios_rd08(bios, data + 0x05) & 0xff) >> 0;
-		p->ramcfg_10_06    = (nvbios_rd08(bios, data + 0x06) & 0xff) >> 0;
-		p->ramcfg_10_07    = (nvbios_rd08(bios, data + 0x07) & 0xff) >> 0;
+		p->ramcfg_10_05_0f = (nvbios_rd08(bios, data + 0x05) & 0x0f) >> 0;
+		p->ramcfg_10_05_f0 = (nvbios_rd08(bios, data + 0x05) & 0xf0) >> 4;
+		p->ramcfg_10_06_0f = (nvbios_rd08(bios, data + 0x06) & 0x0f) >> 0;
+		p->ramcfg_10_06_f0 = (nvbios_rd08(bios, data + 0x06) & 0xf0) >> 4;
+		p->ramcfg_10_07_0f = (nvbios_rd08(bios, data + 0x07) & 0x0f) >> 0;
+		p->ramcfg_10_07_f0 = (nvbios_rd08(bios, data + 0x07) & 0xf0) >> 4;
 		p->ramcfg_10_08    = (nvbios_rd08(bios, data + 0x08) & 0xff) >> 0;
 		p->ramcfg_10_09_0f = (nvbios_rd08(bios, data + 0x09) & 0x0f) >> 0;
 		p->ramcfg_10_09_f0 = (nvbios_rd08(bios, data + 0x09) & 0xf0) >> 4;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
index dd80de1..8454899 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
@@ -705,11 +705,15 @@  gt215_ram_calc(struct nvkm_ram *base, u32 freq)
 	ram_nsec(fuc, 20000);
 
 	if (next->bios.rammap_10_04_08) {
-		ram_wr32(fuc, 0x1005a0, next->bios.ramcfg_10_06 << 16 |
-					next->bios.ramcfg_10_05 << 8 |
-					next->bios.ramcfg_10_05);
+		ram_wr32(fuc, 0x1005a0, next->bios.ramcfg_10_06_f0 << 20 |
+					next->bios.ramcfg_10_06_0f << 16 |
+					next->bios.ramcfg_10_05_f0 << 12 |
+					next->bios.ramcfg_10_05_0f << 8 |
+					next->bios.ramcfg_10_05_f0 << 4 |
+					next->bios.ramcfg_10_05_0f);
 		ram_wr32(fuc, 0x1005a4, next->bios.ramcfg_10_08 << 8 |
-					next->bios.ramcfg_10_07);
+					next->bios.ramcfg_10_07_f0 << 4 |
+					next->bios.ramcfg_10_07_0f);
 		ram_wr32(fuc, 0x10f804, next->bios.ramcfg_10_09_f0 << 20 |
 					next->bios.ramcfg_10_03_0f << 16 |
 					next->bios.ramcfg_10_09_0f |