diff mbox series

[04/23] ppc: mpc8544ds/e500plat: use generic cpu_model parsing

Message ID 1507220690-265042-5-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/e500.c      | 8 +-------
 hw/ppc/e500plat.c  | 1 +
 hw/ppc/mpc8544ds.c | 2 ++
 3 files changed, 4 insertions(+), 7 deletions(-)

Comments

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

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

Do you want me to queue the ppc patches here, or do you already have a
plan for that?

> ---
>  hw/ppc/e500.c      | 8 +-------
>  hw/ppc/e500plat.c  | 1 +
>  hw/ppc/mpc8544ds.c | 2 ++
>  3 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index db0e49a..9178e70 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -803,11 +803,6 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
>      SysBusDevice *s;
>      PPCE500CCSRState *ccsr;
>  
> -    /* Setup CPUs */
> -    if (machine->cpu_model == NULL) {
> -        machine->cpu_model = "e500v2_v30";
> -    }
> -
>      irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
>      irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
>      for (i = 0; i < smp_cpus; i++) {
> @@ -815,8 +810,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
>          CPUState *cs;
>          qemu_irq *input;
>  
> -        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,
> -                                           machine->cpu_model));
> +        cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
>          env = &cpu->env;
>          cs = CPU(cpu);
>  
> diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
> index 94b4545..e59e80f 100644
> --- a/hw/ppc/e500plat.c
> +++ b/hw/ppc/e500plat.c
> @@ -64,6 +64,7 @@ static void e500plat_machine_init(MachineClass *mc)
>      mc->init = e500plat_init;
>      mc->max_cpus = 32;
>      mc->has_dynamic_sysbus = true;
> +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
>  }
>  
>  DEFINE_MACHINE("ppce500", e500plat_machine_init)
> diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
> index 27b8289..1717953 100644
> --- a/hw/ppc/mpc8544ds.c
> +++ b/hw/ppc/mpc8544ds.c
> @@ -16,6 +16,7 @@
>  #include "sysemu/device_tree.h"
>  #include "hw/ppc/openpic.h"
>  #include "qemu/error-report.h"
> +#include "cpu.h"
>  
>  static void mpc8544ds_fixup_devtree(PPCE500Params *params, void *fdt)
>  {
> @@ -55,6 +56,7 @@ static void ppce500_machine_init(MachineClass *mc)
>      mc->desc = "mpc8544ds";
>      mc->init = mpc8544ds_init;
>      mc->max_cpus = 15;
> +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
>  }
>  
>  DEFINE_MACHINE("mpc8544ds", ppce500_machine_init)
Igor Mammedov Oct. 6, 2017, 8:27 a.m. UTC | #2
On Fri, 6 Oct 2017 14:02:56 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Thu, Oct 05, 2017 at 06:24:31PM +0200, Igor Mammedov wrote:
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>  
> 
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> 
> Do you want me to queue the ppc patches here, or do you already have a
> plan for that?
Id didn't want to distract others with only PPC related code so
I've posted this series separately for you to merge it via PPC tree


> 
> > ---
> >  hw/ppc/e500.c      | 8 +-------
> >  hw/ppc/e500plat.c  | 1 +
> >  hw/ppc/mpc8544ds.c | 2 ++
> >  3 files changed, 4 insertions(+), 7 deletions(-)
> > 
> > diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> > index db0e49a..9178e70 100644
> > --- a/hw/ppc/e500.c
> > +++ b/hw/ppc/e500.c
> > @@ -803,11 +803,6 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
> >      SysBusDevice *s;
> >      PPCE500CCSRState *ccsr;
> >  
> > -    /* Setup CPUs */
> > -    if (machine->cpu_model == NULL) {
> > -        machine->cpu_model = "e500v2_v30";
> > -    }
> > -
> >      irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
> >      irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
> >      for (i = 0; i < smp_cpus; i++) {
> > @@ -815,8 +810,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
> >          CPUState *cs;
> >          qemu_irq *input;
> >  
> > -        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,
> > -                                           machine->cpu_model));
> > +        cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
> >          env = &cpu->env;
> >          cs = CPU(cpu);
> >  
> > diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
> > index 94b4545..e59e80f 100644
> > --- a/hw/ppc/e500plat.c
> > +++ b/hw/ppc/e500plat.c
> > @@ -64,6 +64,7 @@ static void e500plat_machine_init(MachineClass *mc)
> >      mc->init = e500plat_init;
> >      mc->max_cpus = 32;
> >      mc->has_dynamic_sysbus = true;
> > +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
> >  }
> >  
> >  DEFINE_MACHINE("ppce500", e500plat_machine_init)
> > diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
> > index 27b8289..1717953 100644
> > --- a/hw/ppc/mpc8544ds.c
> > +++ b/hw/ppc/mpc8544ds.c
> > @@ -16,6 +16,7 @@
> >  #include "sysemu/device_tree.h"
> >  #include "hw/ppc/openpic.h"
> >  #include "qemu/error-report.h"
> > +#include "cpu.h"
> >  
> >  static void mpc8544ds_fixup_devtree(PPCE500Params *params, void *fdt)
> >  {
> > @@ -55,6 +56,7 @@ static void ppce500_machine_init(MachineClass *mc)
> >      mc->desc = "mpc8544ds";
> >      mc->init = mpc8544ds_init;
> >      mc->max_cpus = 15;
> > +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
> >  }
> >  
> >  DEFINE_MACHINE("mpc8544ds", ppce500_machine_init)  
>
David Gibson Oct. 6, 2017, 9:12 a.m. UTC | #3
On Fri, Oct 06, 2017 at 10:27:38AM +0200, Igor Mammedov wrote:
> On Fri, 6 Oct 2017 14:02:56 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Thu, Oct 05, 2017 at 06:24:31PM +0200, Igor Mammedov wrote:
> > > Signed-off-by: Igor Mammedov <imammedo@redhat.com>  
> > 
> > Acked-by: David Gibson <david@gibson.dropbear.id.au>
> > 
> > Do you want me to queue the ppc patches here, or do you already have a
> > plan for that?
> Id didn't want to distract others with only PPC related code so
> I've posted this series separately for you to merge it via PPC tree

