aboutsummaryrefslogtreecommitdiff
path: root/hw/lm32
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-10-05 15:50:44 +0200
committerEduardo Habkost <ehabkost@redhat.com>2017-10-27 16:03:54 +0200
commit6e0f9a23445c72d654bbb6a7c37b00372f1de623 (patch)
tree5056fd237bcec2709073aa834ff8bf3dd47581c7 /hw/lm32
parent201c160e943327305af61e96915bbd982162a758 (diff)
downloadqemu-6e0f9a23445c72d654bbb6a7c37b00372f1de623.zip
qemu-6e0f9a23445c72d654bbb6a7c37b00372f1de623.tar.gz
qemu-6e0f9a23445c72d654bbb6a7c37b00372f1de623.tar.bz2
lm32: lm32_boards: use generic cpu_model parsing
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Michael Walle <michael@walle.cc> Message-Id: <1507211474-188400-11-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/lm32')
-rw-r--r--hw/lm32/lm32_boards.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index b0bb3ef..002d638 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -75,7 +75,6 @@ static void main_cpu_reset(void *opaque)
static void lm32_evr_init(MachineState *machine)
{
- const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
LM32CPU *cpu;
CPULM32State *env;
@@ -101,10 +100,7 @@ static void lm32_evr_init(MachineState *machine)
reset_info = g_malloc0(sizeof(ResetInfo));
- if (cpu_model == NULL) {
- cpu_model = "lm32-full";
- }
- cpu = LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model));
+ cpu = LM32_CPU(cpu_create(machine->cpu_type));
env = &cpu->env;
reset_info->cpu = cpu;
@@ -163,7 +159,6 @@ static void lm32_evr_init(MachineState *machine)
static void lm32_uclinux_init(MachineState *machine)
{
- const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
@@ -198,10 +193,7 @@ static void lm32_uclinux_init(MachineState *machine)
reset_info = g_malloc0(sizeof(ResetInfo));
- if (cpu_model == NULL) {
- cpu_model = "lm32-full";
- }
- cpu = LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model));
+ cpu = LM32_CPU(cpu_create(machine->cpu_type));
env = &cpu->env;
reset_info->cpu = cpu;
@@ -295,6 +287,7 @@ static void lm32_evr_class_init(ObjectClass *oc, void *data)
mc->desc = "LatticeMico32 EVR32 eval system";
mc->init = lm32_evr_init;
mc->is_default = 1;
+ mc->default_cpu_type = LM32_CPU_TYPE_NAME("lm32-full");
}
static const TypeInfo lm32_evr_type = {
@@ -310,6 +303,7 @@ static void lm32_uclinux_class_init(ObjectClass *oc, void *data)
mc->desc = "lm32 platform for uClinux and u-boot by Theobroma Systems";
mc->init = lm32_uclinux_init;
mc->is_default = 0;
+ mc->default_cpu_type = LM32_CPU_TYPE_NAME("lm32-full");
}
static const TypeInfo lm32_uclinux_type = {