On Fri, 18 Jun 2021 at 11:09, Peter Maydell <peter.mayd...@linaro.org> wrote: > > On Thu, 17 Jun 2021 at 20:22, Peter Maydell <peter.mayd...@linaro.org> wrote: > > This will pick the first MR it finds that happens to be RAM (which > > could be some tiny thing). You don't want that, you want specifically > > whatever the board decided was the system RAM, which is the MemoryRegion > > MachineState::ram. > > As a concrete example, on the mps3-an547 machine this code finds > the 512KB ITCM at 0x0 rather than the much more useful 2GB DRAM > at 0x6000_0000...
Turns out that "look for MachineState::ram" won't find you the 2GB DRAM, though, because it's lurking behind a Memory Protection Controller so it doesn't appear directly in the flatview. Not sure what to do about that -- maybe we should forget about MachineState::ram and just go for "largest RAM we can see" ? Trying to get this code to be able to 'look through' IOMMUs sounds like it would be massively painful. -- PMM