summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Porotchkin <kostap@marvell.com>2017-02-23 13:20:40 +0200
committerKostya Porotchkin <kostap@marvell.com>2017-07-11 11:00:01 +0300
commit468975dc7296a8b93c4721f519300dc0250a5f16 (patch)
tree2035e6d62d1347cf1892fa690308cbcca4d98e24
parent57b341095efbdb87da7dbbc307a1cb0b69895baa (diff)
pm: a8k: Add get_sys_suspend_power_state handler
Implement the missing get_sys_suspend_power_state handler in patform PM module for enabling "suspend to RAM" support in Linux kernel Change-Id: Ia6a4efc417ca5fc90f274a151b0bff93b679f9c1 Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/40477 Tested-by: iSoC Platform CI <ykjenk@marvell.com>
-rw-r--r--plat/marvell/a8k/common/plat_pm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/plat/marvell/a8k/common/plat_pm.c b/plat/marvell/a8k/common/plat_pm.c
index 2b155d68..efed0a83 100644
--- a/plat/marvell/a8k/common/plat_pm.c
+++ b/plat/marvell/a8k/common/plat_pm.c
@@ -503,6 +503,19 @@ void a8k_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
}
/*******************************************************************************
+ * This handler is called by the PSCI implementation during the `SYSTEM_SUSPEND`
+ * call to get the `power_state` parameter. This allows the platform to encode
+ * the appropriate State-ID field within the `power_state` parameter which can
+ * be utilized in `pwr_domain_suspend()` to suspend to system affinity level.
+ ******************************************************************************/
+void a8k_get_sys_suspend_power_state(psci_power_state_t *req_state)
+{
+ /* lower affinities use PLAT_MAX_OFF_STATE */
+ for (int i = MPIDR_AFFLVL0; i <= PLAT_MAX_PWR_LVL; i++)
+ req_state->pwr_domain_state[i] = PLAT_MAX_OFF_STATE;
+}
+
+/*******************************************************************************
* A8K handlers to shutdown/reboot the system
******************************************************************************/
static void __dead2 a8k_system_off(void)
@@ -532,6 +545,7 @@ const plat_psci_ops_t plat_arm_psci_pm_ops = {
.pwr_domain_off = a8k_pwr_domain_off,
.pwr_domain_suspend = a8k_pwr_domain_suspend,
.pwr_domain_on_finish = a8k_pwr_domain_on_finish,
+ .get_sys_suspend_power_state = a8k_get_sys_suspend_power_state,
.pwr_domain_suspend_finish = a8k_pwr_domain_suspend_finish,
.system_off = a8k_system_off,
.system_reset = a8k_system_reset,