Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/scripts/gpu_bench/STEP5_sdma.bench # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / scripts / gpu_bench / STEP5_sdma.bench` 31 lines ยท 1480 bytes Raw Blame History 1 # STEP5_sdma.bench -- SDMA0 ring setup and status (BAR5 DWORD indices, byte offset / 4). 2 # Source: amd_gpu_regs.h (oss_3_0_d.h, sdma_v3_0.c). 3 # 4 # Not runnable as a whole yet: the write allowlist does not cover 0x3480-0x3489 (needs that 5 # entry), and the ring base and rptr address come from the driver's boot log. 6 # 7 # Two things this file cannot do with the console as written: 8 # - The verify read at BAR0 + 0x2400000 (back buffer) is outside the BAR0 window the 9 # console allows (DWORD offsets 0-65535). The back buffer read needs a wider window or a 10 # readback by the driver. 11 # - Fence and fill checks are memory reads, not register reads. 12 13 # mmSDMA0_STATUS_REG, byte 0xD034; bit 0 = IDLE 14 bar5_read 0x340d 15 16 # Stop SDMA0 GFX ring, then program it 17 # mmSDMA0_GFX_RB_CNTL, byte 0xD200: disable 18 bar5_write 0x3480 0x0 19 # RB_BASE 0x3481 (byte 0xD204) = ring_pa >> 8; RB_BASE_HI 0x3482 (byte 0xD208) = ring_pa >> 40 20 # RPTR_ADDR_LO 0x3489 (byte 0xD224), RPTR_ADDR_HI 0x3488 (byte 0xD220): from the boot log 21 # mmSDMA0_GFX_RB_WPTR, byte 0xD210 = 0 22 bar5_write 0x3484 0x0 23 # mmSDMA0_GFX_RB_RPTR, byte 0xD20C = 0 24 bar5_write 0x3483 0x0 25 # mmSDMA0_GFX_RB_CNTL = RB_ENABLE | RB_SIZE 11 (2048 dwords) 26 bar5_write 0x3480 0x17 27 28 # CONSTANT_FILL, then advance the write pointer (SDMA uses bytes: 5 dwords = 20) 29 # SDMA_PACKET(0x0b) = 0x00000B00; dst lo, dst hi, fill 0xdeadbeef, count (512*4)|(2<<30) = 0x800007F0 30 # bar5_write 0x3484 20 31 # Fence: SDMA_PACKET(0x02) = 0x00000200, fence lo, fence hi, 0, seq