aboutsummaryrefslogtreecommitdiffstats
path: root/psp_out/smu_fw
ModeNameSize
-rw-r--r--README.md2827logstatsplainblame
-rw-r--r--REVERSING.md3990logstatsplainblame
-rw-r--r--smu_13_0_0_runtime_body.bin261632logstatsplainblame
-rw-r--r--smu_13_0_0_xtensa.elf265728logstatsplainblame
-rw-r--r--smu_flash_code.bin108672logstatsplainblame
-rw-r--r--smu_flash_xtensa.elf112768logstatsplainblame

Navi31 SMU (MP1 13.0.0) firmware — Tensilica Xtensa — for reversing

Architecture (CORRECTED — it is NOT RISC-V/RS64)

The Navi31 / gfx1100 SMU (MP1, "PMFW") runs on a Tensilica Xtensa core (little-endian, windowed ABI). Verified on smu_13_0_0.bin:

  • ENTRY (0x36) = 1305 and RETW.N (0x1df0) = 1543 — windowed functions start with ENTRY, end with RETW.N (~1400 functions). RET.N = 3 (windowed ABI).
  • Not RISC-V: pure RV64 needs every insn low-2-bits=11 (~100%); this maxes at 33% (LE) / 58% (BE). RV64C decode is incoherent garbage.

Only the MEC/MES on this GPU are RS64/RISC-V. The SMU is Xtensa (as it has been on prior AMD GPUs). The tinygrad/7900xtx repo lists the SMU as "(RS64?)" — that question mark was correct; it's Xtensa.

Files

file what
smu_13_0_0_xtensa.elf runtime image (smu_13_0_0.bin, ucode v78.131.0 ≈ live 78.133.0). EM_XTENSA(94), ELF32 LE, base 0. Start here.
smu_13_0_0_runtime_body.bin raw body inside the ELF
smu_flash_xtensa.elf SMU copy from board SPI (spiflash.bin@0xb6c00), boot/older version, for diffing
smu_flash_code.bin raw SPI SMU body

How to load

  • Ghidra: recognizes EM_XTENSA and offers the Xtensa language (Xtensa:LE:32:default). Use that. (The tinygrad repo already uses Ghidra for RS64 — mec/make_ghidra_script.py.)
  • IDA: stock IDA has no Xtensa module — the current riscv session on port 13343 will NOT decode this. Load with a community Xtensa processor plugin, or reverse in Ghidra. (The .elf.id0/.id1/... files here are the stale riscv DB.)

Layout (offsets = addresses at base 0)

  • 0x000..0x100 SHA + $PS1 signed header
  • 0x100..0x1000 version/descriptor (version word repeated + a small table)
  • 0x1000..0x3800 code block 1 (boot/init) — dense ENTRY/RETW.N
  • 0x4000..0x1c000 data tables (~96 KB: DPM / PPTable / AVFS) — sparse
  • 0x1c000..0x40000 main code (~145 KB) — dense ENTRY/RETW.N The PSP loader strips $PS1 and loads the Xtensa image to MP1 IMEM (real base unknown; header load-addr field = 0). Base 0 works for PC-relative flow; rebase if L32R literal pointers need it.

Reversing hooks

  • Xtensa L32R (PC-relative backward literal loads) reveal absolute data/register addresses — follow them to find the SMU MMIO map.
  • Message dispatcher: the mailbox is C2PMSG_66=MSG / _82=ARG / _90=RESP (79 PPSMC_MSG_*, see tinygrad/runtime/autogen/am/smu_13_0_0.py). Find the poll of the MSG register and the switch on the message id — that gates the whole host-reachable surface we probed (e.g. GetVoltageByDpm's AVFS formula, the TransferTable* DMA path, SetDriverDramAddr).
  • Hardware oracle for correlating code↔behavior: probe_smu_*.py in ...