aboutsummaryrefslogtreecommitdiff
path: root/hw/unicore32
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-10-05 15:51:02 +0200
committerEduardo Habkost <ehabkost@redhat.com>2017-10-27 16:04:27 +0200
commit1aaa63193b307fe42ba714e0615646cec7b37c51 (patch)
treef09d1566a8aa900a4bb5b70792ddeb38d639e756 /hw/unicore32
parent6a8268664736cf74aa2f034df0dd6cebc3bb23d9 (diff)
unicore32: use generic cpu_model parsing
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <1507211474-188400-29-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/unicore32')
-rw-r--r--hw/unicore32/puv3.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 504ea46211..1b39cc035b 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -112,7 +112,6 @@ static void puv3_load_kernel(const char *kernel_filename)
static void puv3_init(MachineState *machine)
{
ram_addr_t ram_size = machine->ram_size;
- const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *initrd_filename = machine->initrd_filename;
CPUUniCore32State *env;
@@ -123,11 +122,7 @@ static void puv3_init(MachineState *machine)
exit(1);
}
- if (!cpu_model) {
- cpu_model = "UniCore-II";
- }
-
- cpu = UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model));
+ cpu = UNICORE32_CPU(cpu_create(machine->cpu_type));
env = &cpu->env;
puv3_soc_init(env);
@@ -140,6 +135,7 @@ static void puv3_machine_init(MachineClass *mc)
mc->desc = "PKUnity Version-3 based on UniCore32";
mc->init = puv3_init;
mc->is_default = 1;
+ mc->default_cpu_type = UNICORE32_CPU_TYPE_NAME("UniCore-II");
}
DEFINE_MACHINE("puv3", puv3_machine_init)