On Mon, Aug 20, 2012 at 9:02 PM, Andreas Färber <afaer...@suse.de> wrote: > Am 20.08.2012 04:18, schrieb Peter Crosthwaite: >> [...] Here's my code as it stands: >> >> Error *errp = NULL; >> object_property_set_link(OBJECT(dev), OBJECT(cpus[0]), "cpu0", &errp); >> assert_no_error(errp); > > There's two pitfalls there, the needed object_property_add_link() that > you stumbled over and also the need for a canonical path at the time of > setting the link. What target is this (microblaze?) and which path and > place for adding it as a child do you plan to use? >
Hi Andreas, I am aware of the canonical path issue and hacked past it. This is for ARM zynq - heres my hack in xilinx_zynq.c, that fixes the canon path issue. This occurs before the object_property_set above(). @@ -50,7 +76,7 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - ARMCPU *cpu; + ARMCPU *cpus[2]; MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *ext_ram = g_new(MemoryRegion, 1); MemoryRegion *ocm_ram = g_new(MemoryRegion, 1); @@ -60,19 +86,26 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device, qemu_irq pic[64]; NICInfo *nd; int n; - qemu_irq cpu_irq; + qemu_irq cpu_irq[2]; if (!cpu_model) { cpu_model = "cortex-a9"; } - cpu = cpu_arm_init(cpu_model); - if (!cpu) { - fprintf(stderr, "Unable to find CPU definition\n"); - exit(1); + for (n = 0; n < smp_cpus; n++) { + cpus[n] = cpu_arm_init(cpu_model); + if (!cpus[n]) { + fprintf(stderr, "Unable to find CPU definition\n"); + exit(1); + } + irqp = arm_pic_init_cpu(cpus[n]); + cpu_irq[n] = irqp[ARM_PIC_CPU_IRQ]; + /* FIXME: handle this somewhere central */ + object_property_add_child(container_get(qdev_get_machine(), + "/unattached"), + g_strdup_printf("cpu[%d]", n), + OBJECT(cpus[n]), NULL); } - irqp = arm_pic_init_cpu(cpu); - cpu_irq = irqp[ARM_PIC_CPU_IRQ]; full tree available at git://developer.petalogix.com/public/qemu.git for-upstream/zynq-boot.next. Theres a few more devels until I have a sendable series, but the bits your worried about in this convo are there now if you want more info. Regards, Peter > Andreas > > -- > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg