ARM: tegra30: Remove extra check for ARM version
Bo Yan [Wed, 6 Feb 2013 22:44:54 +0000 (14:44 -0800)]
cpuidle-t3.c is only used for tegra30, there is no need to check
ARM version here since it's guaranteed to be Cortex A9.

bug 1230268

Change-Id: Iafc24e957bf4d0cfee2c22fe6eec7617d7a3eb7a
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/198141
Reviewed-by: Automatic_Commit_Validation_User

arch/arm/mach-tegra/cpuidle-t3.c

index 94d7352..7fcc9ad 100644 (file)
@@ -328,24 +328,6 @@ static bool tegra_cpu_cluster_power_down(struct cpuidle_device *dev,
        return true;
 }
 
-#ifndef CONFIG_TRUSTED_FOUNDATIONS
-static unsigned int g_diag_reg;
-
-static void save_cpu_arch_register(void)
-{
-       /* read diagnostic register */
-       if (((read_cpuid_id() >> 4) & 0xFFF) == 0xC09)
-               asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(g_diag_reg) : : "cc");
-}
-
-static void restore_cpu_arch_register(void)
-{
-       /* write diagnostic register */
-       if (((read_cpuid_id() >> 4) & 0xFFF) == 0xC09)
-               asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(g_diag_reg) : "cc");
-}
-#endif
-
 static bool tegra_cpu_core_power_down(struct cpuidle_device *dev,
                           struct cpuidle_state *state, s64 request)
 {
@@ -355,6 +337,9 @@ static bool tegra_cpu_core_power_down(struct cpuidle_device *dev,
        struct tegra_twd_context twd_context;
        bool sleep_completed = false;
        struct tick_sched *ts = tick_get_tick_sched(dev->cpu);
+#ifndef CONFIG_TRUSTED_FOUNDATIONS
+       unsigned int diag_reg;
+#endif
 #if defined(CONFIG_TEGRA_LP2_CPU_TIMER)
        void __iomem *twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600);
 #endif
@@ -404,13 +389,13 @@ static bool tegra_cpu_core_power_down(struct cpuidle_device *dev,
        smp_wmb();
 
 #ifndef CONFIG_TRUSTED_FOUNDATIONS
-       save_cpu_arch_register();
+       asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(diag_reg) : : "cc");
 #endif
 
        cpu_suspend(0, tegra3_sleep_cpu_secondary_finish);
 
 #ifndef CONFIG_TRUSTED_FOUNDATIONS
-       restore_cpu_arch_register();
+       asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(diag_reg) : "cc");
 #endif
 
        tegra_cpu_wake_by_time[dev->cpu] = LLONG_MAX;