Commit 64804a6d authored by Ben Skeggs's avatar Ben Skeggs

drm/gk104-/fb/ram: use parsed timing data in mr routines

All the other chipsets should be moved over to this too.  It's not needed
yet for the upcoming commits, so left this step as it'll conflict badly
with Roy's GT21x reclocking work.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent d9b5f261
...@@ -40,7 +40,7 @@ nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts) ...@@ -40,7 +40,7 @@ nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts)
int WL, CL, WR, at[2], dt, ds; int WL, CL, WR, at[2], dt, ds;
int rq = ram->freq < 1000000; /* XXX */ int rq = ram->freq < 1000000; /* XXX */
switch (ram->ramcfg.version) { switch (ram->next->bios.ramcfg_ver) {
case 0x11: case 0x11:
pd = ram->next->bios.ramcfg_11_01_80; pd = ram->next->bios.ramcfg_11_01_80;
lf = ram->next->bios.ramcfg_11_01_40; lf = ram->next->bios.ramcfg_11_01_40;
...@@ -54,7 +54,7 @@ nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts) ...@@ -54,7 +54,7 @@ nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts)
return -ENOSYS; return -ENOSYS;
} }
switch (ram->timing.version) { switch (ram->next->bios.timing_ver) {
case 0x20: case 0x20:
WL = (ram->next->bios.timing[1] & 0x00000f80) >> 7; WL = (ram->next->bios.timing[1] & 0x00000f80) >> 7;
CL = (ram->next->bios.timing[1] & 0x0000001f); CL = (ram->next->bios.timing[1] & 0x0000001f);
......
...@@ -72,8 +72,13 @@ nouveau_sddr3_calc(struct nouveau_ram *ram) ...@@ -72,8 +72,13 @@ nouveau_sddr3_calc(struct nouveau_ram *ram)
{ {
struct nouveau_bios *bios = nouveau_bios(ram); struct nouveau_bios *bios = nouveau_bios(ram);
int CWL, CL, WR, DLL = 0, ODT = 0; int CWL, CL, WR, DLL = 0, ODT = 0;
u8 ver;
switch (!!ram->timing.data * ram->timing.version) { ver = !!ram->timing.data * ram->timing.version;
if (ram->next)
ver = ram->next->bios.timing_ver;
switch (ver) {
case 0x10: case 0x10:
if (ram->timing.size < 0x17) { if (ram->timing.size < 0x17) {
/* XXX: NV50: Get CWL from the timing register */ /* XXX: NV50: Get CWL from the timing register */
...@@ -86,9 +91,9 @@ nouveau_sddr3_calc(struct nouveau_ram *ram) ...@@ -86,9 +91,9 @@ nouveau_sddr3_calc(struct nouveau_ram *ram)
ODT = nv_ro08(bios, ram->timing.data + 0x0e) & 0x07; ODT = nv_ro08(bios, ram->timing.data + 0x0e) & 0x07;
break; break;
case 0x20: case 0x20:
CWL = (nv_ro16(bios, ram->timing.data + 0x04) & 0x0f80) >> 7; CWL = (ram->next->bios.timing[1] & 0x00000f80) >> 7;
CL = nv_ro08(bios, ram->timing.data + 0x04) & 0x1f; CL = (ram->next->bios.timing[1] & 0x0000001f) >> 0;
WR = nv_ro08(bios, ram->timing.data + 0x0a) & 0x7f; WR = (ram->next->bios.timing[2] & 0x007f0000) >> 16;
/* XXX: Get these values from the VBIOS instead */ /* XXX: Get these values from the VBIOS instead */
DLL = !(ram->mr[1] & 0x1); DLL = !(ram->mr[1] & 0x1);
ODT = (ram->mr[1] & 0x004) >> 2 | ODT = (ram->mr[1] & 0x004) >> 2 |
......
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