Imagination_BXE-2-32

Execution environment (MIPS core)

ISA and ABI

The image is delivered as an ELF with code/data sections, packed into a .fw container (see memory-model for the header and layout table the host reads).

Boot sequence

  1. The host loads the firmware sections into DRAM, builds the MIPS page tables and the wrapper remap registers (see memory-model), fills the BOOT_DATA block with physical addresses (page tables, stack, register bank), sets rogue_fwif_sysinit.firmware_started = false, and releases the MIPS core from reset.
  2. The MIPS starts at the reset/NMI vector at 0xBFC00000 (KSEG1, uncached). Early boot:
    • initialises CPU state (CP0) and the caches;
    • sets up the fixed (wired) TLB entries for the register bank, page tables, stack and private data;
    • jumps to the main initialisation.
  3. Main initialisation:
    • programs the CP0 performance counters (PerfCtl0/1) from rogue_fwif_sysinit.firmware_perf;
    • sets up the remap for the fault page (rogue_fwif_sysinit.fault_phys_addr);
    • enables the wrapper interrupts (ROGUE_CR_MIPS_WRAPPER_IRQ_ENABLE, 0x08A0);
    • takes the configuration flags from sysinit/osinit and the initial core clock from rogue_fwif_sysinit.initial_core_clock_speed;
    • initialises its subsystems (shared data, GPU, timers, BIF, scheduler — see scheduler);
    • sets rogue_fwif_sysinit.firmware_started = true (and firmware_started_timestamp). The mainline host polls this flag and treats the boot as failed if it is not set within 5 s (P);
    • enters a permanent WAIT.

Important: reset/NMI is also the warm-boot path. During power management (see power-management) the host may restart the firmware, which re-enters at 0xBFC00000. On an NMI the firmware first saves the MIPS state into its private BOOT_DATA area, for diagnosis.

There is no main loop

After WAIT, all work happens in three interrupt sources:

Source Vector Responsibility
HW0 — timer 0x9FC02400 CP0 Count/Compare expiry. Sets a “tick pending” flag and schedules a background task. Does no work in the ISR.
HW1 — BG task (MTS) 0x9FC02500 Processes all Kernel CCB commands; HWR watchdogs; expired timers; re-evaluates the contexts on each DM’s wait list; SPM list.
HW2 — IRQ task (MTS) 0x9FC02600 Reads ROGUE_CR_EVENT_STATUS: MMU faults, per-DM completion (geometry/3D/compute/USC), multicore XPU events; runs the scheduler; triggers HWR and power management; updates utilisation.

“MTS” is the RGX hardware’s Micro Task Scheduler, which delivers the BG and IRQ tasks to the MIPS as interrupts. The firmware schedules a BG task by writing ROGUE_CR_MTS_SCHEDULE = 0.

Interrupt model (CP0)

Timers

Timers are used for: the context-switch watchdog (HCS), the power deadline (APM latency), health checks, and operation timeouts.

Caches and TLB

TLB (16 entries)

Caches (D-cache / I-cache)

Write barrier (host↔FW visibility)

Before publishing data to the host or raising an interrupt to the host, the firmware runs a deterministic barrier:

  1. writes 1 to an uncached word reserved for this purpose (in the private part of the BOOT_DATA page, see memory-model);
  2. EHB (execution hazard barrier);
  3. SYNC;
  4. reads the barrier word back;
  5. reads ROGUE_CR_CORE_REVISION (offset 0x20) — a register read that forces ordering on the bus.

Only then does it write the host-visible offset/value or raise ROGUE_CR_MIPS_WRAPPER_IRQ_STATUS (0x08A8).

MIPS performance counters

CP0 PerfCnt0/1 (configured through PerfCtl0/1 from sysinit.firmware_perf) can be sampled into HWPerf data. HWPerf is optional for the mainline target (see hwperf-trace).

Shader (USC) breakpoints

Firmware-only registers, programmed through XPU broadcast, allow breakpoints in USC shaders: 0x4030 address, 0x4038 handler, 0x4040 control (bits 2:0 slot/DM, bit 3 enable), 0x4050/0x06D8 temporaries (D, no public names). They are enabled per memory context (rogue_fwif_fwmemcontext.breakpoint_addr, bp_handler_addr, breakpoint_ctl) through the KCCB BP command. See kernel-ccb.