Skip to content

Commit 0adfd61

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/instmem: add hal for set_bar0_window_addr()
GH100/GBxxx have moved the register that controls where in VRAM the the BAR0 NV_PRAMIN window points. Add a HAL for this, as the BAR0 window is needed for BAR2 bootstrap. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Timur Tabi <[email protected]> Tested-by: Timur Tabi <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 2f89bb3 commit 0adfd61

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ r535_instmem_new(const struct nvkm_instmem_func *hw,
317317
rm->memory_new = hw->memory_new;
318318
rm->memory_wrap = hw->memory_wrap;
319319
rm->zero = false;
320+
rm->set_bar0_window_addr = hw->set_bar0_window_addr;
320321

321322
ret = nv50_instmem_new_(rm, device, type, inst, pinstmem);
322323
if (ret)

drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ nv50_instobj_wr32_slow(struct nvkm_memory *memory, u64 offset, u32 data)
6565

6666
spin_lock_irqsave(&imem->base.lock, flags);
6767
if (unlikely(imem->addr != base)) {
68-
nvkm_wr32(device, 0x001700, base >> 16);
68+
imem->base.func->set_bar0_window_addr(device, base);
6969
imem->addr = base;
7070
}
7171
nvkm_wr32(device, 0x700000 + addr, data);
@@ -85,7 +85,7 @@ nv50_instobj_rd32_slow(struct nvkm_memory *memory, u64 offset)
8585

8686
spin_lock_irqsave(&imem->base.lock, flags);
8787
if (unlikely(imem->addr != base)) {
88-
nvkm_wr32(device, 0x001700, base >> 16);
88+
imem->base.func->set_bar0_window_addr(device, base);
8989
imem->addr = base;
9090
}
9191
data = nvkm_rd32(device, 0x700000 + addr);
@@ -394,6 +394,12 @@ nv50_instobj_new(struct nvkm_instmem *imem, u32 size, u32 align, bool zero,
394394
* instmem subdev implementation
395395
*****************************************************************************/
396396

397+
static void
398+
nv50_instmem_set_bar0_window_addr(struct nvkm_device *device, u64 addr)
399+
{
400+
nvkm_wr32(device, 0x001700, addr >> 16);
401+
}
402+
397403
static void
398404
nv50_instmem_fini(struct nvkm_instmem *base)
399405
{
@@ -415,6 +421,7 @@ nv50_instmem = {
415421
.memory_new = nv50_instobj_new,
416422
.memory_wrap = nv50_instobj_wrap,
417423
.zero = false,
424+
.set_bar0_window_addr = nv50_instmem_set_bar0_window_addr,
418425
};
419426

420427
int

drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct nvkm_instmem_func {
1616
bool zero, struct nvkm_memory **);
1717
int (*memory_wrap)(struct nvkm_instmem *, struct nvkm_memory *, struct nvkm_memory **);
1818
bool zero;
19+
void (*set_bar0_window_addr)(struct nvkm_device *, u64 addr);
1920
};
2021

2122
int nv50_instmem_new_(const struct nvkm_instmem_func *, struct nvkm_device *,

0 commit comments

Comments
 (0)