diff options
author | Joseph Lo <josephl@nvidia.com> | 2013-08-12 05:40:05 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-08-12 15:30:11 -0400 |
commit | 731a9274382f8e6f4961df79fe12ebcc5431a5df (patch) | |
tree | e46be9d206edf67c0bb3ec211489b98266aff827 /arch/arm/mach-tegra/pm-tegra20.c | |
parent | e7a932b1961c3936c7ae5b8d1628f39dc50a746d (diff) |
ARM: tegra: add LP1 suspend support for Tegra20
The LP1 suspend mode will power off the CPU, clock gated the PLLs and put
SDRAM to self-refresh mode. Any interrupt can wake up device from LP1. The
sequence when LP1 suspending:
* tunning off L1 data cache and the MMU
* putting SDRAM into self-refresh
* storing some EMC registers and SCLK burst policy
* switching CPU to CLK_M (12MHz OSC)
* switching SCLK to CLK_S (32KHz OSC)
* tunning off PLLM, PLLP and PLLC
* shutting off the CPU rail
The sequence of LP1 resuming:
* re-enabling PLLM, PLLP, and PLLC
* restoring some EMC registers and SCLK burst policy
* setting up CCLK burst policy to PLLP
* resuming SDRAM to normal mode
* jumping to the "tegra_resume" from PMC_SCRATCH41
Due to the SDRAM will be put into self-refresh mode, the low level
procedures of LP1 suspending and resuming should be copied to
TEGRA_IRAM_CODE_AREA (TEGRA_IRAM_BASE + SZ_4K) when suspending. Before
restoring the CPU context when resuming, the SDRAM needs to be switched
back to normal mode. And the PLLs need to be re-enabled, SCLK burst policy
be restored, CCLK burst policy be set in PLLP. Then jumping to
"tegra_resume" that was expected to be stored in PMC_SCRATCH41 to restore
CPU context and back to kernel.
Based on the work by:
Colin Cross <ccross@android.com>
Gary King <gking@nvidia.com>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/pm-tegra20.c')
-rw-r--r-- | arch/arm/mach-tegra/pm-tegra20.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/pm-tegra20.c b/arch/arm/mach-tegra/pm-tegra20.c new file mode 100644 index 000000000000..d65e1d786400 --- /dev/null +++ b/arch/arm/mach-tegra/pm-tegra20.c | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, NVIDIA Corporation. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include <linux/kernel.h> | ||
17 | |||
18 | #include "pm.h" | ||
19 | |||
20 | #ifdef CONFIG_PM_SLEEP | ||
21 | extern u32 tegra20_iram_start, tegra20_iram_end; | ||
22 | extern void tegra20_sleep_core_finish(unsigned long); | ||
23 | |||
24 | void tegra20_lp1_iram_hook(void) | ||
25 | { | ||
26 | tegra_lp1_iram.start_addr = &tegra20_iram_start; | ||
27 | tegra_lp1_iram.end_addr = &tegra20_iram_end; | ||
28 | } | ||
29 | |||
30 | void tegra20_sleep_core_init(void) | ||
31 | { | ||
32 | tegra_sleep_core_finish = tegra20_sleep_core_finish; | ||
33 | } | ||
34 | #endif | ||