opteed: pass power level on suspend
authorJorge Ramirez-Ortiz <[email protected]>
Thu, 30 Aug 2018 14:12:12 +0000 (16:12 +0200)
committerJorge Ramirez-Ortiz <[email protected]>
Fri, 31 Aug 2018 13:41:51 +0000 (15:41 +0200)
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 <[email protected]>
services/spd/opteed/opteed_pm.c

index bdacf98645a15387e27783e7ce32f70597c2664b..b1336517e7e1b9b14870bb69e4a0784e569cdcf1 100644 (file)
@@ -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);