drm/nouveau/pmu/gk208: implement gr power-up magic with gk110_pmu_pgob()
authorBen Skeggs <bskeggs@redhat.com>
Fri, 20 Mar 2015 05:28:52 +0000 (15:28 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 14 Apr 2015 07:00:50 +0000 (17:00 +1000)
Before we moved gk110's implementation of this to pmu, the functions were
identical.  This commit just switches GK208 to use the new (more complete)
implementation of the power-up sequence.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk208.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/priv.h

index ae6b853173b6235439c2b70de3264e78b9128b76..31d8e6055376da286540bc743921c97b6c0c3e42 100644 (file)
@@ -152,43 +152,6 @@ gk208_gr_pack_mmio[] = {
  * PGRAPH engine/subdev functions
  ******************************************************************************/
 
-static int
-gk208_gr_fini(struct nvkm_object *object, bool suspend)
-{
-       struct gf100_gr_priv *priv = (void *)object;
-       static const struct {
-               u32 addr;
-               u32 data;
-       } magic[] = {
-               { 0x020520, 0xfffffffc },
-               { 0x020524, 0xfffffffe },
-               { 0x020524, 0xfffffffc },
-               { 0x020524, 0xfffffff8 },
-               { 0x020524, 0xffffffe0 },
-               { 0x020530, 0xfffffffe },
-               { 0x02052c, 0xfffffffa },
-               { 0x02052c, 0xfffffff0 },
-               { 0x02052c, 0xffffffc0 },
-               { 0x02052c, 0xffffff00 },
-               { 0x02052c, 0xfffffc00 },
-               { 0x02052c, 0xfffcfc00 },
-               { 0x02052c, 0xfff0fc00 },
-               { 0x02052c, 0xff80fc00 },
-               { 0x020528, 0xfffffffe },
-               { 0x020528, 0xfffffffc },
-       };
-       int i;
-
-       nv_mask(priv, 0x000200, 0x08001000, 0x00000000);
-       nv_mask(priv, 0x0206b4, 0x00000000, 0x00000000);
-       for (i = 0; i < ARRAY_SIZE(magic); i++) {
-               nv_wr32(priv, magic[i].addr, magic[i].data);
-               nv_wait(priv, magic[i].addr, 0x80000000, 0x00000000);
-       }
-
-       return nvkm_gr_fini(&priv->base, suspend);
-}
-
 #include "fuc/hubgk208.fuc5.h"
 
 static struct gf100_gr_ucode
@@ -216,7 +179,7 @@ gk208_gr_oclass = &(struct gf100_gr_oclass) {
                .ctor = gf100_gr_ctor,
                .dtor = gf100_gr_dtor,
                .init = gk104_gr_init,
-               .fini = gk208_gr_fini,
+               .fini = _nvkm_gr_fini,
        },
        .cclass = &gk208_grctx_oclass,
        .sclass =  gk208_gr_sclass,
index e318745b8274538eec1d3823eda17c91173c71cd..89bb94b0af8bc4b5dde329e362485cbccdcec8e0 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <subdev/timer.h>
 
-static void
+void
 gk110_pmu_pgob(struct nvkm_pmu *pmu, bool enable)
 {
        static const struct {
index 6f9c09af1a49f4d39bb857e874ee307bf07c81ef..b14134ef9ea52455465ebda40703e4d15004ec5b 100644 (file)
@@ -37,4 +37,5 @@ gk208_pmu_oclass = &(struct nvkm_pmu_impl) {
        .code.size = sizeof(gk208_pmu_code),
        .data.data = gk208_pmu_data,
        .data.size = sizeof(gk208_pmu_data),
+       .pgob = gk110_pmu_pgob,
 }.base;
index 998410563bfdb1999c6c4885a590c5594f3c1e3a..799e7c8b88f50cc163b45f06731652e5e8a3cd2b 100644 (file)
@@ -40,4 +40,6 @@ struct nvkm_pmu_impl {
 
        void (*pgob)(struct nvkm_pmu *, bool);
 };
+
+void gk110_pmu_pgob(struct nvkm_pmu *, bool);
 #endif