summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2017-11-27 11:05:46 -0800
committerArve Hjønnevåg <arve@android.com>2018-01-24 17:43:48 -0800
commitfab2319ec8aa9532178c1c7b61035466e197f18e (patch)
treebec4fd3522897daba6613a514c33c6894ab79216 /services
parent27d8e1e75a2f45d7c2357bc9b42e9dbea9db0321 (diff)
trusty: Pass cpu suspend/resume reason to trusty
Add off/on argument to SMC_FC_CPU_SUSPEND SMC_FC_CPU_RESUME and pass 1 when called from the cpu on/off hooks. Change-Id: Ie233c446fd38b3ff8546e445a8d86a15d2816093 Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'services')
-rw-r--r--services/spd/trusty/trusty.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/services/spd/trusty/trusty.c b/services/spd/trusty/trusty.c
index 7fa207a3..7836ebad 100644
--- a/services/spd/trusty/trusty.c
+++ b/services/spd/trusty/trusty.c
@@ -327,22 +327,22 @@ static int32_t trusty_init(void)
return 0;
}
-static void trusty_cpu_suspend(void)
+static void trusty_cpu_suspend(uint32_t off)
{
struct args ret;
- ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_SUSPEND, 0, 0, 0);
+ ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_SUSPEND, off, 0, 0);
if (ret.r0 != 0) {
INFO("%s: cpu %d, SMC_FC_CPU_SUSPEND returned unexpected value, %ld\n",
__func__, plat_my_core_pos(), ret.r0);
}
}
-static void trusty_cpu_resume(void)
+static void trusty_cpu_resume(uint32_t on)
{
struct args ret;
- ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_RESUME, 0, 0, 0);
+ ret = trusty_context_switch(NON_SECURE, SMC_FC_CPU_RESUME, on, 0, 0);
if (ret.r0 != 0) {
INFO("%s: cpu %d, SMC_FC_CPU_RESUME returned unexpected value, %ld\n",
__func__, plat_my_core_pos(), ret.r0);
@@ -351,7 +351,7 @@ static void trusty_cpu_resume(void)
static int32_t trusty_cpu_off_handler(uint64_t unused)
{
- trusty_cpu_suspend();
+ trusty_cpu_suspend(1);
return 0;
}
@@ -363,18 +363,18 @@ static void trusty_cpu_on_finish_handler(uint64_t unused)
if (!ctx->saved_sp) {
trusty_init();
} else {
- trusty_cpu_resume();
+ trusty_cpu_resume(1);
}
}
static void trusty_cpu_suspend_handler(uint64_t unused)
{
- trusty_cpu_suspend();
+ trusty_cpu_suspend(0);
}
static void trusty_cpu_suspend_finish_handler(uint64_t unused)
{
- trusty_cpu_resume();
+ trusty_cpu_resume(0);
}
static const spd_pm_ops_t trusty_pm = {