diff mbox series

[07/23] ppc: bamboo: use generic cpu_model parsing

Message ID 1507220690-265042-8-git-send-email-imammedo@redhat.com
State New
Headers show
Series generalize parsing of cpu_model (part 3/PPC) | expand

Commit Message

Igor Mammedov Oct. 5, 2017, 4:24 p.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/ppc/ppc440_bamboo.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

David Gibson Oct. 6, 2017, 3:11 a.m. UTC | #1
On Thu, Oct 05, 2017 at 06:24:34PM +0200, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  hw/ppc/ppc440_bamboo.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
> index f92d47f..693c215 100644
> --- a/hw/ppc/ppc440_bamboo.c
> +++ b/hw/ppc/ppc440_bamboo.c
> @@ -182,11 +182,7 @@ static void bamboo_init(MachineState *machine)
>      int success;
>      int i;
>  
> -    /* Setup CPU. */
> -    if (machine->cpu_model == NULL) {
> -        machine->cpu_model = "440EP";
> -    }
> -    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, machine->cpu_model));
> +    cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
>      env = &cpu->env;
>  
>      if (env->mmu_model != POWERPC_MMU_BOOKE) {
> @@ -297,6 +293,7 @@ static void bamboo_machine_init(MachineClass *mc)
>  {
>      mc->desc = "bamboo";
>      mc->init = bamboo_init;
> +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440epb");
>  }
>  
>  DEFINE_MACHINE("bamboo", bamboo_machine_init)
diff mbox series

Patch

diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index f92d47f..693c215 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -182,11 +182,7 @@  static void bamboo_init(MachineState *machine)
     int success;
     int i;
 
-    /* Setup CPU. */
-    if (machine->cpu_model == NULL) {
-        machine->cpu_model = "440EP";
-    }
-    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, machine->cpu_model));
+    cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
     env = &cpu->env;
 
     if (env->mmu_model != POWERPC_MMU_BOOKE) {
@@ -297,6 +293,7 @@  static void bamboo_machine_init(MachineClass *mc)
 {
     mc->desc = "bamboo";
     mc->init = bamboo_init;
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440epb");
 }
 
 DEFINE_MACHINE("bamboo", bamboo_machine_init)