aboutsummaryrefslogtreecommitdiff
path: root/plat
diff options
context:
space:
mode:
authorVikram Kanigiri <vikram.kanigiri@arm.com>2014-03-21 11:57:10 +0000
committerDan Handley <dan.handley@arm.com>2014-03-26 17:36:35 +0000
commitd118f9f864267670fb9cb1790d7d6dd620e0f6ed (patch)
tree49ad67bbcdd6ee90fc111fc0f27a9e03fd49b8d1 /plat
parent886278e55f3a7e5ab1ba8e12974cf824778c5995 (diff)
downloadarm-trusted-firmware-d118f9f864267670fb9cb1790d7d6dd620e0f6ed.tar.gz
Add standby state support in PSCI cpu_suspend api
This patch adds support in the generic PSCI implementation to call a platform specific function to enter a standby state using an example implementation in ARM FVP port Fixes ARM-software/tf-issues#94 Change-Id: Ic1263fcf25f28e09162ad29dca954125f9aa8cc9
Diffstat (limited to 'plat')
-rw-r--r--plat/fvp/plat_pm.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/plat/fvp/plat_pm.c b/plat/fvp/plat_pm.c
index dd7a4b3..7b51476 100644
--- a/plat/fvp/plat_pm.c
+++ b/plat/fvp/plat_pm.c
@@ -44,6 +44,29 @@
#include <psci.h>
/*******************************************************************************
+ * FVP handler called when an affinity instance is about to enter standby.
+ ******************************************************************************/
+int fvp_affinst_standby(unsigned int power_state)
+{
+ unsigned int target_afflvl;
+
+ /* Sanity check the requested state */
+ target_afflvl = psci_get_pstate_afflvl(power_state);
+
+ /*
+ * It's possible to enter standby only on affinity level 0 i.e. a cpu
+ * on the FVP. Ignore any other affinity level.
+ */
+ if (target_afflvl != MPIDR_AFFLVL0)
+ return PSCI_E_INVALID_PARAMS;
+
+ /* Enter standby state */
+ wfi();
+
+ return PSCI_E_SUCCESS;
+}
+
+/*******************************************************************************
* FVP handler called when an affinity instance is about to be turned on. The
* level and mpidr determine the affinity instance.
******************************************************************************/
@@ -372,7 +395,7 @@ int fvp_affinst_suspend_finish(unsigned long mpidr,
* Export the platform handlers to enable psci to invoke them
******************************************************************************/
static plat_pm_ops fvp_plat_pm_ops = {
- 0,
+ fvp_affinst_standby,
fvp_affinst_on,
fvp_affinst_off,
fvp_affinst_suspend,