[Nouveau] [PATCH 31/32] device: Enable clk for Maxwell2

Karol Herbst karolherbst at gmail.com
Fri Nov 17 00:04:35 UTC 2017


Reclokcing will only be enabled by setting NvFanless to true.

Signed-off-by: Karol Herbst <karolherbst at gmail.com>
---
 drm/nouveau/nvkm/engine/device/base.c |  3 +++
 drm/nouveau/nvkm/subdev/clk/gk104.c   | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index e1464361..f63aaf3e 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -2029,6 +2029,7 @@ nv120_chipset = {
 	.bar = gm107_bar_new,
 	.bios = nvkm_bios_new,
 	.bus = gf100_bus_new,
+	.clk = gk104_clk_new,
 	.devinit = gm200_devinit_new,
 	.fb = gm200_fb_new,
 	.fuse = gm107_fuse_new,
@@ -2064,6 +2065,7 @@ nv124_chipset = {
 	.bar = gm107_bar_new,
 	.bios = nvkm_bios_new,
 	.bus = gf100_bus_new,
+	.clk = gk104_clk_new,
 	.devinit = gm200_devinit_new,
 	.fb = gm200_fb_new,
 	.fuse = gm107_fuse_new,
@@ -2099,6 +2101,7 @@ nv126_chipset = {
 	.bar = gm107_bar_new,
 	.bios = nvkm_bios_new,
 	.bus = gf100_bus_new,
+	.clk = gk104_clk_new,
 	.devinit = gm200_devinit_new,
 	.fb = gm200_fb_new,
 	.fuse = gm107_fuse_new,
diff --git a/drm/nouveau/nvkm/subdev/clk/gk104.c b/drm/nouveau/nvkm/subdev/clk/gk104.c
index 0b37e3da..be04463e 100644
--- a/drm/nouveau/nvkm/subdev/clk/gk104.c
+++ b/drm/nouveau/nvkm/subdev/clk/gk104.c
@@ -25,6 +25,7 @@
 #include "priv.h"
 #include "pll.h"
 
+#include <core/option.h>
 #include <subdev/timer.h>
 #include <subdev/bios.h>
 #include <subdev/bios/pll.h>
@@ -507,10 +508,17 @@ int
 gk104_clk_new(struct nvkm_device *device, int index, struct nvkm_clk **pclk)
 {
 	struct gk104_clk *clk;
+	bool reclocking;
 
 	if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL)))
 		return -ENOMEM;
 	*pclk = &clk->base;
 
-	return nvkm_clk_ctor(&gk104_clk, device, index, true, &clk->base);
+	if (device->chipset >= 0x120)
+		reclocking = nvkm_boolopt(device->cfgopt, "NvFanless", false);
+	else
+		reclocking = true;
+
+	return nvkm_clk_ctor(&gk104_clk, device, index, reclocking,
+			     &clk->base);
 }
-- 
2.15.0



More information about the Nouveau mailing list