On 6 July 2018 at 02:24, Alistair Francis <alistai...@gmail.com> wrote: > I think the SoC device should map it's own ROM (it lines up more with > the physical SoC). > > I think that is how other SoC devices do it as well. I'm not really > sure what other address space to map it to.
I generally suggest the approach where the SoC object takes a MemoryRegion as a link QOM property. The board code puts the board-level devices into the system memory, and then passes that up to the SoC. The SoC creates a container MR, puts the thing it got passed by the board in as a background region, and then adds its own devices/ROMs/etc to the container. It also creates the CPU object(s). Then it passes the container to the CPU object. This approach broadly follows what the hardware does -- the SoC controls what goes where for the devices it is dealing with, but doesn't need to care what is outside it. Example in hw/arm/mps2-tz.c and probably others. thanks -- PMM