boot-gpu-init)This document specifies the CR register programming sequence required by the PowerVR BXM-4-64 (36.56.104.183) silicon on the SpacemiT K3 on every cold boot, post-APM power-on (warm boot), and reinitialization after an HWR reset.
Critical notice (
[O][D]): The values below are specific to the BXM-4-64 (36.56.104.183,XE_TPU2,PBE2_IN_XE, 128 KiB SLC, 6 ISP pipes) silicon and differ from other Rogue Series B GPUs (such as BXE-2-32). Do not reuse initialization tables from another BVNC.
[D])The phases below respect hardware dependencies (power/clocks → MMU/SLC → execution bases and block setup → mandatory USC/TE internal init polls → final rendering/texture block setup → multicore/MTS → publishing firmware_started):
1. Clock gating (when DISABLE_CLKGATING_EN is active) and cluster/dust power-up (1 cluster)
2. Initial MMU cache invalidation (mask 0x1C) and SLC size detection via CR[0x3970]
3. PDS/USC execution bases and overalloc controls
4. Initial PDS/TPU configuration and mandatory internal init polls (0x4068 and 0x0CD8)
5. Memory/pipeline subsystem setup (BIF, PM, TE/PPP, ISP, PBE, and TPU XE_TPU2)
6. Multicore indices (0xF338 / 0xF318 / 0x0890)
7. Clearing pending events and MTS interrupt routing
8. Optional reg_cfg application and sysinit.firmware_started = 1 handshake with full barrier
[O][D])If sysdata.config_flags has ROGUE_FWIF_INICFG_DISABLE_CLKGATING_EN set:
BCAST[0x0000] = 0x15155555 (ROGUE_CR_CLK_CTRL lo)BCAST[0x0004] = 0x55555500 (ROGUE_CR_CLK_CTRL hi)BCAST[0xD200] = 0x00000511 (auxiliary clock control)runtime_cfg.default_dusts_num_init (1 on K3).BCAST[0x12A0] = 0x1C, polls until CR[0x12A0] == 0.CR[0x3970] ([O][D])On silicon 36.56.104.183 (SLC_SIZE_CONFIGURABLE = 1), the actual SLC size in KiB is read directly from hardware register CR[0x3970] (no public name in the mainline header):
Value read from CR[0x3970] (KiB) |
Action on BCAST[0x3828] (SLC_CTRL_BYPASS lo) |
Action on BCAST[0x382C] (SLC_CTRL_BYPASS hi) |
|---|---|---|
== 0 or <= 0x20 (≤ 32 KiB) |
\|= 0x01000000 |
\|= 0x00002000 |
0x21 .. 0x7F (33–127 KiB) |
\|= 0x01000000 |
&= ~0x00002000 |
>= 0x80 (≥ 128 KiB — K3 case) |
&= ~0x01000000 |
&= ~0x00002000 |
Why this matters on K3: The SpacemiT K3 has 128 KiB of SLC (
0x80). Clearing the bypass bits0x01000000(0x3828) and0x2000(0x382C) enables full SLC usage for all clients.
[P][D])struct rogue_fwif_sysinit)| Register (Broadcast) | Width | Value |
|---|---|---|
BCAST[0x0610] / BCAST[0x0614] |
64-bit | sysinit.pds_exec_base (lo / hi) |
BCAST[0x4008] / BCAST[0x400C] |
64-bit | sysinit.usc_exec_base (lo / hi) |
BCAST[0x4010] / BCAST[0x4014] |
64-bit | sysinit.usc_exec_base (lo / hi) |
BCAST[0x4028] / BCAST[0x402C] |
64-bit | sysinit.usc_exec_base (lo / hi) |
BCAST[0x6000] |
32-bit | 0x00000000 |
BCAST[0x4050] |
32-bit | temp_overalloc \| 0x2000 (USC overalloc control) |
BCAST[0x06D8] |
32-bit | shared_overalloc (PDS/shared overalloc control) |
Before triggering the USC bank and TE/PPP initialization polls, program the initial PDS control parameters and TPU tags:
BCAST[0x0600] = 0x94939300, BCAST[0x0604] = 0x00800000, BCAST[0x0608] = 0x01, BCAST[0x0630] = 0x01, BCAST[0x0640] = 0x07, BCAST[0x0648] = 0x01, BCAST[0x0658] = 0x1B, BCAST[0x0698] = 0x09, BCAST[0x06C0] = 0x1D, BCAST[0x0720] = 0x15.BCAST[0x18C0], BCAST[0x18C8], BCAST[0x18D0], BCAST[0x18E0] = 0x007FC000.Next, trigger and wait for the mandatory internal initialization polls:
BCAST[0x4068] = 1 → Mandatory poll: wait for CR[0x4068] bit 0 == 0 (USC bank initialization).BCAST[0x0660] = 1 and BCAST[0x0670] = 1 (PDS buffer initialization).BCAST[0x0CD8] = 1 → Mandatory poll: wait for CR[0x0CD8] bit 0 == 0 (TE/PPP initialization).36.56.104.183) ([D])After the 0x4068 and 0x0CD8 polls complete, configure the default values required by each subsystem of the BXM-4-64 (XE_TPU2 / PBE2_IN_XE) silicon:
| Register (Broadcast) | Operation / Value | Role |
|—|—|—|
| BCAST[0x13F8] | = 0x00000007 | BIF configuration |
| BCAST[0x0358] | = 0x00000005 | PM / Sidekick configuration |
| BCAST[0x0244] / BCAST[0x0240] | = 0x00000080 / = 0x00000000 | Initial PM control |
| BCAST[0x20F8] | = 0x00000001 | PM-MMU control |
| BCAST[0x2010], BCAST[0x2100] | = 0x00000000 | Initial PM-MMU state |
PBE2_IN_XE)| Register (Broadcast) | Operation / Value | Role |
|—|—|—|
| BCAST[0x0700], BCAST[0x0708] | = 0x00000001 | Auxiliary PDS control |
| BCAST[0x06B0], BCAST[0x0470] | = 0x00000000 | Initial PDS / VDM-CDM state |
| BCAST[0x1498] | = 0x00000001 | Pipeline control |
| BCAST[0x0C78] | = 0x00000088 | TE configuration |
| BCAST[0x0C90], BCAST[0x0C94] | = 0x3089705F | BXM-4-64-specific TE / PPP parameters |
| BCAST[0x0FA0] | = 0x00000088 | ISP configuration |
| BCAST[0x1500] | = 0x00000080 | PBE configuration (PBE2_IN_XE) |
| BCAST[0x15A0] .. BCAST[0x15DC] (16 dwords, stride 4) | = 0x00000000 | Zeroing of PBE / MRT state table |
XE_TPU2 + TPU_DM_GLOBAL_REGISTERS)| Register (Broadcast) | Operation / Value | Role |
|—|—|—|
| BCAST[0x1710] / BCAST[0x1714] | = 0x90000000 / = 0x00000000 | TPU / MCU control |
| BCAST[0x1780] | = 0x00000021 | Global TPU control |
| BCAST[0x1788], BCAST[0x178C] | = 0x00000020 | TPU parameters |
| BCAST[0x17B8] | \|= 0x00000002 | TPU enable (XE_TPU2) |
| BCAST[0x17C8], BCAST[0x17D0] | = 0x00000004 | TPU configuration |
| BCAST[0x1800], BCAST[0x1810] | = 0x00000020 | TPU configuration |
| BCAST[0x1850] | \|= 0x00000002 | Per-DM TPU control (TPU_DM_GLOBAL) |
| BCAST[0x1858] | \|= 0x00000002 | CDM TPU control (tpu_tag_cdm_ctrl) |
| BCAST[0x1870], 0x1874, 0x1878, 0x187C | = 0x00000020 | TPU parameters |
| BCAST[0x18E8], 0x18F0, 0x18F8, 0x1900 | = 0x0000000F | TPU / memory configuration |
[P][D])Reads n = CR[0xF308] (ROGUE_CR_MULTICORE_SYSTEM; on K3 MC1, n = 1):
i = 0 .. n - 1 (bank stride 0x80000):
CR[i * 0x80000 + 0xF338] = i (compute core index)CR[i * 0x80000 + 0xF318] = i (fragment core index)ROGUE_CR_XPU_BROADCAST (CR[0x0890] = (1 << n) - 1, on K3 = 1).[P][D])| Register | Public Macro | Value on K3 | Semantics |
|---|---|---|---|
BCAST[0x0138] |
ROGUE_CR_EVENT_CLEAR |
0x000041FC |
Clears pending boot events (CDM, 3D, TA, PM_OOM, PM_3D_MEM_FREE, ISP_ZLS_END, etc.) |
CR[0x0B58] |
ROGUE_CR_MTS_DM0_INTERRUPT_ENABLE |
0x00089200 |
Enables events on DM0 (GP): MMU_PAGE_FAULT (b9 = 0x200), GPIO_REQ (b12 = 0x1000), USC_TRIGGER (b15 = 0x8000), SLAVE_REQ (b19 = 0x80000) |
CR[0x0B68] |
ROGUE_CR_MTS_DM2_INTERRUPT_ENABLE |
0x000000A0 |
Enables events on DM2 (GEOM): TA_FINISHED (b5 = 0x20), PM_OUT_OF_MEMORY (b7 = 0x80) |
CR[0x0B70] |
ROGUE_CR_MTS_DM3_INTERRUPT_ENABLE |
0x00000008 |
Enables event on DM3 (FRAG): PIXELBE_END_RENDER (b3 = 0x08) |
CR[0x0B78] |
ROGUE_CR_MTS_DM4_INTERRUPT_ENABLE |
0x00000004 |
Enables event on DM4 (CDM): COMPUTE_FINISHED (b2 = 0x04) |
CR[0x0B40] |
ROGUE_CR_MTS_INTCTX_THREAD0_DM_ASSOC |
0x0000FFFF |
Associates all DMs with thread 0 interrupt context (HW1) |
CR[0x0128] |
ROGUE_CR_EVENT_ENABLE |
0x00000000 |
GPU events are routed via MTS (HW1), not directly to external IRQ |
CR[0x0B30] |
ROGUE_CR_MTS_BGCTX_THREAD0_DM_ASSOC |
0x00000001 |
Associates BG scheduling (HW0) with thread 0 |
firmware_started ([P][D])sysinit.reg_cfg_fw_addr, offset +0x14C), if present.ROGUE_CR_TIMER (CR[0x0160] lo, CR[0x0164] & 0xFFFF hi) and stores it in sysinit.firmware_started_timestamp (+0x168).sysinit → *(volatile u32 *)0xBFC01800 = 1 → ehb → sync → dummy read of CR[0x0020].sysinit.firmware_started = 1 (+0x160), flushes the cache line of firmware_started, writes 0xBFC01800 = 1, ehb, sync.sysdata.pow_state = ROGUE_FWIF_POW_ON, enables CP0 interrupts, and waits for work (WAIT).