summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/cpuidle-t3.c
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-07-22 15:00:22 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:58 -0800
commitc25ca2247ba8515cc58c6bc847d97692f12b3f08 (patch)
tree6d829ae00a73562cbbd615f3ccaafad42f61e7a7 /arch/arm/mach-tegra/cpuidle-t3.c
parent3b3b17486113ac2e5af1f6d2d555f1315cb40434 (diff)
ARM: tegra: timer: Save TWD registers on secondary CPU LP2
Change-Id: I0ca5186fd833913b79abf2a7dbddc528d547acc6 Signed-off-by: Scott Williams <scwilliams@nvidia.com> DW: Simplify, remove unnecessary macros Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: R686b57e37db12361f3c5054500c74337de6fd5a6
Diffstat (limited to 'arch/arm/mach-tegra/cpuidle-t3.c')
-rw-r--r--arch/arm/mach-tegra/cpuidle-t3.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/cpuidle-t3.c b/arch/arm/mach-tegra/cpuidle-t3.c
index 25f7d26d665c..4f2208b7ff61 100644
--- a/arch/arm/mach-tegra/cpuidle-t3.c
+++ b/arch/arm/mach-tegra/cpuidle-t3.c
@@ -56,6 +56,7 @@
#include "pm.h"
#include "reset.h"
#include "sleep.h"
+#include "timer.h"
#define CLK_RST_CONTROLLER_CPU_CMPLX_STATUS \
(IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x470)
@@ -263,6 +264,7 @@ static void tegra3_idle_enter_lp2_cpu_n(struct cpuidle_device *dev,
{
#ifdef CONFIG_SMP
s64 sleep_time = request - tegra_lp2_exit_latency;
+ struct tegra_twd_context twd_context;
tegra_lp2_set_trigger(sleep_time);
@@ -274,6 +276,8 @@ static void tegra3_idle_enter_lp2_cpu_n(struct cpuidle_device *dev,
tegra_cpu_wake_by_time[dev->cpu] = ktime_to_us(ktime_get()) + request;
smp_wmb();
+ tegra_twd_suspend(&twd_context);
+
flush_cache_all();
barrier();
/* !!!FIXME!!! __cortex_a9_save(0); */
@@ -284,6 +288,8 @@ static void tegra3_idle_enter_lp2_cpu_n(struct cpuidle_device *dev,
tegra_cpu_wake_by_time[dev->cpu] = LLONG_MAX;
+ tegra_twd_resume(&twd_context);
+
if (sleep_time)
tegra_lp2_set_trigger(0);
#endif