diff mbox series

[09/23] ppc: virtex-ml507: replace cpu_model with cpu_type

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

Comments

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

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

> ---
>  hw/ppc/virtex_ml507.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
> index ed9b406..5ac4f76 100644
> --- a/hw/ppc/virtex_ml507.c
> +++ b/hw/ppc/virtex_ml507.c
> @@ -89,14 +89,14 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env,
>  
>  static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size,
>                                        int do_init,
> -                                      const char *cpu_model,
> +                                      const char *cpu_type,
>                                        uint32_t sysclk)
>  {
>      PowerPCCPU *cpu;
>      CPUPPCState *env;
>      qemu_irq *irqs;
>  
> -    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));
> +    cpu = POWERPC_CPU(cpu_create(cpu_type));
>      env = &cpu->env;
>  
>      ppc_booke_timers_init(cpu, sysclk, 0/* no flags */);
> @@ -211,11 +211,7 @@ static void virtex_init(MachineState *machine)
>      int i;
>  
>      /* init CPUs */
> -    if (machine->cpu_model == NULL) {
> -        machine->cpu_model = "440-Xilinx";
> -    }
> -
> -    cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_model, 400000000);
> +    cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_type, 400000000);
>      env = &cpu->env;
>  
>      if (env->mmu_model != POWERPC_MMU_BOOKE) {
> @@ -307,6 +303,7 @@ static void virtex_machine_init(MachineClass *mc)
>  {
>      mc->desc = "Xilinx Virtex ML507 reference design";
>      mc->init = virtex_init;
> +    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440-xilinx");
>  }
>  
>  DEFINE_MACHINE("virtex-ml507", virtex_machine_init)
diff mbox series

Patch

diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index ed9b406..5ac4f76 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -89,14 +89,14 @@  static void mmubooke_create_initial_mapping(CPUPPCState *env,
 
 static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size,
                                       int do_init,
-                                      const char *cpu_model,
+                                      const char *cpu_type,
                                       uint32_t sysclk)
 {
     PowerPCCPU *cpu;
     CPUPPCState *env;
     qemu_irq *irqs;
 
-    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));
+    cpu = POWERPC_CPU(cpu_create(cpu_type));
     env = &cpu->env;
 
     ppc_booke_timers_init(cpu, sysclk, 0/* no flags */);
@@ -211,11 +211,7 @@  static void virtex_init(MachineState *machine)
     int i;
 
     /* init CPUs */
-    if (machine->cpu_model == NULL) {
-        machine->cpu_model = "440-Xilinx";
-    }
-
-    cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_model, 400000000);
+    cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_type, 400000000);
     env = &cpu->env;
 
     if (env->mmu_model != POWERPC_MMU_BOOKE) {
@@ -307,6 +303,7 @@  static void virtex_machine_init(MachineClass *mc)
 {
     mc->desc = "Xilinx Virtex ML507 reference design";
     mc->init = virtex_init;
+    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("440-xilinx");
 }
 
 DEFINE_MACHINE("virtex-ml507", virtex_machine_init)