Imagination_BXE-2-32

Firmware trace and HWPerf

The firmware offers two observability channels: a circular trace (log events for debugging) and HWPerf (binary performance packets). Both go to shared-memory buffers that the host reads. With the mainline driver, only the trace is consumed: HWPerf is optional for a mainline-compatible reimplementation.

Provenance. Trace layout, groups, entry format and the host side: P (pvr_rogue_fwif.h, pvr_rogue_fwif_sf.h, pvr_fw_trace.c). Values seen at run time: O.

Firmware trace (rogue_fwif_tracebuf)

Entry format

Each entry is: one SFID word 0x70000000 | (n_params << 16) | (group << 12) | id, a 64-bit timestamp, then n_params 32-bit parameters. An entry is valid if (word & 0xFFF00000) == 0x70000000. The host decodes the SFID against the public table of format strings (pvr_rogue_fwif_sf.h), so the reimplementation must emit the SFIDs and parameter counts exactly as in that table for the host to print them. Group and id numbers used in these documents are listed in trace-ids.

Useful events for validation

Event (decoded text) Group / id Meaning
Kick TA / Kick 3D / Kick 3D TQ / Kick Compute MAIN 119 / 120 / 121 / 122 a data master was started
Client command header DM = …, client CCB = …, cmd = … MTS 9 dispatch of a cCCB command
cCCB Woff update = …, DM = …, FWCtx = … MAIN 14 the host updated a cCCB write offset
KCCB Slot …: Cmd=0x…, OSid=… / Return value … MTS 19 / 17 Kernel CCB command processed
HW poll … failed (reg:… val:…) HWR 13 hardware poll failed → HWR path
Discarded cmd on DM… FWCtx=… HWR 14 command discarded during HWR
GPU ready to be powered down / GPU deinit / GPIO disabled POW 6 / MAIN 144 / MISC 4 power-off sequence
Unknown Client CCB Command … MAIN 171 / 172 unknown command type in a cCCB

HWPerf

The trace is the main functional validation tool for the reimplementation: comparing the sequence of events (kicks, command headers, completions, power) with the expected one confirms the behaviour without looking at the original binary.