Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Falcon IMEM/DMEM dump functions
static void
falcon_dump_imem(struct nvkm_device *device, u32 base)
{
u32 imem_size = nvkm_rd32(device, base + 0x108) & 0x1ff;
u32 i;
u32 buf[8];
imem_size *= 0x100;
nvkm_wr32(device, 0x0010a180, 0x1 << 25);
for (i = 0; i < imem_size / 4; i++) {
buf[i % 8] = nvkm_rd32(device, base + 0x184);
if (1 && i % 8 == 7)
printk("%08x %08x %08x %08x %08x %08x %08x %08x\n",
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
buf[6], buf[7]);
}
}
static void
falcon_dump_dmem(struct nvkm_device *device, u32 base)
{
u32 dmem_size = nvkm_rd32(device, base + 0x108) & 0x3fe00;
u32 i;
u32 buf[8];
dmem_size = dmem_size >> 9;
dmem_size *= 0x100;
nvkm_wr32(device, 0x10a1c0, (0x1 << 25));
for (i = 0; i < dmem_size / 4; i++) {
buf[i % 8] = nvkm_rd32(device, base + 0x1c4);
if (1 && i % 8 == 7)
printk("%08x %08x %08x %08x %08x %08x %08x %08x\n",
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
buf[6], buf[7]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment