From 31244d74b350d49cfba6ad46d90dad2d5f2f364c Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Tue, 30 Sep 2014 11:19:51 +0100 Subject: Save 'power_state' early in PSCI CPU_SUSPEND call This patch adds support to save the "power state" parameter before the affinity level specific handlers are called in a CPU_SUSPEND call. This avoids the need to pass the power_state as a parameter to the handlers and Secure Payload Dispatcher (SPD) suspend spd_pm_ops. The power_state arguments in the spd_pm_ops operations are now reserved and must not be used. The SPD can query the relevant power_state fields by using the psci_get_suspend_afflvl() & psci_get_suspend_stateid() APIs. NOTE: THIS PATCH WILL BREAK THE SPD_PM_OPS INTERFACE. HENCE THE SECURE PAYLOAD DISPATCHERS WILL NEED TO BE REWORKED TO USE THE NEW INTERFACE. Change-Id: I1293d7dc8cf29cfa6a086a009eee41bcbf2f238e --- services/spd/tspd/tspd_pm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'services/spd/tspd/tspd_pm.c') diff --git a/services/spd/tspd/tspd_pm.c b/services/spd/tspd/tspd_pm.c index 16552853..17abaea6 100644 --- a/services/spd/tspd/tspd_pm.c +++ b/services/spd/tspd/tspd_pm.c @@ -49,7 +49,7 @@ static void tspd_cpu_on_handler(uint64_t target_cpu) * This cpu is being turned off. Allow the TSPD/TSP to perform any actions * needed ******************************************************************************/ -static int32_t tspd_cpu_off_handler(uint64_t cookie) +static int32_t tspd_cpu_off_handler(uint64_t unused) { int32_t rc = 0; uint64_t mpidr = read_mpidr(); @@ -83,7 +83,7 @@ static int32_t tspd_cpu_off_handler(uint64_t cookie) * This cpu is being suspended. S-EL1 state must have been saved in the * resident cpu (mpidr format) if it is a UP/UP migratable TSP. ******************************************************************************/ -static void tspd_cpu_suspend_handler(uint64_t power_state) +static void tspd_cpu_suspend_handler(uint64_t unused) { int32_t rc = 0; uint64_t mpidr = read_mpidr(); @@ -93,10 +93,7 @@ static void tspd_cpu_suspend_handler(uint64_t power_state) assert(tsp_vectors); assert(get_tsp_pstate(tsp_ctx->state) == TSP_PSTATE_ON); - /* Program the entry point, power_state parameter and enter the TSP */ - write_ctx_reg(get_gpregs_ctx(&tsp_ctx->cpu_ctx), - CTX_GPREG_X0, - power_state); + /* Program the entry point and enter the TSP */ cm_set_elr_el3(SECURE, (uint64_t) &tsp_vectors->cpu_suspend_entry); rc = tspd_synchronous_sp_entry(tsp_ctx); @@ -117,7 +114,7 @@ static void tspd_cpu_suspend_handler(uint64_t power_state) * after initialising minimal architectural state that guarantees safe * execution. ******************************************************************************/ -static void tspd_cpu_on_finish_handler(uint64_t cookie) +static void tspd_cpu_on_finish_handler(uint64_t unused) { int32_t rc = 0; uint64_t mpidr = read_mpidr(); -- cgit