Is it possible to derive a memory map using a device tree, avoiding various hard-coded assumptions about regions?
I'm focusing on rpi4, mainly on qemu for now. I'd like to map the MMIO region and the Arm local peripheral regions based on the device tree, but the register blocks all seem to be fragmented, and some smaller than a page.
There doesn't seem to be a way of identifying them as larger regions.
Is this futile? Should I just hardcode per board I want to support?
Memory map from device tree
Re: Memory map from device tree
There is a memory node in the device tree, memory@0. According to the device tree source, the memory size will be filled in by the boot loader.
Carpe diem!
Re: Memory map from device tree
Thanks! I had no idea that the bootloader modified the device tree, but that section makes much more sense now.
Re: Memory map from device tree
So the memory block, as far as I can tell, indicates the memory available, but not other regions such as the MMIO region and the Arm local peripheral regions. Is there any way to extract them from the device tree, other than each individual node's regblock?