Skip to content

Commit

Permalink
drm/nouveau/flcn: fetch PRI address from TOP if not provided by const…
Browse files Browse the repository at this point in the history
…ructor

Shortcut to avoid each subdev having to do this itself.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jan 15, 2020
1 parent 5a4b98c commit de04819
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/nouveau/nvkm/falcon/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "priv.h"

#include <subdev/mc.h>
#include <subdev/top.h>

void
nvkm_falcon_load_imem(struct nvkm_falcon *falcon, void *data, u32 start,
Expand Down Expand Up @@ -141,6 +142,12 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon)
u32 debug_reg;
u32 reg;

if (!falcon->addr) {
falcon->addr = nvkm_top_addr(subdev->device, subdev->index);
if (WARN_ON(!falcon->addr))
return -ENODEV;
}

reg = nvkm_falcon_rd32(falcon, 0x12c);
falcon->version = reg & 0xf;
falcon->secret = (reg >> 4) & 0x3;
Expand Down

0 comments on commit de04819

Please sign in to comment.