petalogix-ml605: Create the CPU with object_new()
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Mon, 16 Dec 2013 02:44:20 +0000 (12:44 +1000)
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tue, 11 Feb 2014 12:57:57 +0000 (22:57 +1000)
This is to allow future patches to set properties before cpu::realize().

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
hw/microblaze/petalogix_ml605_mmu.c

index 1a8775624677f36dd4e1948800b86d87fbdf3160..37cbbfd592e66c0af567c1c8ac02cf2074e7c6f5 100644 (file)
@@ -75,7 +75,6 @@ static void
 petalogix_ml605_init(QEMUMachineInitArgs *args)
 {
     ram_addr_t ram_size = args->ram_size;
-    const char *cpu_model = args->cpu_model;
     MemoryRegion *address_space_mem = get_system_memory();
     DeviceState *dev, *dma, *eth0;
     Object *ds, *cs;
@@ -89,10 +88,8 @@ petalogix_ml605_init(QEMUMachineInitArgs *args)
     qemu_irq irq[32];
 
     /* init CPUs */
-    if (cpu_model == NULL) {
-        cpu_model = "microblaze";
-    }
-    cpu = cpu_mb_init(cpu_model);
+    cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
+    object_property_set_bool(OBJECT(cpu), true, "realized", &error_abort);
 
     /* Attach emulated BRAM through the LMB.  */
     memory_region_init_ram(phys_lmb_bram, NULL, "petalogix_ml605.lmb_bram",