diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-01-15 06:34:21 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-01-15 10:50:28 +1000 |
commit | e938c4e723a0dc5976f3e2c022c6ac30c9f14026 (patch) | |
tree | 2f48b61e823b4ea7e6a7970febe58854c89b2d63 /drivers/gpu/drm/nouveau/nvkm | |
parent | bc3cfd18acaf026d156a29f9a01aabdd70cb9d11 (diff) | |
download | linux-stable-e938c4e723a0dc5976f3e2c022c6ac30c9f14026.tar.gz linux-stable-e938c4e723a0dc5976f3e2c022c6ac30c9f14026.tar.bz2 linux-stable-e938c4e723a0dc5976f3e2c022c6ac30c9f14026.zip |
drm/nouveau/flcn: specify debug/production register offset from subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/nvdec/gm107.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/falcon/base.c | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c | 1 |
5 files changed, 7 insertions, 26 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/gm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/gm107.c index 1478079d9580..0ab27ab4d8ee 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/gm107.c @@ -23,6 +23,7 @@ static const struct nvkm_falcon_func gm107_nvdec_flcn = { + .debug = 0xd00, .fbif = 0x600, .load_imem = nvkm_falcon_v1_load_imem, .load_dmem = nvkm_falcon_v1_load_dmem, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c index 9ef562345761..bb95a2d72b89 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c @@ -88,6 +88,7 @@ gp102_sec2_flcn_bind_context(struct nvkm_falcon *falcon, static const struct nvkm_falcon_func gp102_sec2_flcn = { + .debug = 0x408, .fbif = 0x600, .load_imem = nvkm_falcon_v1_load_imem, .load_dmem = nvkm_falcon_v1_load_dmem, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c index f4dd2a4814b0..c35752765ced 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c @@ -23,6 +23,7 @@ static const struct nvkm_falcon_func tu102_sec2_flcn = { + .debug = 0x408, .fbif = 0x600, .load_imem = nvkm_falcon_v1_load_imem, .load_dmem = nvkm_falcon_v1_load_dmem, diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/base.c b/drivers/gpu/drm/nouveau/nvkm/falcon/base.c index 9e9e6808afb7..c6a3448180d6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/falcon/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/base.c @@ -138,8 +138,8 @@ nvkm_falcon_clear_interrupt(struct nvkm_falcon *falcon, u32 mask) static int nvkm_falcon_oneinit(struct nvkm_falcon *falcon) { + const struct nvkm_falcon_func *func = falcon->func; const struct nvkm_subdev *subdev = falcon->owner; - u32 debug_reg; u32 reg; if (!falcon->addr) { @@ -158,31 +158,8 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon) falcon->code.limit = (reg & 0x1ff) << 8; falcon->data.limit = (reg & 0x3fe00) >> 1; - switch (subdev->index) { - case NVKM_ENGINE_GR: - debug_reg = 0x0; - break; - case NVKM_SUBDEV_PMU: - debug_reg = 0xc08; - break; - case NVKM_ENGINE_NVDEC0: - debug_reg = 0xd00; - break; - case NVKM_ENGINE_SEC2: - debug_reg = 0x408; - break; - case NVKM_SUBDEV_GSP: - debug_reg = 0x0; /*XXX*/ - break; - default: - nvkm_warn(subdev, "unsupported falcon %s!\n", - nvkm_subdev_name[subdev->index]); - debug_reg = 0; - break; - } - - if (debug_reg) { - u32 val = nvkm_falcon_rd32(falcon, debug_reg); + if (func->debug) { + u32 val = nvkm_falcon_rd32(falcon, func->debug); falcon->debug = (val >> 20) & 0x1; } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c index c38a80bc7e53..0e23325f94a7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gt215.c @@ -243,6 +243,7 @@ gt215_pmu_init(struct nvkm_pmu *pmu) const struct nvkm_falcon_func gt215_pmu_flcn = { + .debug = 0xc08, .fbif = 0xe00, .load_imem = nvkm_falcon_v1_load_imem, .load_dmem = nvkm_falcon_v1_load_dmem, |