diff options
author | Joseph Lo <josephl@nvidia.com> | 2013-08-12 05:40:04 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-08-12 15:30:11 -0400 |
commit | e7a932b1961c3936c7ae5b8d1628f39dc50a746d (patch) | |
tree | 757f5862da9fad0e10185382f9a9bbaca4723579 /arch/arm/mach-tegra/pm.c | |
parent | 95872f427eca73b19ac9466c25afd9bb876dc1aa (diff) |
ARM: tegra: add LP1 suspend support for Tegra30
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
* storing some EMC registers, DPD (deep power down) status, clk source of
mselect and SCLK burst policy
* putting SDRAM into self-refresh
* switching CPU to CLK_M (12MHz OSC)
* tunning off PLLM, PLLP, PLLA, PLLC and PLLX
* switching SCLK to CLK_S (32KHz OSC)
* shutting off the CPU rail
The sequence of LP1 resuming:
* re-enabling PLLM, PLLP, PLLA, PLLC and PLLX
* restoring the clk source of mselect and SCLK burst policy
* setting up CCLK burst policy to PLLX
* restoring DPD status and some EMC registers
* 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 PLLX. 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: Scott Williams <scwilliams@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.c')
-rw-r--r-- | arch/arm/mach-tegra/pm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 10689924a6a7..7739d5586cb7 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c | |||
@@ -209,6 +209,15 @@ static int tegra_sleep_core(unsigned long v2p) | |||
209 | */ | 209 | */ |
210 | static bool tegra_lp1_iram_hook(void) | 210 | static bool tegra_lp1_iram_hook(void) |
211 | { | 211 | { |
212 | switch (tegra_chip_id) { | ||
213 | case TEGRA30: | ||
214 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) | ||
215 | tegra30_lp1_iram_hook(); | ||
216 | break; | ||
217 | default: | ||
218 | break; | ||
219 | } | ||
220 | |||
212 | if (!tegra_lp1_iram.start_addr || !tegra_lp1_iram.end_addr) | 221 | if (!tegra_lp1_iram.start_addr || !tegra_lp1_iram.end_addr) |
213 | return false; | 222 | return false; |
214 | 223 | ||
@@ -222,6 +231,15 @@ static bool tegra_lp1_iram_hook(void) | |||
222 | 231 | ||
223 | static bool tegra_sleep_core_init(void) | 232 | static bool tegra_sleep_core_init(void) |
224 | { | 233 | { |
234 | switch (tegra_chip_id) { | ||
235 | case TEGRA30: | ||
236 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) | ||
237 | tegra30_sleep_core_init(); | ||
238 | break; | ||
239 | default: | ||
240 | break; | ||
241 | } | ||
242 | |||
225 | if (!tegra_sleep_core_finish) | 243 | if (!tegra_sleep_core_finish) |
226 | return false; | 244 | return false; |
227 | 245 | ||