Boot and runtime
This page traces the firmware from MIPS reset release through TLB setup, GPU bring-up, dynamic TLB refill, fatal exceptions and debug scratch mailboxes. See Memory model and MIPS remap for the hardware translation model and MIPS virtual address map.
BOOT_DATA private area (0xBFC01000 + 0x800)
boot.S and the TLB refill handler run before a stack exists (or with only
$26/$27 free), so they store private state in the unmapped KSEG1
BOOT_DATA page above the host’s public 0x00..0x3F header:
Offset |
Symbol |
Use |
|---|---|---|
|
|
Uncached word written and read back by |
|
|
Next dynamic TLB slot (round-robin |
|
|
Remap high word of the host fault page (for invalid PTEs) |
|
|
Count of refills that hit an invalid PTE |
|
|
Last exception snapshot |
|
|
Nested-fault guard |
|
|
Progress marker ( |
|
|
Number of TLB refills |
|
|
Refill handler register save area (8 words) |
|
|
Register dump on a fatal exception |
Boot markers are mirrored to scratch register 0x1A00 so the host can
inspect boot progress live via tools/gpu-regs.py.
Boot sequence (src/bvnc/36.29.52.182/boot.S)
Every boot — cold or warm after runtime PM — executes the full sequence from
0xBFC00000:
Marker |
Step |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Invalidate all 16 TLB entries with unique KSEG0 VPNs |
|
Wired TLB entry 2: core register bank |
|
Map the 4 host page-table pages from |
|
Read the two stack PTEs from the page table, program remap entries
3 and 19, and install wired TLB entry 3 at |
|
|
fw_entry (in .text, mapped on demand by the refill handler) clears
.bss and calls fw_main(), which emits markers 0xC0DE0004..6,
runs gpu_power_on() and gpu_units_init() in src/gpu_init.c
(GPU bring-up), publishes firmware_started = 1,
arms the 1 ms timer, processes any queued KCCB entries and enters WAIT.
Dynamic TLB refill and flush (src/bvnc/36.29.52.182/vectors.S)
refill_main (+0x000 → +0xA00) handles misses in 0xC0xxxxxx:
Save
$1,$8–$13inBD_SAVE; incrementBD_REFILL_COUNTand scratch0x1A08; record missed VA in0x1A10.Align VA to the even page of the pair and look up both PTEs in the host page table at
0xCF000000(index(VA & 0x00FFF000) >> 12). Any VA outside0xC0xxxxxxor with invalid PTE bit 1 is redirected toBD_FAULT_HI(the host fault page) and counted inBD_FAULT_COUNT.Pick slot
BD_TLB_NEXT(round-robin5..15), write remap entriesslotandslot + 16, and read backCORE_REVISIONto drain posted writes.Install the identity TLB entry with
tlbwi, restore registers andERET.
tlb_flush_dynamic() runs from the unmapped KSEG0 exception page
(required by E003) whenever KCCB_MMUCACHE or KCCB_POW
OFF_REQ invalidates dynamic mappings, clearing TLB entries
Wired..15 and disabling their remap entries.
Fatal exceptions
Any exception other than a TLB refill or interrupt vectors to +0x180 →
general_main:
Record
Cause,EPCandBadVAddrinBOOT_DATAand scratch registers0x1A18/0x1A20/0x1A28.On a nested fault, halt in a
WAITloop.Otherwise switch to the top of stack with
EXL/ERL/IE = 0and callfatal_exception(), which setsHWR_FW_FAULTinsysdata.hwr_state_flags, incrementsfw_faults, emits traceDBG_4 (0xDEAD00cc, EPC, BadVAddr)and interrupts the host.
Debug scratch registers (0x1A00–0x1A78)
ROGUE_CR_SCRATCHn (0x1A00 + 8n) serve as host-readable telemetry
while the GPU power domain is active:
Register |
Name |
Meaning |
|---|---|---|
|
|
Boot progress: |
|
|
Dynamic TLB refill count |
|
|
Last missed VA |
|
|
Fatal exception |
|
|
High words of PDS/USC exec bases read back after |
|
|
Counts of HW0 / HW1 / HW2 interrupts (E016) |
|
|
|
|
|
Bitwise OR of all events handled by |
|
|
Completed hardware recoveries |
|
|
BG tasks entered with a DM completion pending (E018) |
|
|
Bitmask of currently busy data masters |