drm/nouveau/pmu/gt215: fix reset
authorBen Skeggs <bskeggs@redhat.com>
Fri, 21 Jul 2017 00:33:52 +0000 (10:33 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 22 Aug 2017 08:04:30 +0000 (18:04 +1000)
The NV_PMC_ENABLE bit for PMU did not appear until GF100, and some other
unknown register needs to be poked instead.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gf119.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk104.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk110.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk208.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm107.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp100.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h

index 0e36d4cb7201f33e3f1d8184320eebae842e02d7..976a0820544123823b1022de047f597c4d3c0cf6 100644 (file)
 #include "priv.h"
 #include "fuc/gf100.fuc3.h"
 
+#include <subdev/mc.h>
+
+void
+gf100_pmu_reset(struct nvkm_pmu *pmu)
+{
+       struct nvkm_device *device = pmu->subdev.device;
+       nvkm_mc_disable(device, NVKM_SUBDEV_PMU);
+       nvkm_mc_enable(device, NVKM_SUBDEV_PMU);
+}
+
 static const struct nvkm_pmu_func
 gf100_pmu = {
        .code.data = gf100_pmu_code,
        .code.size = sizeof(gf100_pmu_code),
        .data.data = gf100_pmu_data,
        .data.size = sizeof(gf100_pmu_data),
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
        .init = gt215_pmu_init,
        .fini = gt215_pmu_fini,
        .intr = gt215_pmu_intr,
index 0e4ba4248b152d491f0fe3d1dfac86548698d125..ca3b4dfe18e319c12ceb7aef4a573702ae2e94c8 100644 (file)
@@ -30,7 +30,7 @@ gf119_pmu = {
        .code.size = sizeof(gf119_pmu_code),
        .data.data = gf119_pmu_data,
        .data.size = sizeof(gf119_pmu_data),
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
        .init = gt215_pmu_init,
        .fini = gt215_pmu_fini,
        .intr = gt215_pmu_intr,
index 2ad858d825ac290b910b0c3fa939cda531d03d60..c26195d5fc3265e38cfb0c0d453291f475e57417 100644 (file)
@@ -109,7 +109,7 @@ gk104_pmu = {
        .code.size = sizeof(gk104_pmu_code),
        .data.data = gk104_pmu_data,
        .data.size = sizeof(gk104_pmu_data),
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
        .init = gt215_pmu_init,
        .fini = gt215_pmu_fini,
        .intr = gt215_pmu_intr,
index fc4b8ecfdaebb332a305485d4e9dc6d2c9811836..aac0258a1babc466a6a27f95178b1981fd406d58 100644 (file)
@@ -88,7 +88,7 @@ gk110_pmu = {
        .code.size = sizeof(gk110_pmu_code),
        .data.data = gk110_pmu_data,
        .data.size = sizeof(gk110_pmu_data),
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
        .init = gt215_pmu_init,
        .fini = gt215_pmu_fini,
        .intr = gt215_pmu_intr,
index e9a91277683a2173bab2e60ac592695126857dd7..0efbc0f9fffb38efbb9d0f4d45fa0720b4d2cb18 100644 (file)
@@ -30,7 +30,7 @@ gk208_pmu = {
        .code.size = sizeof(gk208_pmu_code),
        .data.data = gk208_pmu_data,
        .data.size = sizeof(gk208_pmu_data),
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
        .init = gt215_pmu_init,
        .fini = gt215_pmu_fini,
        .intr = gt215_pmu_intr,
index 978aae3c10017510010600e7ef701ca3605beafc..14862452a597d65b97353fe6c8e4d257b303766d 100644 (file)
@@ -198,7 +198,7 @@ static const struct nvkm_pmu_func
 gk20a_pmu = {
        .init = gk20a_pmu_init,
        .fini = gk20a_pmu_fini,
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
 };
 
 int
index 9a248ed75f0982afa455801772f2d11c70457777..25e18f2ea0819ba3304f4f9fdcdd8b26c593220b 100644 (file)
@@ -32,7 +32,7 @@ gm107_pmu = {
        .code.size = sizeof(gm107_pmu_code),
        .data.data = gm107_pmu_data,
        .data.size = sizeof(gm107_pmu_data),
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
        .init = gt215_pmu_init,
        .fini = gt215_pmu_fini,
        .intr = gt215_pmu_intr,
index 6c41c20c85a767d8975f8c6d5bd1a360c339a83a..0e23d5d4bb3416e56e9c8386cc38887d661f5b41 100644 (file)
@@ -25,7 +25,7 @@
 
 static const struct nvkm_pmu_func
 gp100_pmu = {
-       .reset = gt215_pmu_reset,
+       .reset = gf100_pmu_reset,
 };
 
 int
index 90d428b3be975af97584168e2d6bb163a9142b4f..9b5d97dac5508b4e9437bfcffcbf4b9e9313ec20 100644 (file)
@@ -180,13 +180,13 @@ gt215_pmu_fini(struct nvkm_pmu *pmu)
        nvkm_wr32(pmu->subdev.device, 0x10a014, 0x00000060);
 }
 
-void
+static void
 gt215_pmu_reset(struct nvkm_pmu *pmu)
 {
        struct nvkm_device *device = pmu->subdev.device;
-       nvkm_mask(device, 0x000200, 0x00002000, 0x00000000);
-       nvkm_mask(device, 0x000200, 0x00002000, 0x00002000);
-       nvkm_rd32(device, 0x000200);
+       nvkm_mask(device, 0x022210, 0x00000001, 0x00000000);
+       nvkm_mask(device, 0x022210, 0x00000001, 0x00000001);
+       nvkm_rd32(device, 0x022210);
 }
 
 int
index 096cba069f7223de2edaa7b595ceba85332ff19c..616641d543a82b9ccbf38d04e32c818fec1a406f 100644 (file)
@@ -30,12 +30,13 @@ struct nvkm_pmu_func {
        void (*pgob)(struct nvkm_pmu *, bool);
 };
 
-void gt215_pmu_reset(struct nvkm_pmu *);
 int gt215_pmu_init(struct nvkm_pmu *);
 void gt215_pmu_fini(struct nvkm_pmu *);
 void gt215_pmu_intr(struct nvkm_pmu *);
 void gt215_pmu_recv(struct nvkm_pmu *);
 int gt215_pmu_send(struct nvkm_pmu *, u32[2], u32, u32, u32, u32);
 
+void gf100_pmu_reset(struct nvkm_pmu *);
+
 void gk110_pmu_pgob(struct nvkm_pmu *, bool);
 #endif