summaryrefslogtreecommitdiff
path: root/services/std_svc/psci/psci_main.c
diff options
context:
space:
mode:
authorVikram Kanigiri <vikram.kanigiri@arm.com>2014-04-01 19:26:26 +0100
committerVikram Kanigiri <vikram.kanigiri@arm.com>2014-04-29 14:40:15 +0100
commit759ec93b6916dccca3e445e20b3bd2e20d1117d0 (patch)
treede6341f67ab68096d46043febd87966cf0f975ed /services/std_svc/psci/psci_main.c
parent429421de8297172e43b507b732e1cd6be06dfc21 (diff)
Preserve PSCI cpu_suspend 'power_state' parameter.
This patch saves the 'power_state' parameter prior to suspending a cpu and invalidates it upon its resumption. The 'affinity level' and 'state id' fields of this parameter can be read using a set of public and private apis. Validation of power state parameter is introduced which checks for SBZ bits are zero. This change also takes care of flushing the parameter from the cache to main memory. This ensures that it is available after cpu reset when the caches and mmu are turned off. The earlier support for saving only the 'affinity level' field of the 'power_state' parameter has also been reworked. Fixes ARM-Software/tf-issues#26 Fixes ARM-Software/tf-issues#130 Change-Id: Ic007ccb5e39bf01e0b67390565d3b4be33f5960a
Diffstat (limited to 'services/std_svc/psci/psci_main.c')
-rw-r--r--services/std_svc/psci/psci_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/std_svc/psci/psci_main.c b/services/std_svc/psci/psci_main.c
index 2d61ec08..c90929dd 100644
--- a/services/std_svc/psci/psci_main.c
+++ b/services/std_svc/psci/psci_main.c
@@ -85,6 +85,10 @@ int psci_cpu_suspend(unsigned int power_state,
unsigned long mpidr;
unsigned int target_afflvl, pstate_type;
+ /* Check SBZ bits in power state are zero */
+ if (psci_validate_power_state(power_state))
+ return PSCI_E_INVALID_PARAMS;
+
/* Sanity check the requested state */
target_afflvl = psci_get_pstate_afflvl(power_state);
if (target_afflvl > MPIDR_MAX_AFFLVL)