mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/arm: Check CPU type in machine_run_board_init()
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20231204004726.483558-9-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
dbf8e8c433
commit
3e71f4a706
8 changed files with 74 additions and 50 deletions
|
@ -52,12 +52,6 @@ static void cubieboard_init(MachineState *machine)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
/* Only allow Cortex-A8 for this board */
|
||||
if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a8")) != 0) {
|
||||
error_report("This board can only be used with cortex-a8 CPU");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
a10 = AW_A10(object_new(TYPE_AW_A10));
|
||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(a10));
|
||||
object_unref(OBJECT(a10));
|
||||
|
@ -114,8 +108,14 @@ static void cubieboard_init(MachineState *machine)
|
|||
|
||||
static void cubieboard_machine_init(MachineClass *mc)
|
||||
{
|
||||
static const char * const valid_cpu_types[] = {
|
||||
ARM_CPU_TYPE_NAME("cortex-a8"),
|
||||
NULL
|
||||
};
|
||||
|
||||
mc->desc = "cubietech cubieboard (Cortex-A8)";
|
||||
mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a8");
|
||||
mc->valid_cpu_types = valid_cpu_types;
|
||||
mc->default_ram_size = 1 * GiB;
|
||||
mc->init = cubieboard_init;
|
||||
mc->block_default_type = IF_IDE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue