Imagination_BXM-4-64

On-Board Observed Sequences, Measurements, and Open Gaps

This document consolidates the empirical evidence collected on a real SpacemiT K3 Pico ITX board (36.56.104.183), the platform pitfalls discovered during hardware testing, and the known gaps requiring attention from the clean-room team.


1. Scenarios Validated on Real Hardware ([O])

All scenarios below were executed and captured on the BXM-4-64 GPU of the SpacemiT K3 Pico ITX:

# Scenario Observed Behavior on Board
1 Cold Boot CORE_ID__PBVNC (0x0020) = 0x00240038006800B7 (36.56.104.183), CORE_REVISION (0x0028) = 0x00010000, SLC_IDLE (0x3898) = 0xFF, CR_TIMER active; firmware_started = 1 handshake completed in ~1–2 ms
2 Warm Reinit (APM) After 100 ms idle (active_pm_latency_ms), the GPU enters POW_IDLE → POW_OFF; a new workload powers the GPU back on and completes reinitialization in < 2 ms without recreating contexts
3 Full 3D Render (TA + 3D) Execution of GLES/Vulkan scenes (GEOM DM2 → FRAG DM3) with ISP_CTL = 0x8003500F (6 active ISP pipes), PBE, and ZLS; frames delivered without artifacts or lockups
4 Compute (CDM, DM4) Compute kernel dispatch on DM4 with BCAST[0x1858] (tpu_tag_cdm_ctrl) and UFO/fence updates; triggers DVFS scaling
5 Transfer / Readback (3D-TQ, DM3) Surface copies and readbacks via CCB_CMD_TYPE_TQ_3D on DM3 (confirming absence of TLA/TDM on K3)
6 Cooperative Preemption (CSW) Two concurrent processes competing for the GPU triggered valid hardware CSW store/resume events with no state loss or rendering errors
7 KickSync Null CCB_CMD_TYPE_NULL processed without touching DM hardware, signaling UFOs/Sync Checkpoints directly
8 HWR Watchdog Periodic deadline checks operating with threshold HWRChecksToGo = 24 under long load with no false positives
9 DVFS / OPPs clk_rgx starts at 409.6 MHz (800 mV) at idle and scales up to 1228.8 MHz (950 mV) under sustained compute/3D load
10 HWPerf Collection of 830 continuous periods with V2B stream and 6 configured mux blocks (TA_Blk, RASTER_Blk, HUB_Blk, TPU_MCU_ALL, USC_ALL, PBE_ALL)
11 DM2/DM3/DM4 Overlap TA + CDM and 3D + CDM ran concurrently at equal priorities; at different priorities the lower-priority context waited (priority-based admission — scheduler.md §5). FRAG’s PREVENT_CDM_OVERLAP held back CDM when requested
12 Discarded Geometry / HWR A FRAG targeting an HWRTData in HWR (9) state did not trigger a 3D kick: PM load was rejected and the command was discarded without a bus error (hardware-recovery.md §4.1)
13 Occlusion Query With GET_VIS_RESULTS, the firmware programmed CR[core+0x0FC0/0x0FC4] per core and the host read back the counters; no extra ISP_CTL registers were touched
14 Teardown with FORCE_UPDATE Checkpoints still at 0xAC1 transitioned to 0xEFF (errored) and the client woke up; normal UPDATEs published 0x519 (signaled)
15 Vulkan vkfwtest Suite (50 tests) Baseline on K3 board (vkfwtest -k -L 30 all): 47 pass, 1 fail (rta), 0 timeout, 0 lost, 0 error, 2 skip (local-read, suspend-after) — covering 18/20 render (incl. multiframe, pre-ta, bigpb, bigpb-layers, input-attach), 8/8 secondary, 4/4 compute, 5/5 transfer, 2/2 texture, 2/2 sync, 2/2 memory, 1/1 robust, 1/2 power, and 4/4 stress (stress, soak, churn, ctx-switch)

2. Active Register Snapshot Observed on K3 ([O])

Actual values read directly from MMIO 0xCAC00000 on the K3 board with the GPU active:

Offset Public Register Observed Value Confirmed Interpretation
0x0020 ROGUE_CR_CORE_ID__PBVNC 0x00240038006800B7 BVNC 36.56.104.183
0x0028 ROGUE_CR_CORE_REVISION 0x00010000 Revision 1.0
0x0030 ROGUE_CR_DESIGNER_REV_FIELD1 0x00000000 Standard revision
0x0130 ROGUE_CR_EVENT_STATUS 0x00000000 (at idle) Events cleared by HW1 handler
0x0160/0x0164 ROGUE_CR_TIMER Continuous 48b increment Internal clock operational
0x0B58 ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE 0x00089200 MMU_FAULT | GPIO | USC_TRIG | SLAVE_REQ
0x0B68 ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE 0x000000A0 TA_FINISHED | PM_OOM
0x0B70 ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE 0x00000008 PIXELBE_END_RENDER
0x0B78 ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE 0x00000004 COMPUTE_FINISHED
0x0F38 ROGUE_CR_ISP_CTL 0x8003500F 6 ISP pipes enabled in 3D render
0x3898 ROGUE_CR_SLC_IDLE 0x000000FF All 8 internal SLC subunits idle (CBAR, BIF1_CONV, VXD_CONV, VXE_CONV, FRC_CONV, RBOFIFO, CACHE_BANKS, IMGBV4) — do not confuse with number of banks (SLC_BANKS = 1)!
0xF308 ROGUE_CR_MULTICORE_SYSTEM 0x00000001 1 physical core (MC1)

3. Platform Pitfalls on SpacemiT K3 ([O])

  1. SLC_IDLE = 0xFF vs SLC_BANKS = 1: the 8 active bits of 0x3898 represent the 8 internal SLC subunits, whereas the hardware has 1 bank of 128 KiB (CR[0x3970] >= 0x80).
  2. BRN 63553 Workaround (MIPS_ADDR_REMAP5): without REMAP5 mapping 0x0 → boot code (64 KiB), the K3’s 36-bit physical bus fails during MIPS startup.
  3. 0xBFC01800 + ehb + sync Barrier: on K3, the GPU is not dma-coherent with the RISC-V cores; omitting the MIPS wrapper write barrier before signaling firmware_started = 1, updating UFOs, or advancing fwccb_ctl.write_offset causes intermittent timeouts or stale data on the host.
  4. Reset and Fast Firmware Reload on K3: when the GPU is healthy, the .fw image can be reloaded in ~0.2 s via unbind/bind of the cac00000.imggpu device in sysfs without rebooting Linux. However, if a job gets stuck (GPU timeout), unbind hangs and requires a controlled restart (sysrq or power-cycle). In addition, a software reboot while the legacy graphics driver is loaded can leave the SoC without console and without USB gadget until a physical power-cycle.
  5. K3 (36.56.104.183) vs K1 (36.29.52.182) Differences: never blindly copy initialization tables from BXE-2-32 — the K3 differs in ISP pipe count (6 vs 4), SLC detection (0x3970), CDM TPU register (0x1858), and several PDS/TE/TPU/PBE unit defaults (boot-gpu-init.md).

4. Open Gaps and Pending Validation Items

For full transparency with the clean-room team, the following secondary items have partial coverage or require dedicated on-board validation during milestone M6:

Area Current Status Clean-Room Implementation Recommendation
Extreme SPM / Partial Render on K3 board OOM path complete at the register level (partial-render-spm.md + power-management.md): EVENT_STATUS[7] event, freelist selection by HWRTData.flags[8], use of ready_pages (+0x30), ack CR[0x0328] = 1, and the no-reserved-pages path (CR[0x0320] = 1 + TA_TERMINATE poll). Only on-board stress testing with reduced max_pages remains Implement ready_pages + grow first; then Partial Render (0x0338 = 1) and test with an artificially small max_pages
Multi-OSID Virtualization (OSID 1..7) Hardware supports 8 OSIDs, but on K3 Linux only OSID 0 is exercised Implement full OSID 0; keep tables indexable by osid for structural compatibility
Work Estimation (work_est) Structures present in the ABI header, optional use for advanced DVFS Can start as a safe no-op (using only gpu_util_fwcb for DVFS)
Shader Breakpoints (KCCB_CMD_BP) Shader debugging only Can return CMD_EXECUTED as a no-op in milestones M1–M5
HWR fast signatures Per-DM progress counters confirmed: TA 0x6020, 3D 0x6028, CDM 0x6030 (per-core sampling with delta). The full check uses descriptor tables in the DM state (selector + read, accumulated into a CRC), whose contents have not yet been extracted Use 0x6020/0x6028/0x6030 + time deadline; detailed CRC is optional (M6)
ROGUE_CR_SOFT_RESET polarity Corrected: 1 = reset asserted, 0 = released (the host driver writes MASKFULL to “set Rogue in soft-reset”). The value 0xFFEFFFF8F3FFFC1D keeps SYSARB, TLA, SLC, CPU/GARTEN, BIF1, and MMU out of reset Never treat 0 as reset: 0 releases all blocks
Config.K0 Corrected: K0 = 3 is cacheable (write-back); 2 is uncached. Thus kseg0 (exception code) executes cached and kseg1 (boot) is uncached by architecture Enable cache in kseg0; keep kseg1 uncached
Interrupt vectors Resolved: Cause.IV = 1 + IntCtl.VS = 8 → vectored interrupts every 256 B: IP2 (timer) at EBase+0x400, IP3 (BG) at +0x500, IP4 (IRQ) at +0x600 (with ei in the BG delay slot, allowing preemption). +0x200 (vector 0/SW) is unused Implement the three vectors at these offsets, with the frame and ack (Compare for timer; CR[0x0B08] for IRQ)
Vendor vs. mainline sysinit Extra fields of the DDK 24.2 sysinit block fall outside mainline struct rogue_fwif_sysinit (sizeof = 0x220) Use only the mainline ABI fields (data-structures.md)
DM admission rules Resolved: serialized mode (DISABLE_DM_OVERLAP), strict priority, and per-command vetoes documented; the per-core exception and SINGLE_CORE mode come from the command’s flags word Implement the admission test before programming the DM (scheduler.md §5)
Per-DM flush masks Resolved: complete sequence (16 steps) per DM in data-masters.md §4.1, including SLC_CTRL_FLUSH_INVAL (2/6/8) and polls Copy the table; there is no “generic DM flush”
Multi-PR / final 3D Resolved: 1st and 2nd+ PR are identical in registers; final 3D uses pds_pr_bgnd and sets PROCESS_EMPTY_TILES (partial-render-spm.md §3.1) Implement the is_pr distinction
On-demand backing Resolved: FWCCB_CMD_ZSBUFFER_BACKING (0x65/0x2ABC0065, PRBUFFER_BACKING in DDK 24.2), ack via KCCB_CMD_ZSBUFFER_BACKING_UPDATE (0x6C), descriptor states, and application in the ZLS kick See partial-render-spm.md §5
Secondary EVENT_STATUS bits Resolved: bit 15 (USC_TRIGGER) → clears 0x8000, increments counter, and writes CR[0x08A8] = 1; bit 12 (GPIO_REQ) → GPIO handler; bit 9 (MMU_FAULT) → HWR; bits 8/14 (3D timeouts) → clears and restores 0x03E0 Implement dispatch by DM mask (0x89200/0xA0/0x8/0x4)