lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

ARM Virtual address versus CPU Bus Address

Thu Dec 19, 2013 6:11 pm

On Broadcom datasheet page 5 there's a block diagram of translating real physical address from/to ARM Virtual address and CPU Bus address. There's a MMU(memory management Unit) between physical address and ARM Virtual address. Also between physical address and CPU Bus address.

I/O Peripheral starts at 0x2000 0000 at real physical address
at 0x7E00 0000 at CPU Bus address
at 0xF200 0000 at ARM Virtual address.

On a C code

Code: Select all

gpio = (uint32_t *)mmap(mapaddr, BCM2835_BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, fd, BCM2835_GPIO_BASE)
BCM2835_GPIO_BASE is expressed in physical address
#define BCM2835_PERI_BASE 0x20000000
so, there's MMU translating physical to ARM Virtual Address in the C Program.

My question when do you use CPU Bus address like it listed in the Datasheet?

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: ARM Virtual address versus CPU Bus Address

Fri Dec 20, 2013 4:47 pm

Software directly access peripherals must use virtual address
Software access peripheral using DMA must use bus address
Software access RAM directly must use physical address.

Return to “Advanced users”