diff mbox

[RFC,v3,19/21] target-arm: Kill off cpu_reset_model_id()

Message ID 1328237992-14953-20-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber Feb. 3, 2012, 2:59 a.m. UTC
Move last remaining TI925T bits to ti925t_reset().

This reduces cpu_reset() to triviality and lets us reset the CPU
directly from arm_cpu_initfn().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/cpu.c    |    4 ++++
 target-arm/helper.c |   20 --------------------
 2 files changed, 4 insertions(+), 20 deletions(-)
diff mbox

Patch

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 8186a96..74f4e9b 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -213,6 +213,8 @@  static void ti925t_reset(CPU *c)
     arm_cpu_reset(c);
 
     env->cp15.c0_cpuid = ARM_CPUID_TI925T; /* Depends on wiring. */
+    env->cp15.c15_i_max = 0x000;
+    env->cp15.c15_i_min = 0xff0;
 }
 
 static void ti925t_class_init(ARMCPUClass *klass, const ARMCPUInfo *info)
@@ -548,6 +550,8 @@  static void arm_cpu_initfn(Object *obj)
 
     cpu->env.cpu_model_str = object_get_typename(obj);
     cpu->env.cp15.c0_cpuid = cpu_class->cp15.c0_cpuid;
+
+    cpu_do_reset(CPU(cpu));
 }
 
 static void arm_cpu_class_init(ObjectClass *klass, void *data)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 6ecae15..cb98661 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -10,28 +10,9 @@ 
 #include "sysemu.h"
 #include "cpu-core.h"
 
-static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
-{
-    switch (id) {
-    case ARM_CPUID_TI915T:
-    case ARM_CPUID_TI925T:
-        env->cp15.c15_i_max = 0x000;
-        env->cp15.c15_i_min = 0xff0;
-        break;
-    default:
-        break;
-    }
-}
-
 void cpu_reset(CPUARMState *env)
 {
-    uint32_t id;
-
     cpu_do_reset(CPU(ENV_GET_OBJECT(env)));
-
-    id = env->cp15.c0_cpuid;
-    if (id)
-        cpu_reset_model_id(env, id);
 }
 
 static int vfp_gdb_get_reg(CPUState *env, uint8_t *buf, int reg)
@@ -110,7 +91,6 @@  CPUARMState *cpu_arm_init(const char *cpu_model)
         arm_translate_init();
     }
 
-    cpu_reset(env);
     if (arm_feature(env, ARM_FEATURE_NEON)) {
         gdb_register_coprocessor(env, vfp_gdb_get_reg, vfp_gdb_set_reg,
                                  51, "arm-neon.xml", 0);