All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] bios/perf: Parse PCIe speeds correctly for ver 0x40
@ 2017-04-06 21:17 Karol Herbst
  0 siblings, 0 replies; only message in thread
From: Karol Herbst @ 2017-04-06 21:17 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

v2: 0x21 also means 2.5 GT/s

Signed-off-by: Karol Herbst <karolherbst@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

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-06 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 21:17 [PATCH v2] bios/perf: Parse PCIe speeds correctly for ver 0x40 Karol Herbst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.