Epic: #113 · Milestone: MC2 — Pi 5 bring-up
Why
kernel/src/arch/arm64/arm64.home is 40 lines: mmio_read32 returns 0, mmio_write32/nop/wfe/wfi are empty. This is stub S8 in the register ("every ARM64/Pi driver is inert"). Worse, most Pi drivers bypass it: bcm_emmc.home, gpio.home, i2c.home, spi.home use core/memory.home raw derefs, and arch/arm64/rpi5.home uses Zig-era @as(*volatile u32, @ptrFromInt(...)).
Tasks
- Implement
mmio_read{8,16,32,64}/mmio_write{…}over the A3 intrinsics with the documented barrier policy (write →dmb oshstbefore DMA doorbells; read of status regs →dmb oshldafter). read_sysreg/write_sysregwrappers for the registers the MMU/GIC/timer code uses;wfe,wfi,sev,isb,dsb sy,ic iallu,tlbi vmalle1.- Codemod every driver under
kernel/src/rpi/,kernel/src/arch/arm64/,kernel/src/drivers/{bcm_emmc,gpio,i2c,spi,pwm}.hometo thearm64.mmio_*API; forbid raw MMIO derefs via a static check (static-checks/no-raw-mmio.sh) that fails CI outsidearm64.home. - Remove the
// STUB(S8)marker and update MASTER_PLAN §7 +scripts/stub-check.shexpectations.
Acceptance
stub-register job passes with S8 closed; a GPIO LED toggle (gpio shell command through RP1, see #72) or the UART itself proves reads return real values on hardware.
Size: M · Depends on: #53 · Blocks: #58, #61, all MC3 drivers