From 4bd4ae519b02a9afd236f4c78d4654bdc0e942c2 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Wed, 1 Jun 2016 14:49:04 +0100 Subject: Add PSCI STAT helper APIs This patch adds PSCI_STAT_COUNT and PSCI_STAT_RESIDENCY helper functions to the TFTF framework. Change-Id: I624b25c8ccbb540f69392900890940fc16197001 --- lib/psci/psci.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/psci/psci.c b/lib/psci/psci.c index d761747..682ad5c 100644 --- a/lib/psci/psci.c +++ b/lib/psci/psci.c @@ -97,7 +97,35 @@ int32_t tftf_psci_cpu_off(void) smc64_ret_values ret_vals; ret_vals = tftf_smc64(&args); + return ret_vals.ret0; +} + +u_register_t tftf_psci_stat_residency(u_register_t target_cpu, + uint32_t power_state) +{ + smc64_args args = { + SMC_PSCI_STAT_RESIDENCY64, + target_cpu, + power_state, + }; + smc64_ret_values ret_vals; + + ret_vals = tftf_smc64(&args); + return ret_vals.ret0; +} + +u_register_t tftf_psci_stat_count(u_register_t target_cpu, + uint32_t power_state) +{ + smc64_args args = { + SMC_PSCI_STAT_COUNT64, + target_cpu, + power_state, + }; + smc64_ret_values ret_vals; + + ret_vals = tftf_smc64(&args); return ret_vals.ret0; } @@ -307,4 +335,3 @@ unsigned int tftf_get_psci_version(void) return ret.ret0; } - -- cgit v1.2.3