Commit de048192 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/flcn: fetch PRI address from TOP if not provided by constructor

Shortcut to avoid each subdev having to do this itself.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 5a4b98cd
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "priv.h" #include "priv.h"
#include <subdev/mc.h> #include <subdev/mc.h>
#include <subdev/top.h>
void void
nvkm_falcon_load_imem(struct nvkm_falcon *falcon, void *data, u32 start, nvkm_falcon_load_imem(struct nvkm_falcon *falcon, void *data, u32 start,
...@@ -141,6 +142,12 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon) ...@@ -141,6 +142,12 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon)
u32 debug_reg; u32 debug_reg;
u32 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); reg = nvkm_falcon_rd32(falcon, 0x12c);
falcon->version = reg & 0xf; falcon->version = reg & 0xf;
falcon->secret = (reg >> 4) & 0x3; falcon->secret = (reg >> 4) & 0x3;
......
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