Ok.  I'm happy to do that, but I have queries on a few patches, so at
this point I'm anticipating a respin.

Just to be clear, you're intending for me to take the whole series?
Or just the patches within the ppc code?
Igor Mammedov Oct. 6, 2017, 9:37 a.m. UTC | #4
On Fri, 6 Oct 2017 20:12:02 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Fri, Oct 06, 2017 at 10:27:38AM +0200, Igor Mammedov wrote:
> > On Fri, 6 Oct 2017 14:02:56 +1100
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >   
> > > On Thu, Oct 05, 2017 at 06:24:31PM +0200, Igor Mammedov wrote:  
> > > > Signed-off-by: Igor Mammedov <imammedo@redhat.com>    
> > > 
> > > Acked-by: David Gibson <david@gibson.dropbear.id.au>
> > > 
> > > Do you want me to queue the ppc patches here, or do you already have a
> > > plan for that?  
> > Id didn't want to distract others with only PPC related code so
> > I've posted this series separately for you to merge it via PPC tree  
> 
> Ok.  I'm happy to do that, but I have queries on a few patches, so at
> this point I'm anticipating a respin.
I'm planing to do it (most likely on Monday)

> Just to be clear, you're intending for me to take the whole series?
> Or just the patches within the ppc code?
if 1-3/23 isn't in master by the time you take series, you'd need them as well
(it shouldn't cause any conflicts if Eduardo merges them first)
diff mbox series

Patch

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index db0e49a..9178e70 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -803,11 +803,6 @@  void ppce500_init(MachineState *machine, PPCE500Params *params)
     SysBusDevice *s;
     PPCE500CCSRState *ccsr;
 
-    /* Setup CPUs */
-    if (machine->cpu_model == NULL) {
-        machine->cpu_model = "e500v2_v30";
-    }
-
     irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
     irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
     for (i = 0; i < smp_cpus; i++) {
@@ -815,8 +810,7 @@  void ppce500_init(MachineState *machine, PPCE500Params *params)
         CPUState *cs;
         qemu_irq *input;
 
-        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,
-                                           machine->cpu_model));
+        cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
         env = &cpu->env;
         cs = CPU(cpu);
 
diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
index 94b4545..e59e80f 100644
--- a/hw/ppc/e500plat.c
+++ b/hw/ppc/e500plat.c
@@ -64,6 +64,7 @@  static void e500plat_machine_init(MachineClass *mc)
     mc->init = e500plat_init;
     mc->max_cpus = 32;
     mc->has_dynamic_sysbus = true;
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
 }
 
 DEFINE_MACHINE("ppce500", e500plat_machine_init)
diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
index 27b8289..1717953 100644
--- a/hw/ppc/mpc8544ds.c
+++ b/hw/ppc/mpc8544ds.c
@@ -16,6 +16,7 @@ 
 #include "sysemu/device_tree.h"
 #include "hw/ppc/openpic.h"
 #include "qemu/error-report.h"
+#include "cpu.h"
 
 static void mpc8544ds_fixup_devtree(PPCE500Params *params, void *fdt)
 {
@@ -55,6 +56,7 @@  static void ppce500_machine_init(MachineClass *mc)
     mc->desc = "mpc8544ds";
     mc->init = mpc8544ds_init;
     mc->max_cpus = 15;
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("e500v2_v30");
 }
 
 DEFINE_MACHINE("mpc8544ds", ppce500_machine_init)