OSDN Git Service

ARM: OMAP2+: Introduce low-level suspend code for AM33XX
authorDave Gerlach <d-gerlach@ti.com>
Fri, 23 Feb 2018 15:43:54 +0000 (09:43 -0600)
committerTony Lindgren <tony@atomide.com>
Tue, 27 Feb 2018 16:52:42 +0000 (08:52 -0800)
commit8a94cd7ec05e2be9224c77497f4b3591b3ec05e2
tree5131503d6cc06627f5656742ac790d18aa1c301c
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2
ARM: OMAP2+: Introduce low-level suspend code for AM33XX

In preparation for suspend-resume support for AM33XX, add
the assembly file with the code which is copied to internal
memory (OCMC RAM) during bootup and runs from there.

As part of the low power entry (DeepSleep0 mode in AM33XX TRM),
the code running from OCMC RAM does the following
1. Calls routine to store the EMIF configuration
2. Calls routine to place external memory in self-refresh
3. Disables EMIF clock
4. Executes WFI after writing to MPU_CLKCTRL register.

If no interrupts have come, WFI execution on MPU gets registered
as an interrupt with the WKUP-M3. WKUP-M3 takes care of disabling
some clocks which MPU should not (L3, L4, OCMC RAM etc) and takes
care of clockdomain and powerdomain transitions as part of the
DeepSleep0 mode entry.

In case a late interrupt comes in, WFI ends up as a NOP and MPU
continues execution from internal memory. The 'abort path' code
undoes whatever was done as part of the low power entry and indicates
a suspend failure by passing a non-zero value to the cpu_resume routine.

The 'resume path' code is similar to the 'abort path' with the key
difference of MMU being enabled in the 'abort path' but being
disabled in the 'resume path' due to MPU getting powered off.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/sleep33xx.S [new file with mode: 0644]