Skip to content

Commit 9074109

Browse files
Ben SkeggsLyude
authored andcommitted
drm/nouveau/acr/gm20b: regression fixes
Missed some Tegra-specific quirks when reworking ACR to support Ampere. Fixes: 2541626 ("drm/nouveau/acr: use common falcon HS FW code for ACR FWs") Signed-off-by: Ben Skeggs <[email protected]> Tested-by: Diogo Ivo <[email protected]> Tested-by: Nicolas Chauvet <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b480600 commit 9074109

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

drivers/gpu/drm/nouveau/nvkm/core/firmware.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ nvkm_firmware_mem_page(struct nvkm_memory *memory)
151151
static enum nvkm_memory_target
152152
nvkm_firmware_mem_target(struct nvkm_memory *memory)
153153
{
154+
if (nvkm_firmware_mem(memory)->device->func->tegra)
155+
return NVKM_MEM_TARGET_NCOH;
156+
154157
return NVKM_MEM_TARGET_HOST;
155158
}
156159

drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
4848
img += 4;
4949
len -= 4;
5050
}
51+
52+
/* Sigh. Tegra PMU FW's init message... */
53+
if (len) {
54+
u32 data = nvkm_falcon_rd32(falcon, 0x1c4 + (port * 8));
55+
56+
while (len--) {
57+
*(u8 *)img++ = data & 0xff;
58+
data >>= 8;
59+
}
60+
}
5161
}
5262

5363
static void
@@ -64,6 +74,8 @@ gm200_flcn_pio_dmem_wr(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
6474
img += 4;
6575
len -= 4;
6676
}
77+
78+
WARN_ON(len);
6779
}
6880

6981
static void
@@ -74,7 +86,7 @@ gm200_flcn_pio_dmem_wr_init(struct nvkm_falcon *falcon, u8 port, bool sec, u32 d
7486

7587
const struct nvkm_falcon_func_pio
7688
gm200_flcn_dmem_pio = {
77-
.min = 4,
89+
.min = 1,
7890
.max = 0x100,
7991
.wr_init = gm200_flcn_pio_dmem_wr_init,
8092
.wr = gm200_flcn_pio_dmem_wr,

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ gm20b_pmu_init(struct nvkm_pmu *pmu)
225225

226226
pmu->initmsg_received = false;
227227

228-
nvkm_falcon_load_dmem(falcon, &args, addr_args, sizeof(args), 0);
228+
nvkm_falcon_pio_wr(falcon, (u8 *)&args, 0, 0, DMEM, addr_args, sizeof(args), 0, false);
229229
nvkm_falcon_start(falcon);
230230
return 0;
231231
}

0 commit comments

Comments
 (0)