summaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91/pm_suspend.S
diff options
context:
space:
mode:
authorWenyou Yang <wenyou.yang@atmel.com>2015-03-09 11:53:46 +0800
committerNicolas Ferre <nicolas.ferre@atmel.com>2015-03-13 13:34:55 +0100
commit20567658b8f010eea287087bfdbeb25757801aed (patch)
tree8d1d3aa3d9c6a974daceb075d85c331292e1d0ac /arch/arm/mach-at91/pm_suspend.S
parente32d995cf9db8dbf48d0ae25794b1b7b3872857d (diff)
ARM: at91/pm_suspend: add the WFI instruction support for ARMv7
Add the WFI instruction to make the cpu to the idle state. In the meanwhile, disable the processor's clock. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/pm_suspend.S')
-rw-r--r--arch/arm/mach-at91/pm_suspend.S20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index 1002bb80a939..7c444c259740 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -51,6 +51,24 @@ tmp2 .req r5
beq 1b
.endm
+/*
+ * Put the processor to enter the idle state
+ */
+ .macro at91_cpu_idle
+
+#if defined(CONFIG_CPU_V7)
+ mov tmp1, #AT91_PMC_PCK
+ str tmp1, [pmc, #AT91_PMC_SCDR]
+
+ dsb
+
+ wfi @ Wait For Interrupt
+#else
+ mcr p15, 0, tmp1, c7, c0, 4
+#endif
+
+ .endm
+
.text
.arm
@@ -123,7 +141,7 @@ skip_disable_main_clock:
ldr pmc, .pmc_base
/* Wait for interrupt */
- mcr p15, 0, tmp1, c7, c0, 4
+ at91_cpu_idle
ldr r0, .pm_mode
tst r0, #AT91_PM_SLOW_CLOCK