interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / scripts / gpu_bench / STEP6_compute.bench

38 lines · 1568 bytes Raw Blame History
1# STEP6_compute.bench -- MEC HQD compute queue setup (BAR5 DWORD indices, byte offset / 4).
2# Source: amd_gpu_regs.h (gfx_8_0_d.h, gfx_v8_0.c).
3#
4# NOTE: Linux picks the MEC queue with SRBM_GFX_CNTL (oss_3_0_d.h:88), not GRBM_GFX_INDEX; the
5# queue-select step below is unverified against vi_srbm_select and must be reviewed before a run.
6# Not runnable as a whole yet: the write allowlist does not cover these registers (needs
7# 0xc200 and 0x3247-0x326c). PQ base, rptr/wptr report and EOP base are physical
8# addresses from the driver's boot log, so they stay commented.
9
10# Select SE 0 SH 0 for HQD programming
11# mmGRBM_GFX_INDEX, byte 0x30800 (SE 0, SH 0, instance 0)
12bar5_write 0xc200 0x0
13
14# Deactivate the HQD
15# mmCP_HQD_ACTIVE, byte 0xC91C
16bar5_read 0x3247
17# CP_HQD_ACTIVE = 0
18bar5_write 0x3247 0x0
19
20# PQ base 0x324d (byte 0xC934) = pq_pa >> 8, PQ_BASE_HI 0x324e = pq_pa >> 40
21# PQ_RPTR_REPORT_ADDR 0x3250 / _HI 0x3251; PQ_WPTR_POLL_ADDR 0x3252 / _HI 0x3253: from the boot log
22# mmCP_HQD_PQ_RPTR, byte 0xC93C = 0
23bar5_write 0x324f 0x0
24# mmCP_HQD_PQ_CONTROL, byte 0xC958: size log2 minus 1 = 7 (256 dwords)
25bar5_write 0x3256 0x7
26# EOP_BASE_ADDR 0x326a (byte 0xC9A8) = eop_pa >> 8; EOP_BASE_ADDR_HI 0x326b (byte 0xC9AC) = eop_pa >> 40
27# mmCP_HQD_EOP_CONTROL, byte 0xC9B0: EOP_SIZE 5, MTYPE 3
28bar5_write 0x326c 0x17
29
30# Activate, then read back
31# CP_HQD_ACTIVE = 1
32bar5_write 0x3247 0x1
33# should read 1
34bar5_read 0x3247
35
36# Restore GRBM_GFX_INDEX to broadcast
37# SE | SH | INSTANCE broadcast (bits 31, 29, 30; gfx_8_0_sh_mask.h:5691-5695)
38bar5_write 0xc200 0xe0000000