Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7512

Bare metal, Assembly language • Re: System MMU existence/location on Pi 4B

$
0
0
broadcom would tell you but theyd have to kill you
i'm not broadcom and i can tell you!

https://github.com/librerpi/lk-overlay/ ... #L421-L434

Code:

#define ARM_BASE                (BCM_PERIPH_BASE_VIRT + 0xB000)#define ARM_TRANSLATE (ARM_BASE+0x100)// maps a 16mb chunk of ram// the bus address has a resolution of 2mb// the arm addr has a resolution of 16mb// the entire mapping is 16mb long// comments say there are 32 slots in the list (512mb mapped) an another 32 spare (1gig mapped)void mapBusToArm(uint32_t busAddr, uint32_t armAddr) {  volatile uint32_t* tte = REG32(ARM_TRANSLATE);  uint32_t index = armAddr >> 24; // div by 16mb  uint32_t pte = busAddr >> 21; // div by 2mb  //printf("mapBusToArm(0x%x, 0x%x) index:%x, pte:%x\n", busAddr, armAddr, index, pte);  tte[index] = pte;}
this is how it worked on the pi0-pi3, you have 64 pages of 16mb each, and that configures the mapping from "arm physical" to the VC4 bus
only the VPU can configure it, and 99% of the time, you dont need to mess with any of it

just use the standard arm mmu at the usual location

Statistics: Posted by cleverca22 — Fri Sep 05, 2025 8:29 pm



Viewing all articles
Browse latest Browse all 7512

Trending Articles