Commit b7f44ef7 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/pmu: move preinit() falcon reset to devinit

Cleanup before falcon changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 74f9dcb0
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/pmu.h> #include <subdev/bios/pmu.h>
#include <subdev/pmu.h>
#include <subdev/timer.h> #include <subdev/timer.h>
static void static void
...@@ -85,13 +86,18 @@ pmu_load(struct nv50_devinit *init, u8 type, bool post, ...@@ -85,13 +86,18 @@ pmu_load(struct nv50_devinit *init, u8 type, bool post,
struct nvkm_subdev *subdev = &init->base.subdev; struct nvkm_subdev *subdev = &init->base.subdev;
struct nvkm_bios *bios = subdev->device->bios; struct nvkm_bios *bios = subdev->device->bios;
struct nvbios_pmuR pmu; struct nvbios_pmuR pmu;
int ret;
if (!nvbios_pmuRm(bios, type, &pmu)) if (!nvbios_pmuRm(bios, type, &pmu))
return -EINVAL; return -EINVAL;
if (!post) if (!post || !subdev->device->pmu)
return 0; return 0;
ret = nvkm_falcon_reset(&subdev->device->pmu->falcon);
if (ret)
return ret;
pmu_code(init, pmu.boot_addr_pmu, pmu.boot_addr, pmu.boot_size, false); pmu_code(init, pmu.boot_addr_pmu, pmu.boot_addr, pmu.boot_size, false);
pmu_code(init, pmu.code_addr_pmu, pmu.code_addr, pmu.code_size, true); pmu_code(init, pmu.code_addr_pmu, pmu.code_addr, pmu.code_size, true);
pmu_data(init, pmu.data_addr_pmu, pmu.data_addr, pmu.data_size); pmu_data(init, pmu.data_addr_pmu, pmu.data_addr, pmu.data_size);
......
...@@ -99,9 +99,6 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu) ...@@ -99,9 +99,6 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
{ {
struct nvkm_device *device = pmu->subdev.device; struct nvkm_device *device = pmu->subdev.device;
if (!pmu->func->enabled(pmu))
return;
/* Reset. */ /* Reset. */
if (pmu->func->reset) if (pmu->func->reset)
pmu->func->reset(pmu); pmu->func->reset(pmu);
...@@ -113,14 +110,6 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu) ...@@ -113,14 +110,6 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
); );
} }
static int
nvkm_pmu_preinit(struct nvkm_subdev *subdev)
{
struct nvkm_pmu *pmu = nvkm_pmu(subdev);
nvkm_pmu_reset(pmu);
return 0;
}
static int static int
nvkm_pmu_init(struct nvkm_subdev *subdev) nvkm_pmu_init(struct nvkm_subdev *subdev)
{ {
...@@ -160,7 +149,6 @@ nvkm_pmu_dtor(struct nvkm_subdev *subdev) ...@@ -160,7 +149,6 @@ nvkm_pmu_dtor(struct nvkm_subdev *subdev)
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
nvkm_pmu = { nvkm_pmu = {
.dtor = nvkm_pmu_dtor, .dtor = nvkm_pmu_dtor,
.preinit = nvkm_pmu_preinit,
.init = nvkm_pmu_init, .init = nvkm_pmu_init,
.fini = nvkm_pmu_fini, .fini = nvkm_pmu_fini,
.intr = nvkm_pmu_intr, .intr = nvkm_pmu_intr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment