microblaze: s3adsp: Instantiate CPU using QOM

Instantiate and realise the CPU directly, rather than using
cpu_mb_init. Microblazes cpu_model argument is a dummy so remove the
default cpu_model set logic.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
This commit is contained in:
Peter Crosthwaite 2015-05-24 20:31:40 -07:00 committed by Edgar E. Iglesias
parent 799810fb28
commit d87636b18f

View File

@ -62,7 +62,6 @@ static void
petalogix_s3adsp1800_init(MachineState *machine) petalogix_s3adsp1800_init(MachineState *machine)
{ {
ram_addr_t ram_size = machine->ram_size; ram_addr_t ram_size = machine->ram_size;
const char *cpu_model = machine->cpu_model;
DeviceState *dev; DeviceState *dev;
MicroBlazeCPU *cpu; MicroBlazeCPU *cpu;
DriveInfo *dinfo; DriveInfo *dinfo;
@ -73,11 +72,8 @@ petalogix_s3adsp1800_init(MachineState *machine)
qemu_irq irq[32]; qemu_irq irq[32];
MemoryRegion *sysmem = get_system_memory(); MemoryRegion *sysmem = get_system_memory();
/* init CPUs */ cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
if (cpu_model == NULL) { object_property_set_bool(OBJECT(cpu), true, "realized", &error_abort);
cpu_model = "microblaze";
}
cpu = cpu_mb_init(cpu_model);
/* Attach emulated BRAM through the LMB. */ /* Attach emulated BRAM through the LMB. */
memory_region_init_ram(phys_lmb_bram, NULL, memory_region_init_ram(phys_lmb_bram, NULL,