Skip to content

Commit

Permalink
drm/gr/nvc0-: merge nvc0/nve0 ucode, and use cpp instead of m4
Browse files Browse the repository at this point in the history
No code changes, proven by envyas producing identical binaries.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jul 1, 2013
1 parent 05f9a5b commit e99716f
Show file tree
Hide file tree
Showing 14 changed files with 1,270 additions and 2,587 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,7 @@
* Authors: Ben Skeggs
*/

define(`mmctx_data', `.b32 eval((($2 - 1) << 26) | $1)')
define(`queue_init', `.skip eval((2 * 4) + ((8 * 4) * 2))')

ifdef(`include_code', `
// Error codes
define(`E_BAD_COMMAND', 0x01)
define(`E_CMD_OVERFLOW', 0x02)

// Util macros to help with debugging ucode hangs etc
define(`T_WAIT', 0)
define(`T_MMCTX', 1)
define(`T_STRWAIT', 2)
define(`T_STRINIT', 3)
define(`T_AUTO', 4)
define(`T_CHAN', 5)
define(`T_LOAD', 6)
define(`T_SAVE', 7)
define(`T_LCHAN', 8)
define(`T_LCTXH', 9)

define(`trace_set', `
mov $r8 0x83c
shl b32 $r8 6
clear b32 $r9
bset $r9 $1
iowr I[$r8 + 0x000] $r9 // CC_SCRATCH[7]
')

define(`trace_clr', `
mov $r8 0x85c
shl b32 $r8 6
clear b32 $r9
bset $r9 $1
iowr I[$r8 + 0x000] $r9 // CC_SCRATCH[7]
')

#ifdef INCLUDE_CODE
// queue_put - add request to queue
//
// In : $r13 queue pointer
Expand Down Expand Up @@ -178,27 +143,41 @@ watchdog_clear:
iowr I[$r8 + 0x000] $r0
ret

// wait_done{z,o} - wait on FUC_DONE bit to become clear/set
// wait_donez - wait on FUC_DONE bit to become clear
//
// In : $r10 bit to wait on
//
wait_donez:
trace_set(T_WAIT);
mov $r8 0x818
shl b32 $r8 6
iowr I[$r8 + 0x000] $r10
wait_donez_ne:
mov $r8 0x400
shl b32 $r8 6
iord $r8 I[$r8 + 0x000]
xbit $r8 $r8 $r10
bra ne #wait_donez_ne
trace_clr(T_WAIT)
ret

// wait_doneo - wait on FUC_DONE bit to become set
//
// In : $r10 bit to wait on
//
define(`wait_done', `
$1:
wait_doneo:
trace_set(T_WAIT);
mov $r8 0x818
shl b32 $r8 6
iowr I[$r8 + 0x000] $r10 // CC_SCRATCH[6] = wait bit
wait_done_$1:
iowr I[$r8 + 0x000] $r10
wait_doneo_e:
mov $r8 0x400
shl b32 $r8 6
iord $r8 I[$r8 + 0x000] // DONE
iord $r8 I[$r8 + 0x000]
xbit $r8 $r8 $r10
bra $2 #wait_done_$1
bra e #wait_doneo_e
trace_clr(T_WAIT)
ret
')
wait_done(wait_donez, ne)
wait_done(wait_doneo, e)

// mmctx_size - determine size of a mmio list transfer
//
Expand Down Expand Up @@ -397,4 +376,4 @@ strand_ctx_init:
sub b32 $r15 $r14 $r15
trace_clr(T_STRINIT)
ret
')
#endif
Loading

0 comments on commit e99716f

Please sign in to comment.