summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2014-07-25 14:52:47 +0100
committerSoby Mathew <soby.mathew@arm.com>2014-08-19 14:29:23 +0100
commit776b68ae59d10f956232aa208480cbd85f308c88 (patch)
tree245631238e36a53542e3bfd42d5ac54024deb31e /include
parent04fafcee2b08948d2d366c448bec059a90d224f4 (diff)
Add PSCI service specific per-CPU data
This patch adds a structure defined by the PSCI service to the per-CPU data array. The structure is used to save the 'power_state' parameter specified during a 'cpu_suspend' call on the current CPU. This parameter was being saved in the cpu node in the PSCI topology tree earlier. The existing API to return the state id specified during a PSCI CPU_SUSPEND call i.e. psci_get_suspend_stateid(mpidr) has been renamed to psci_get_suspend_stateid_by_mpidr(mpidr). The new psci_get_suspend_stateid() API returns the state id of the current cpu. The psci_get_suspend_afflvl() API has been changed to return the target affinity level of the current CPU. This was specified using the 'mpidr' parameter in the old implementation. The behaviour of the get_power_on_target_afflvl() has been tweaked such that traversal of the PSCI topology tree to locate the affinity instance node for the current CPU is done only in the debug build as it is an expensive operation. Change-Id: Iaad49db75abda471f6a82d697ee6e0df554c4caf
Diffstat (limited to 'include')
-rw-r--r--include/bl31/cpu_data.h3
-rw-r--r--include/bl31/services/psci.h13
2 files changed, 13 insertions, 3 deletions
diff --git a/include/bl31/cpu_data.h b/include/bl31/cpu_data.h
index 9015c4b..355160b 100644
--- a/include/bl31/cpu_data.h
+++ b/include/bl31/cpu_data.h
@@ -44,6 +44,7 @@
#include <arch_helpers.h>
#include <platform_def.h>
+#include <psci.h>
#include <stdint.h>
/*******************************************************************************
@@ -63,12 +64,12 @@
* by components that have per-cpu members. The member access macros should be
* used for this.
******************************************************************************/
-
typedef struct cpu_data {
void *cpu_context[2];
#if CRASH_REPORTING
uint64_t crash_buf[CPU_DATA_CRASH_BUF_SIZE >> 3];
#endif
+ struct psci_cpu_data psci_svc_cpu_data;
} __aligned(CACHE_WRITEBACK_GRANULE) cpu_data_t;
#if CRASH_REPORTING
diff --git a/include/bl31/services/psci.h b/include/bl31/services/psci.h
index 6512dfb..a89ba4e 100644
--- a/include/bl31/services/psci.h
+++ b/include/bl31/services/psci.h
@@ -131,6 +131,14 @@
#include <stdint.h>
+/*******************************************************************************
+ * Structure used to store per-cpu information relevant to the PSCI service.
+ * It is populated in the per-cpu data array. In return we get a guarantee that
+ * this information will not reside on a cache line shared with another cpu.
+ ******************************************************************************/
+typedef struct psci_cpu_data {
+ uint32_t power_state;
+} psci_cpu_data_t;
/*******************************************************************************
* Structure populated by platform specific code to export routines which
@@ -192,8 +200,9 @@ void __dead2 psci_power_down_wfi(void);
void psci_aff_on_finish_entry(void);
void psci_aff_suspend_finish_entry(void);
void psci_register_spd_pm_hook(const spd_pm_ops_t *);
-int psci_get_suspend_stateid(unsigned long mpidr);
-int psci_get_suspend_afflvl(unsigned long mpidr);
+int psci_get_suspend_stateid_by_mpidr(unsigned long);
+int psci_get_suspend_stateid(void);
+int psci_get_suspend_afflvl(void);
uint64_t psci_smc_handler(uint32_t smc_fid,
uint64_t x1,