summaryrefslogtreecommitdiff
path: root/services/spd
diff options
context:
space:
mode:
authorJorge Ramirez-Ortiz <jramirez@baylibre.com>2018-08-30 16:12:12 +0200
committerJorge Ramirez-Ortiz <jramirez@baylibre.com>2018-08-31 15:41:51 +0200
commit820540bf23d837353abad25bbb68fe026852d654 (patch)
tree0a813e0eb87a7110bf509456f8a2fadd95f3cc10 /services/spd
parent2a7c9e15c23b376121747ccae78bef91db6225ba (diff)
opteed: pass power level on suspend
Some platforms might chose to take different actions depending on this value; this is precisely the case for rcar-gen3. Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
Diffstat (limited to 'services/spd')
-rw-r--r--services/spd/opteed/opteed_pm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/spd/opteed/opteed_pm.c b/services/spd/opteed/opteed_pm.c
index bdacf986..b1336517 100644
--- a/services/spd/opteed/opteed_pm.c
+++ b/services/spd/opteed/opteed_pm.c
@@ -66,6 +66,9 @@ static void opteed_cpu_suspend_handler(u_register_t max_off_pwrlvl)
assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON);
+ write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx), CTX_GPREG_X0,
+ max_off_pwrlvl);
+
/* Program the entry point and enter OPTEE */
cm_set_elr_el3(SECURE, (uint64_t) &optee_vector_table->cpu_suspend_entry);
rc = opteed_synchronous_sp_entry(optee_ctx);