Memory model and MIPS remap
The MIPS microcontroller sees a 32-bit virtual address space while the GPU system bus is 36 bits wide and the GPU shader/data-master units address a 40-bit virtual space (docsClean/BXE-2-32/memory-model). The host manages all MIPS page tables; the firmware bridges 32-bit VA to 36-bit bus PA through the MIPS TLB and the RGX wrapper remap registers.
Two-stage MIPS address translation
Every mapped MIPS access goes through two hardware translation stages:
MIPS TLB (16 entries, 4 KiB or 1 MiB page pairs). Every entry is programmed as a 1:1 identity map (
PFN = VA >> 12, dirty, valid, global). The TLB only marks a page as present and selects a slotn(0..15).Wrapper remap table (
ROGUE_CR_MIPS_ADDR_REMAP_RANGE_CONFIG,0x0878/0x087C). It has 32 entries, each mapping one 4 KiB page of MIPS “physical” address to a 36-bit bus address. Entrynserves the even page of TLB slotn, and entryn + 16serves the odd page.
Bitfield layout and write order (Q3, [spec] + E003):
RANGE_CONFIG[31:0] (0x0878) = BASE_ADDR_IN | (REGION_SIZE << 7) | (ENTRY << 1) | MODE_ENABLE
RANGE_CONFIG[63:32] (0x087C) = OS_ID | ((bus_pa >> 12) << 4)
Write order (mandatory):
1. CR[0x0878] = low word (even page, ENTRY = slot)
2. CR[0x087C] = high word (even page)
3. CR[0x0878] = low word (odd page, ENTRY = slot + 16, VA + page_size)
4. CR[0x087C] = high word (odd page)
5. (void)CR[0x087C] (or CORE_REVISION) — read-back flushes posted writes
Because the low word carries MODE_ENABLE (bit 0) and ENTRY, writing
low then high installs that entry; reading back 0x087C drains posted
writes before the mapping is used. To disable an entry, clear bit 0 and write
high = 0.
Fixed host-programmed remaps
Before releasing the MIPS from reset, the host programs fixed wrapper remaps
(MIPS_ADDR_REMAP1..5_CONFIG1/2 at 0x0818..0x0860, E007) for
the unmapped KSEG0/KSEG1 regions:
0xBFC00000(4 KiB, KSEG1): boot code (reset/NMI vector);0xBFC01000(4 KiB, KSEG1; cached alias0x9FC01000):BOOT_DATA;0x9FC02000(4 KiB, KSEG0): exception/interrupt vectors (EBase).
The register banks at 0xCF800000 (core bank) and 0xCFA00000 (XPU
broadcast bank) are decoded directly by the wrapper and need wired TLB
entries only (no remap entries).
MIPS virtual address map
VA |
Size |
Contents |
Translation |
|---|---|---|---|
|
4 KiB |
|
KSEG0, unmapped; host fixed remap |
|
4 KiB |
Boot / NMI code (reset vector) |
KSEG1, unmapped; host fixed remap |
|
4 KiB |
|
KSEG1, unmapped; host fixed remap |
|
64 KiB |
Main firmware code and rodata (code object, offset |
Dynamic TLB (slots 5–15) |
|
64 KiB |
Private data and |
Dynamic TLB (slots 5–15) |
|
4 KiB |
OS 0 connection page ( |
Dynamic TLB |
|
— |
|
Dynamic TLB (slots 5–15) |
|
— |
|
Dynamic TLB (slots 5–15) |
|
16 MiB |
Shared firmware heap (CCBs, contexts, trace, HWR buffers) |
Dynamic TLB (slots 5–15) |
|
16 KiB |
Host MIPS page table (4 physical pages from |
Wired TLB entries 0 and 1 |
|
8 KiB |
Firmware stack (backed by data object |
Wired TLB entry 3 |
|
2–4 MiB |
RGX core 0 register bank (core n at |
Wired TLB entry 2 |
|
2 MiB |
XPU broadcast register bank (writes all cores enabled in
|
Wired TLB entry 4 |
Heap window and per-OS virtualisation
Shared-memory pointers (fw_addr) live in a 16 MiB window per OSID
(docsClean/BXE-2-32/memory-model):
Parameter |
ABI value |
|---|---|
Window size per OSID |
16 MiB (8 OSIDs supported: |
|
|
|
|
Mandatory VA mask |
|
Valid-address predicate |
|
Host MIPS page table and fault page
The host fills the 4-page MIPS page table at 0xCF000000 in MIPS
EntryLo format (pvr_vm_mips.c, [public]):
pfn = (VA - 0xC0000000) >> 12
PTE = ((dma_addr >> 12) << ENTRYLO_PFN_SHIFT) & pfn_mask | pte_flags
On the 36-bit BXE-2-32 bus, the >32-bit pfn_mask puts the 24-bit PFN in
bits 29:6 (PA = ((pte >> 6) & 0xFFFFFF) << 12) and bit 1 = valid.
Fault page redirection: any refill hitting an address outside
0xC0xxxxxxor an invalid PTE (or aMod/TLBL/TLBSfault) is diverted tosysinit.fault_phys_addrso reads return harmless data and writes are discarded instead of locking up the bus. In the reference firmware[spec], it also records fault metadata and raisesEVENT_STATUS.MMU_PAGE_FAULT/CONTEXT_FW_PF_NOTIFICATIONfor HWR.Dynamic TLB flush constraint (E003): invalidating non-wired TLB entries (assigning unique unused KSEG0 VPNs, clearing
EntryLo0/1, and disabling remap pairsslot/slot + 16) must execute from an unmapped page (the KSEG0 exception page at0x9FC02000); running it from mapped code disables the remap of the executing page itself.Temporary GPU-memory windows
[spec]: before mapping arbitrary GPU memory into a temporary window (Vulkan robustness, RTC bitmap, zeroing), the firmware invalidates dynamic TLB entries first and checksMMU_PAGE_FAULT.
GPU BIF / MMU and catalogue slots
GPU data masters translate 40-bit GPU virtual addresses through the Bus
Interface (BIF) MMU. Eight page-catalogue registers
ROGUE_CR_BIF_CAT_BASE0..7 (0x1200 + 8n) hold 4 KiB-aligned physical
addresses (pc & 0xFF_FFFF_F000):
Slot 0 is reserved for the firmware itself and is never assigned to client memory contexts.
Slots 1–7 hold client
rogue_fwif_fwmemcontext.pc_dev_paddrbindings (traceSetup register set = Ncorresponds toCAT_BASE{N+1}and index valueN + 1,[spec]).A slot holding the same page catalogue is reused without MMU invalidation; a slot in use by a busy DM must never be evicted.
Each DM selects its slot via ROGUE_CR_BIF_CAT_BASE_INDEX (0x1240):
Data master |
Bit field in |
Notes |
|---|---|---|
|
bits 2:0 (shift 0) |
Bound before PM / TA writes (E034) |
|
bits 10:8 (shift 8) |
Mandatory before any ISP/PBE write |
|
bits 18:16 (shift 16) |
Verified in E006 ( |
|
bits 21:19 (shift 19) |
Unused by Mesa on BXE-2-32 |
Cache and MMU invalidation order
Before invalidating the BIF MMU (ROGUE_CR_BIF_CTRL_INVAL = 0xF: bit 0
PT, bit 1 PD, bit 2 PC, bit 3 TLB1) or binding a new page
catalogue into a slot, flush and invalidate the 16 KiB SLC
(SLC_CTRL_FLUSH_INVAL → poll SLC_STATUS0 bit 2). Omitting this flush
can cause the first job of a new memory context to fault on its USC shader
fetch (E015).
Bus security and fault reporting
ROGUE_CR_SYS_BUS_SECURE(0xA100): cleared by the host whenSYS_BUS_SECURE_RESETis set in device info (E001), and cleared again (write0+ read back) during GPU power-on.ROGUE_CR_BIF_FAULT_READ(0x13E0): set tosysinit.fault_phys_addrso faulting GPU units read the dummy page.BIF_FAULT_BANK0_MMU_STATUS(0x12B0) andBIF_FAULT_BANK0_REQ_STATUS(0x12B8): report the faulting address, catalogue slot and requestor. Under BXE-2-32’sXE_MEMORY_HIERARCHYlayout ([public], vendorrgxmhdefs_km.h),REQ_STATUSencodesTAG_SBin bits 51:46 andTAG_IDin bits 45:40 (e.g.0x25= IPF control request,0x30= PM allocation unit,0x31= PM deallocation unit).