diff mbox series

[06/23] ppc: mac_oldworld: use generic cpu_model parsing

Message ID 1507220690-265042-7-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/mac_oldworld.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

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

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

> ---
>  hw/ppc/mac_oldworld.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
> index bc7c8b7..010ea36 100644
> --- a/hw/ppc/mac_oldworld.c
> +++ b/hw/ppc/mac_oldworld.c
> @@ -108,11 +108,8 @@ static void ppc_heathrow_init(MachineState *machine)
>      linux_boot = (kernel_filename != NULL);
>  
>      /* init CPUs */
> -    if (machine->cpu_model == NULL)
> -        machine->cpu_model = "G3";
>      for (i = 0; i < smp_cpus; i++) {
> -        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,
> -                                           machine->cpu_model));
> +        cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
>          env = &cpu->env;
>  
>          /* Set time-base frequency to 16.6 Mhz */
> @@ -385,6 +382,7 @@ static void heathrow_class_init(ObjectClass *oc, void *data)
>      /* TOFIX "cad" when Mac floppy is implemented */
>      mc->default_boot_order = "cd";
>      mc->kvm_type = heathrow_kvm_type;
> +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("750_v3.1");
>  }
>  
>  static const TypeInfo ppc_heathrow_machine_info = {
diff mbox series

Patch

diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index bc7c8b7..010ea36 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -108,11 +108,8 @@  static void ppc_heathrow_init(MachineState *machine)
     linux_boot = (kernel_filename != NULL);
 
     /* init CPUs */
-    if (machine->cpu_model == NULL)
-        machine->cpu_model = "G3";
     for (i = 0; i < smp_cpus; i++) {
-        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,
-                                           machine->cpu_model));
+        cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
         env = &cpu->env;
 
         /* Set time-base frequency to 16.6 Mhz */
@@ -385,6 +382,7 @@  static void heathrow_class_init(ObjectClass *oc, void *data)
     /* TOFIX "cad" when Mac floppy is implemented */
     mc->default_boot_order = "cd";
     mc->kvm_type = heathrow_kvm_type;
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("750_v3.1");
 }
 
 static const TypeInfo ppc_heathrow_machine_info = {