ARM: OMAP2+: sleep33/43xx: Make sleep actions configurable

Add an argument to the sleep33xx and sleep43xx code to allow us to set
flags to determine which portions of the code get called in order to use
the same code for multiple power saving modes. This patch allows us to
decide whether or not we flush and disable caches, save EMIF context,
put the memory into self refresh and disable the EMIF, and/or invoke
the wkup_m3 when entering into WFI.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
Dave Gerlach
2018-07-09 13:03:16 +05:30
committed by Tony Lindgren
parent eb07fe9f9f
commit 74655749a5
5 changed files with 144 additions and 10 deletions

View File

@@ -12,6 +12,29 @@
#include <linux/kbuild.h>
#include <linux/types.h>
/*
* WFI Flags for sleep code control
*
* These flags allow PM code to exclude certain operations from happening
* in the low level ASM code found in sleep33xx.S and sleep43xx.S
*
* WFI_FLAG_FLUSH_CACHE: Flush the ARM caches and disable caching. Only
* needed when MPU will lose context.
* WFI_FLAG_SELF_REFRESH: Let EMIF place DDR memory into self-refresh and
* disable EMIF.
* WFI_FLAG_SAVE_EMIF: Save context of all EMIF registers and restore in
* resume path. Only needed if PER domain loses context
* and must also have WFI_FLAG_SELF_REFRESH set.
* WFI_FLAG_WAKE_M3: Disable MPU clock or clockdomain to cause wkup_m3 to
* execute when WFI instruction executes.
* WFI_FLAG_RTC_ONLY: Configure the RTC to enter RTC+DDR mode.
*/
#define WFI_FLAG_FLUSH_CACHE BIT(0)
#define WFI_FLAG_SELF_REFRESH BIT(1)
#define WFI_FLAG_SAVE_EMIF BIT(2)
#define WFI_FLAG_WAKE_M3 BIT(3)
#define WFI_FLAG_RTC_ONLY BIT(4)
#ifndef __ASSEMBLER__
struct am33xx_pm_sram_addr {
void (*do_wfi)(void);
@@ -23,7 +46,8 @@ struct am33xx_pm_sram_addr {
struct am33xx_pm_platform_data {
int (*init)(void);
int (*soc_suspend)(unsigned int state, int (*fn)(unsigned long));
int (*soc_suspend)(unsigned int state, int (*fn)(unsigned long),
unsigned long args);
struct am33xx_pm_sram_addr *(*get_sram_addrs)(void);
};