Commit 00469dc3 authored by Valentin Plotkin's avatar Valentin Plotkin Committed by David Gibson
Browse files

target-ppc: Add MMU model check for booke machines



Machines bamboo, e500 and virtex-ml507 assume a certain MMU model,
otherwise resulting in unpredictable behavior. Add apropriate checks
into *_init functions.

Signed-off-by: default avatarValentin Plotkin <caliborn@sdf.org>

[regarding virtex parts]
Reviewed-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>

Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 25e6a118
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -827,6 +827,12 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
        env = &cpu->env;
        cs = CPU(cpu);

        if (env->mmu_model != POWERPC_MMU_BOOKE206) {
            fprintf(stderr, "MMU model %i not supported by this machine.\n",
                env->mmu_model);
            exit(1);
        }

        if (!firstenv) {
            firstenv = env;
        }
+6 −0
Original line number Diff line number Diff line
@@ -193,6 +193,12 @@ static void bamboo_init(MachineState *machine)
    }
    env = &cpu->env;

    if (env->mmu_model != POWERPC_MMU_BOOKE) {
        fprintf(stderr, "MMU model %i not supported by this machine.\n",
            env->mmu_model);
        exit(1);
    }

    qemu_register_reset(main_cpu_reset, cpu);
    ppc_booke_timers_init(cpu, 400000000, 0);
    ppc_dcr_init(env, NULL, NULL);
+7 −0
Original line number Diff line number Diff line
@@ -221,6 +221,13 @@ static void virtex_init(MachineState *machine)

    cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_model, 400000000);
    env = &cpu->env;

    if (env->mmu_model != POWERPC_MMU_BOOKE) {
        fprintf(stderr, "MMU model %i not supported by this machine.\n",
            env->mmu_model);
        exit(1);
    }

    qemu_register_reset(main_cpu_reset, cpu);

    memory_region_allocate_system_memory(phys_ram, NULL, "ram", ram_size);