summaryrefslogtreecommitdiff
path: root/include/psci.h
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 /include/psci.h
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 'include/psci.h')
-rw-r--r--include/psci.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/psci.h b/include/psci.h
index 5c66789e..e2907937 100644
--- a/include/psci.h
+++ b/include/psci.h
@@ -73,6 +73,7 @@
#define PSTATE_ID_MASK 0xffff
#define PSTATE_TYPE_MASK 0x1
#define PSTATE_AFF_LVL_MASK 0x3
+#define PSTATE_VALID_MASK 0xFCFE0000
#define PSTATE_TYPE_STANDBY 0x0
#define PSTATE_TYPE_POWERDOWN 0x1
@@ -118,9 +119,14 @@
#define PSCI_STATE_ON_PENDING 0x2
#define PSCI_STATE_SUSPEND 0x3
+#define PSCI_INVALID_DATA -1
+
#define get_phys_state(x) (x != PSCI_STATE_ON ? \
PSCI_STATE_OFF : PSCI_STATE_ON)
+#define psci_validate_power_state(pstate) (pstate & PSTATE_VALID_MASK)
+
+
/* Number of affinity instances whose state this psci imp. can track */
#define PSCI_NUM_AFFS 32ull
@@ -182,6 +188,9 @@ extern int psci_cpu_on(unsigned long,
extern void psci_aff_on_finish_entry(void);
extern void psci_aff_suspend_finish_entry(void);
extern void psci_register_spd_pm_hook(const spd_pm_ops *);
+extern int psci_get_suspend_stateid(unsigned long mpidr);
+extern int psci_get_suspend_afflvl(unsigned long mpidr);
+
#endif /*__ASSEMBLY__*/