Karol Herbst
2017-Apr-06 21:17 UTC
[Nouveau] [PATCH v2] bios/perf: Parse PCIe speeds correctly for ver 0x40
v2: 0x21 also means 2.5 GT/s Signed-off-by: Karol Herbst <karolherbst at gmail.com> --- drm/nouveau/nvkm/subdev/bios/perf.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/bios/perf.c b/drm/nouveau/nvkm/subdev/bios/perf.c index c3068358..3bbb7fed 100644 --- a/drm/nouveau/nvkm/subdev/bios/perf.c +++ b/drm/nouveau/nvkm/subdev/bios/perf.c @@ -146,18 +146,17 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx, break; case 0x40: info->voltage = nvbios_rd08(bios, perf + 0x02); - switch (nvbios_rd08(bios, perf + 0xb) & 0x3) { - case 0: - info->pcie_speed = NVKM_PCIE_SPEED_5_0; - break; - case 3: - case 1: + switch (nvbios_rd08(bios, perf + 0xb) & 0x21) { + case 0x01: + case 0x21: info->pcie_speed = NVKM_PCIE_SPEED_2_5; break; - case 2: - info->pcie_speed = NVKM_PCIE_SPEED_8_0; + case 0x20: + info->pcie_speed = NVKM_PCIE_SPEED_5_0; break; + case 0x00: default: + info->pcie_speed = NVKM_PCIE_SPEED_8_0; break; } info->pcie_width = 0xff; -- 2.12.2