diff options
Diffstat (limited to 'arch/arm/mach-shmobile/pm-sh7372.c')
-rw-r--r-- | arch/arm/mach-shmobile/pm-sh7372.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index ac47bfcd287e..aa7d352920d4 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/system.h> | 21 | #include <asm/system.h> |
22 | #include <asm/io.h> | 22 | #include <asm/io.h> |
23 | #include <asm/tlbflush.h> | 23 | #include <asm/tlbflush.h> |
24 | #include <asm/suspend.h> | ||
24 | #include <mach/common.h> | 25 | #include <mach/common.h> |
25 | #include <mach/sh7372.h> | 26 | #include <mach/sh7372.h> |
26 | 27 | ||
@@ -152,30 +153,25 @@ struct sh7372_pm_domain sh7372_a3sg = { | |||
152 | 153 | ||
153 | #endif /* CONFIG_PM */ | 154 | #endif /* CONFIG_PM */ |
154 | 155 | ||
155 | static void sh7372_enter_core_standby(void) | 156 | static int sh7372_do_idle_core_standby(unsigned long unused) |
156 | { | 157 | { |
157 | void __iomem *smfram = (void __iomem *)SMFRAM; | 158 | cpu_do_idle(); /* WFI when SYSTBCR == 0x10 -> Core Standby */ |
158 | 159 | return 0; | |
159 | __raw_writel(0, APARMBAREA); /* translate 4k */ | 160 | } |
160 | __raw_writel(__pa(sh7372_cpu_resume), SBAR); /* set reset vector */ | ||
161 | __raw_writel(0x10, SYSTBCR); /* enable core standby */ | ||
162 | |||
163 | __raw_writel(0, smfram + 0x3c); /* clear page table address */ | ||
164 | |||
165 | sh7372_cpu_suspend(); | ||
166 | cpu_init(); | ||
167 | 161 | ||
168 | /* if page table address is non-NULL then we have been powered down */ | 162 | static void sh7372_enter_core_standby(void) |
169 | if (__raw_readl(smfram + 0x3c)) { | 163 | { |
170 | __raw_writel(__raw_readl(smfram + 0x40), | 164 | /* set reset vector, translate 4k */ |
171 | __va(__raw_readl(smfram + 0x3c))); | 165 | __raw_writel(__pa(sh7372_resume_core_standby), SBAR); |
166 | __raw_writel(0, APARMBAREA); | ||
172 | 167 | ||
173 | flush_tlb_all(); | 168 | /* enter sleep mode with SYSTBCR to 0x10 */ |
174 | set_cr(__raw_readl(smfram + 0x38)); | 169 | __raw_writel(0x10, SYSTBCR); |
175 | } | 170 | cpu_suspend(0, sh7372_do_idle_core_standby); |
171 | __raw_writel(0, SYSTBCR); | ||
176 | 172 | ||
177 | __raw_writel(0, SYSTBCR); /* disable core standby */ | 173 | /* disable reset vector translation */ |
178 | __raw_writel(0, SBAR); /* disable reset vector translation */ | 174 | __raw_writel(0, SBAR); |
179 | } | 175 | } |
180 | 176 | ||
181 | #ifdef CONFIG_CPU_IDLE | 177 | #ifdef CONFIG_CPU_IDLE |