diff options
-rw-r--r-- | lib/psci/psci_main.c | 8 | ||||
-rw-r--r-- | lib/psci/psci_suspend.c | 13 | ||||
-rw-r--r-- | plat/freescale/imx8qm/include/platform_def.h | 2 | ||||
-rw-r--r-- | plat/freescale/imx8qxp/include/platform_def.h | 2 |
4 files changed, 25 insertions, 0 deletions
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c index 2f42b812..5cdc1afd 100644 --- a/lib/psci/psci_main.c +++ b/lib/psci/psci_main.c @@ -182,10 +182,18 @@ int psci_system_suspend(uintptr_t entrypoint, u_register_t context_id) * might return if the power down was abandoned for any reason, e.g. * arrival of an interrupt */ + +#ifdef SYSTEM_SUSPEND_USE_STANDBY + psci_cpu_suspend_start(&ep, + PLAT_MAX_PWR_LVL, + &state_info, + PSTATE_TYPE_STANDBY); +#else psci_cpu_suspend_start(&ep, PLAT_MAX_PWR_LVL, &state_info, PSTATE_TYPE_POWERDOWN); +#endif return PSCI_E_SUCCESS; } diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c index 47988926..a9428ba1 100644 --- a/lib/psci/psci_suspend.c +++ b/lib/psci/psci_suspend.c @@ -234,8 +234,21 @@ exit: * requested at multiple power levels. This means that the cpu * context will be preserved. */ + +#ifdef SYSTEM_SUSPEND_USE_STANDBY + write_icc_igrpen1_el1(1); + write_scr_el3(read_scr_el3() | 0x4); + isb(); +#endif + wfi(); +#ifdef SYSTEM_SUSPEND_USE_STANDBY + write_icc_igrpen1_el1(0); + write_scr_el3(read_scr_el3() & (~0x4)); + isb(); +#endif + #if ENABLE_PSCI_STAT plat_psci_stat_accounting_stop(state_info); psci_stats_update_pwr_up(end_pwrlvl, state_info); diff --git a/plat/freescale/imx8qm/include/platform_def.h b/plat/freescale/imx8qm/include/platform_def.h index ab3c9e27..0f3aad8f 100644 --- a/plat/freescale/imx8qm/include/platform_def.h +++ b/plat/freescale/imx8qm/include/platform_def.h @@ -83,6 +83,8 @@ #define COUNTER_FREQUENCY 8000000 /* 8MHz */ +#define SYSTEM_SUSPEND_USE_STANDBY 1 + #define DEBUG_CONSOLE 0 #define DEBUG_CONSOLE_A53 0 #define PLAT_IMX8QM 1 diff --git a/plat/freescale/imx8qxp/include/platform_def.h b/plat/freescale/imx8qxp/include/platform_def.h index 50f77b16..717f693d 100644 --- a/plat/freescale/imx8qxp/include/platform_def.h +++ b/plat/freescale/imx8qxp/include/platform_def.h @@ -75,6 +75,8 @@ #define COUNTER_FREQUENCY 8000000 /* 8MHz */ +#define SYSTEM_SUSPEND_USE_STANDBY 1 + #define DEBUG_CONSOLE 0 #define DEBUG_CONSOLE_A35 0 #define PLAT_IMX8QXP 1 |