diff options
author | Alex Frid <afrid@nvidia.com> | 2011-09-20 23:37:36 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:09 -0800 |
commit | 25baa7bacaa7f5df156d40889e7f88e7945f577d (patch) | |
tree | 9a7b4082aced94f703ab91f3f4d348fb4ad0cc33 /arch/arm/mach-tegra/pm.c | |
parent | 519e0666a52ee5d9c2bbf83bc90c9f0b50c36b2a (diff) |
ARM: tegra: timer: Update twd suspend/resume
- Preserve twd periodic load register across suspend and LP2 on main
CPU. Keep timer disabled on resume, since it will be re-configured
later when timekeeping switches from global system timer.
- Generate "load equal zero" warning in twd suspend/resume code only
when timer is in periodic mode.
Change-Id: If7df8be08c0ef4e355f315e3f0b7e3cf1b358f0f
Reviewed-on: http://git-master/r/55068
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Rebase-Id: R75f3950a915e0953a098620dea9ea32a7d5e9482
Diffstat (limited to 'arch/arm/mach-tegra/pm.c')
-rw-r--r-- | arch/arm/mach-tegra/pm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 587b5d6097f2..e359a273dad6 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -411,9 +411,14 @@ static void restore_cpu_complex(u32 mode) flowctrl_writel(reg, FLOW_CTRL_CPU_CSR(cpu)); /* If an immedidate cluster switch is being perfomed, restore the - local timer registers. See save_cpu_complex() for the details. */ - if (mode & (TEGRA_POWER_CLUSTER_MASK | TEGRA_POWER_CLUSTER_IMMEDIATE)) - tegra_twd_resume(&tegra_sctx.twd); + local timer registers. For calls resulting from CPU LP2 in + idle or system suspend, the local timer was shut down and + timekeeping switched over to the global system timer. In this + case keep local timer disabled, and restore only periodic load. */ + if (!(mode & (TEGRA_POWER_CLUSTER_MASK | + TEGRA_POWER_CLUSTER_IMMEDIATE))) + tegra_sctx.twd.twd_ctrl = 0; + tegra_twd_resume(&tegra_sctx.twd); } /* @@ -445,12 +450,7 @@ static void suspend_cpu_complex(u32 mode) tegra_sctx.pllp_misc = readl(clk_rst + CLK_RESET_PLLP_MISC); tegra_sctx.cclk_divider = readl(clk_rst + CLK_RESET_CCLK_DIVIDER); - /* If an immedidate cluster switch is being perfomed, save the - local timer registers. For calls resulting from CPU LP2 in - idle or system suspend, the local timer is shut down and - timekeeping switches over to the global system timer. */ - if (mode & (TEGRA_POWER_CLUSTER_MASK | TEGRA_POWER_CLUSTER_IMMEDIATE)) - tegra_twd_suspend(&tegra_sctx.twd); + tegra_twd_suspend(&tegra_sctx.twd); reg = readl(FLOW_CTRL_CPU_CSR(cpu)); reg &= ~FLOW_CTRL_CSR_WFE_BITMAP; /* clear wfe bitmap */ |