SonicWave wrote: ↑
Wed Mar 28, 2018 8:46 pm
The document only says that "Software accessing RAM directly must use physical addresses (based at 0x00000000)", but how far does it range?
Raspberry Pi A+/B+/Zero/ZeroW - 512MB from 0x00000000 to 0x1FFFFFFF
Raspberry Pi 2B/3B/3B+ - 1024MB from 0x00000000 to 0x3FFFFFFF
If you are accessing it in bare metal then the memory is one contiguous block from start to finish, if you are using Linux then none of that is true because it virtualizes the address space.
BUT there are two things you also need to allow for:
1. GPU memory is somewhere in the upper part of the range, you can ask the GPU for the exact start and size via the mailbox interface.
2. The peripherals (GPIO, DMA, I2C, SPI etc) are at the top of the address range, 0x20000000 on PI A+/B+/Zero/Zero and 0x3F000000 on the PI 2B/3B/3B+ so in one case they don't matter in the other case they do.
Hope that helps.