ARM: tegra14x: Add routines to maintain powermasks
Prashant Malani [Sat, 16 Feb 2013 02:59:44 +0000 (18:59 -0800)]
The decision to enter LP1BB might occur well into
iRAM code. These functions will help to save
and restore cpu_power_mask in case we decide to
enter LP1BB in iRAM.

Bug 1236920

Change-Id: Ic1e38281bdc508014d4edb3e9645c7ba89a2b4c1
Signed-off-by: Prashant Malani <pmalani@nvidia.com>
Reviewed-on: http://git-master/r/203166
(cherry picked from commit 8fc48afefb64fecb99db1d2cab1ac57d0af19bb2)
Reviewed-on: http://git-master/r/204858
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>
GVS: Gerrit_Virtual_Submit

arch/arm/mach-tegra/platsmp.c
arch/arm/mach-tegra/pm.h

index 6502d1f..79a39ff 100644 (file)
@@ -51,6 +51,10 @@ struct cpumask *tegra_cpu_power_mask =
                                to_cpumask(tegra_cpu_power_up_by_fc);
 #define tegra_cpu_power_map    (*(cpumask_t *)tegra_cpu_power_mask)
 
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
+static struct cpumask tegra_cpu_power_mask_saved;
+#endif
+
 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
 #define CAR_BOND_OUT_V \
        (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x390)
@@ -406,6 +410,18 @@ void tegra_smp_clear_power_mask()
 }
 #endif
 
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
+void tegra_smp_save_power_mask()
+{
+       tegra_cpu_power_mask_saved = *((struct cpumask *)tegra_cpu_power_mask);
+}
+
+void tegra_smp_restore_power_mask()
+{
+       *tegra_cpu_power_mask = tegra_cpu_power_mask_saved;
+}
+#endif
+
 #ifdef CONFIG_TEGRA_VIRTUAL_CPUID
 static int tegra_cpu_disable(unsigned int cpu)
 {
index afabd71..c515e6f 100644 (file)
@@ -279,6 +279,11 @@ void tegra_smp_clear_power_mask(void);
 static inline void tegra_smp_clear_power_mask(void){}
 #endif
 
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
+void tegra_smp_save_power_mask(void);
+void tegra_smp_restore_power_mask(void);
+#endif
+
 #ifdef CONFIG_TRUSTED_FOUNDATIONS
 void tegra_generic_smc(u32 type, u32 subtype, u32 arg);
 #endif