diff options
Diffstat (limited to 'hw/virtex_ml507.c')
-rw-r--r-- | hw/virtex_ml507.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c index 4a133b5d1e..cace86b5e4 100644 --- a/hw/virtex_ml507.c +++ b/hw/virtex_ml507.c @@ -78,19 +78,21 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env, tlb->PID = 0; } -static CPUPPCState *ppc440_init_xilinx(ram_addr_t *ram_size, - int do_init, - const char *cpu_model, - uint32_t sysclk) +static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size, + int do_init, + const char *cpu_model, + uint32_t sysclk) { + PowerPCCPU *cpu; CPUPPCState *env; qemu_irq *irqs; - env = cpu_init(cpu_model); - if (!env) { + cpu = cpu_ppc_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "Unable to initialize CPU!\n"); exit(1); } + env = &cpu->env; ppc_booke_timers_init(env, sysclk, 0/* no flags */); @@ -101,15 +103,16 @@ static CPUPPCState *ppc440_init_xilinx(ram_addr_t *ram_size, irqs[PPCUIC_OUTPUT_INT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT]; irqs[PPCUIC_OUTPUT_CINT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_CINT]; ppcuic_init(env, irqs, 0x0C0, 0, 1); - return env; + return cpu; } static void main_cpu_reset(void *opaque) { - CPUPPCState *env = opaque; + PowerPCCPU *cpu = opaque; + CPUPPCState *env = &cpu->env; struct boot_info *bi = env->load_info; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); /* Linux Kernel Parameters (passing device tree): * r3: pointer to the fdt * r4: 0 @@ -188,6 +191,7 @@ static void virtex_init(ram_addr_t ram_size, { MemoryRegion *address_space_mem = get_system_memory(); DeviceState *dev; + PowerPCCPU *cpu; CPUPPCState *env; target_phys_addr_t ram_base = 0; DriveInfo *dinfo; @@ -201,8 +205,9 @@ static void virtex_init(ram_addr_t ram_size, cpu_model = "440-Xilinx"; } - env = ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000); - qemu_register_reset(main_cpu_reset, env); + cpu = ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000); + env = &cpu->env; + qemu_register_reset(main_cpu_reset, cpu); memory_region_init_ram(phys_ram, "ram", ram_size); vmstate_register_ram_global(phys_ram); |