Skip to content

Commit 7028156

Browse files
author
Ben Skeggs
committed
drm/nouveau/gr/gf100-: split out per-gpc address calculation macro
There's a few places where we need to access a GPC register from ucode, but outside of the falcon's io address space. To do this we need to calculate the offset based on which GPC we're executing on. This used to be done manually, but we've since found a "base" offset that can be added by the hardware. To use this, an extra bit needs to be set in the register address, which is what this macro achieves. There should be no functional change from this commit. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 9543294 commit 7028156

2 files changed

Lines changed: 49 additions & 47 deletions

File tree

drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpc.fuc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ mmio_list_base:
5252
#endif
5353

5454
#ifdef INCLUDE_CODE
55+
#define gpc_addr(reg,addr) /*
56+
*/ imm32(reg,addr) /*
57+
*/ or reg NV_PGRAPH_GPCX_GPCCS_MMIO_CTRL_BASE_ENABLE
5558
#define gpc_wr32(addr,reg) /*
59+
*/ gpc_addr($r14,addr) /*
5660
*/ mov b32 $r15 reg /*
57-
*/ imm32($r14, addr) /*
58-
*/ or $r14 NV_PGRAPH_GPCX_GPCCS_MMIO_CTRL_BASE_ENABLE /*
5961
*/ call(nv_wr32)
6062

6163
// reports an exception to the host

drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgm107.fuc5.h

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -356,33 +356,33 @@ uint32_t gm107_grgpc_code[] = {
356356
0x02687e2f,
357357
0x002fbb00,
358358
0x0f003fbb,
359-
0x8effb23f,
360-
0xf0501d60,
361-
0x8f7e01e5,
359+
0x1d608e3f,
360+
0x01e5f050,
361+
0x8f7effb2,
362362
0x0c0f0000,
363-
0xa88effb2,
364-
0xe5f0501d,
365-
0x008f7e01,
363+
0x501da88e,
364+
0xb201e5f0,
365+
0x008f7eff,
366366
0x03147e00,
367-
0xb23f0f00,
368-
0x1d608eff,
369-
0x01e5f050,
367+
0x8e3f0f00,
368+
0xf0501d60,
369+
0xffb201e5,
370370
0x00008f7e,
371-
0xffb2000f,
372-
0x501d9c8e,
373-
0x7e01e5f0,
371+
0x9c8e000f,
372+
0xe5f0501d,
373+
0x7effb201,
374374
0x0f00008f,
375375
0x03147e01,
376-
0x8effb200,
377-
0xf0501da8,
378-
0x8f7e01e5,
379-
0xff0f0000,
380-
0x988effb2,
381-
0xe5f0501d,
382-
0x008f7e01,
383-
0xb2020f00,
384-
0x1da88eff,
376+
0x1da88e00,
385377
0x01e5f050,
378+
0x8f7effb2,
379+
0xff0f0000,
380+
0x501d988e,
381+
0xb201e5f0,
382+
0x008f7eff,
383+
0x8e020f00,
384+
0xf0501da8,
385+
0xffb201e5,
386386
0x00008f7e,
387387
0x0003147e,
388388
0x85050498,
@@ -414,13 +414,13 @@ uint32_t gm107_grgpc_code[] = {
414414
0x0050b7bf,
415415
0x0142b608,
416416
0x0fa81bf4,
417-
0x8effb23f,
418-
0xf0501d60,
419-
0x8f7e01e5,
417+
0x1d608e3f,
418+
0x01e5f050,
419+
0x8f7effb2,
420420
0x0d0f0000,
421-
0xa88effb2,
422-
0xe5f0501d,
423-
0x008f7e01,
421+
0x501da88e,
422+
0xb201e5f0,
423+
0x008f7eff,
424424
0x03147e00,
425425
0x01008000,
426426
0x0003f602,
@@ -491,9 +491,9 @@ uint32_t gm107_grgpc_code[] = {
491491
0x8000f804,
492492
0xf6028100,
493493
0x04bd000f,
494-
0xc48effb2,
495-
0xe5f0501d,
496-
0x008f7e01,
494+
0x501dc48e,
495+
0xb201e5f0,
496+
0x008f7eff,
497497
0x0711f400,
498498
0x0006217e,
499499
/* 0x0664: ctx_xfer_not_load */
@@ -505,23 +505,23 @@ uint32_t gm107_grgpc_code[] = {
505505
0x4afc8003,
506506
0x0002f602,
507507
0x0c0f04bd,
508-
0xa88effb2,
509-
0xe5f0501d,
510-
0x008f7e01,
508+
0x501da88e,
509+
0xb201e5f0,
510+
0x008f7eff,
511511
0x03147e00,
512-
0xb23f0f00,
513-
0x1d608eff,
514-
0x01e5f050,
512+
0x8e3f0f00,
513+
0xf0501d60,
514+
0xffb201e5,
515515
0x00008f7e,
516-
0xffb2000f,
517-
0x501d9c8e,
518-
0x7e01e5f0,
516+
0x9c8e000f,
517+
0xe5f0501d,
518+
0x7effb201,
519519
0x0f00008f,
520520
0x03147e01,
521521
0x01fcf000,
522-
0xb203f0b6,
523-
0x1da88eff,
524-
0x01e5f050,
522+
0x8e03f0b6,
523+
0xf0501da8,
524+
0xffb201e5,
525525
0x00008f7e,
526526
0xf001acf0,
527527
0x008b02a5,
@@ -553,9 +553,9 @@ uint32_t gm107_grgpc_code[] = {
553553
0x1a12f406,
554554
/* 0x073c: ctx_xfer_post */
555555
0x0002277e,
556-
0xffb20d0f,
557-
0x501da88e,
558-
0x7e01e5f0,
556+
0xa88e0d0f,
557+
0xe5f0501d,
558+
0x7effb201,
559559
0x7e00008f,
560560
/* 0x0753: ctx_xfer_done */
561561
0x7e000314,

0 commit comments

Comments
 (0)