From be0f204aa0d8743f0627cd3cffb0ffc5bbf962e9 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Wed, 11 Nov 2009 19:59:29 +0000 Subject: Fix ARM MCore secondary cpu boot Make MPCore secondary cpu initialization work with the new reset handling. Also change the inital FLAG value from 3 to zero to match recent kenrels. Signed-off-by: Paul Brook --- hw/realview.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'hw/realview.c') diff --git a/hw/realview.c b/hw/realview.c index c494a20c88..95ad727d43 100644 --- a/hw/realview.c +++ b/hw/realview.c @@ -24,6 +24,17 @@ static struct arm_boot_info realview_binfo = { .board_id = 0x33b, }; +static void secondary_cpu_reset(void *opaque) +{ + CPUState *env = opaque; + + cpu_reset(env); + /* Set entry point for secondary CPUs. This assumes we're using + the init code from arm_boot.c. Real hardware resets all CPUs + the same. */ + env->regs[15] = 0x80000000; +} + static void realview_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, @@ -59,10 +70,7 @@ static void realview_init(ram_addr_t ram_size, irqp = arm_pic_init_cpu(env); cpu_irq[n] = irqp[ARM_PIC_CPU_IRQ]; if (n > 0) { - /* Set entry point for secondary CPUs. This assumes we're using - the init code from arm_boot.c. Real hardware resets all CPUs - the same. */ - env->regs[15] = 0x80000000; + qemu_register_reset(secondary_cpu_reset, env); } } -- cgit 1.4.1