@@ -170,8 +170,8 @@ static void ref405ep_init(MachineState *machine)
}
/* XXX: fix this */
- memory_region_allocate_system_memory(&ram_memories[0], NULL, "ef405ep.ram",
- machine->ram_size);
+ memory_region_init_alias(&ram_memories[0], NULL, "ef405ep.ram.alias",
+ machine->ram, 0, machine->ram_size);
ram_bases[0] = 0;
ram_sizes[0] = machine->ram_size;
memory_region_init(&ram_memories[1], NULL, "ef405ep.ram1", 0);
@@ -312,6 +312,7 @@ static void ref405ep_class_init(ObjectClass *oc, void *data)
mc->desc = "ref405ep";
mc->init = ref405ep_init;
mc->default_ram_size = 0x08000000;
+ mc->default_ram_id = "ef405ep.ram";
}
static const TypeInfo ref405ep_type = {
@@ -424,7 +425,6 @@ static void taihu_405ep_init(MachineState *machine)
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *bios;
MemoryRegion *ram_memories = g_new(MemoryRegion, 2);
- MemoryRegion *ram = g_malloc0(sizeof(*ram));
hwaddr ram_bases[2], ram_sizes[2];
long bios_size;
target_ulong kernel_base, initrd_base;
@@ -439,18 +439,16 @@ static void taihu_405ep_init(MachineState *machine)
g_free(sz);
exit(EXIT_FAILURE);
}
- memory_region_allocate_system_memory(ram, NULL, "taihu_405ep.ram",
- machine->ram_size);
ram_bases[0] = 0;
ram_sizes[0] = 0x04000000;
memory_region_init_alias(&ram_memories[0], NULL,
- "taihu_405ep.ram-0", ram, ram_bases[0],
+ "taihu_405ep.ram-0", machine->ram, ram_bases[0],
ram_sizes[0]);
ram_bases[1] = 0x04000000;
ram_sizes[1] = 0x04000000;
memory_region_init_alias(&ram_memories[1], NULL,
- "taihu_405ep.ram-1", ram, ram_bases[1],
+ "taihu_405ep.ram-1", machine->ram, ram_bases[1],
ram_sizes[1]);
ppc405ep_init(sysmem, ram_memories, ram_bases, ram_sizes,
33333333, &pic, kernel_filename == NULL ? 0 : 1);
@@ -546,6 +544,7 @@ static void taihu_class_init(ObjectClass *oc, void *data)
mc->desc = "taihu";
mc->init = taihu_405ep_init;
mc->default_ram_size = 0x08000000;
+ mc->default_ram_id = "ef405ep.ram";
}
static const TypeInfo taihu_type = {