On 10/20/19 3:56 PM, Philippe Mathieu-Daudé wrote:
> static void n8x0_init(MachineState *machine,
> struct arm_boot_info *binfo, int model)
> {
> - MemoryRegion *sysmem = get_system_memory();
> + MemoryRegion *sdram = g_new(MemoryRegion, 1);
> struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s));
> - int sdram_size = binfo->ram_size;
> + uint64_t sdram_size = binfo->ram_size;
>
> - s->mpu = omap2420_mpu_init(sysmem, sdram_size, machine->cpu_type);
> + memory_region_allocate_system_memory(sdram, NULL, "omap2.dram",
> + sdram_size);
> + memory_region_add_subregion(get_system_memory(), OMAP2_Q2_BASE, sdram);
> +
> + s->mpu = omap2420_mpu_init(sdram, machine->cpu_type);
Any reason not to put the MemoryRegion in to the n800_s structure?
Otherwise,
Reviewed-by: Richard Henderson <[email protected]>
r~