• Dave Gerlach's avatar
    ARM: OMAP2+: Introduce low-level suspend code for AM33XX · 8a94cd7e
    Dave Gerlach authored
    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: default avatarDave Gerlach <d-gerlach@ti.com>
    Acked-by: default avatarSantosh Shilimkar <ssantosh@kernel.org>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    8a94cd7e
sleep33xx.S 4.28 KB