On Tue, 6 Feb 2024 at 19:21, Philippe Mathieu-Daudé <phi...@linaro.org> wrote: > > Hi Peter, > > On 6/2/24 14:29, Peter Maydell wrote: > > The AN536 is another FPGA image for the MPS3 development board. Unlike > > the existing FPGA images we already model, this board uses a Cortex-R > > family CPU, and it does not use any equivalent to the M-profile > > "Subsystem for Embedded" SoC-equivalent that we model in hw/arm/armsse.c. > > It's therefore more convenient for us to model it as a completely > > separate C file. > > > > This commit adds the basic skeleton of the board model, and the > > code to create all the RAM and ROM. We assume that we're probably > > going to want to add more images in future, so use the same > > base class/subclass setup that mps2-tz.c uses, even though at > > the moment there's only a single subclass. > > > > Following commits will add the CPUs and the peripherals. > > > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > > --- > > MAINTAINERS | 3 +- > > configs/devices/arm-softmmu/default.mak | 1 + > > hw/arm/mps3r.c | 239 ++++++++++++++++++++++++ > > hw/arm/Kconfig | 5 + > > hw/arm/meson.build | 1 + > > 5 files changed, 248 insertions(+), 1 deletion(-) > > create mode 100644 hw/arm/mps3r.c > > > > +static MemoryRegion *mr_for_raminfo(MPS3RMachineState *mms, > > + const RAMInfo *raminfo) > > +{ > > + /* Return an initialized MemoryRegion for the RAMInfo. */ > > + MemoryRegion *ram; > > + > > + if (raminfo->mrindex < 0) { > > + /* Means this RAMInfo is for QEMU's "system memory" */ > > + MachineState *machine = MACHINE(mms); > > + assert(!(raminfo->flags & IS_ROM)); > > + return machine->ram; > > + } > > + > > + assert(raminfo->mrindex < MPS3R_RAM_MAX); > > + ram = &mms->ram[raminfo->mrindex]; > > + > > + memory_region_init_ram(ram, NULL, raminfo->name, > > You are not using the parent=mms, is that deliberate? > (as in: easier to migrate eventually?)
No, I didn't have a particular reason for not setting the parent; I just copied this bit of code from mps2-tz.c, which also doesn't set the parent pointer... -- PMM