diff options
author | danh-arm <dan.handley@arm.com> | 2016-07-04 16:32:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-04 16:32:24 +0100 |
commit | 10b93d79752d7818b6bc0cea97a839403f503e5b (patch) | |
tree | 6d784da65bc8360f1878430e469a8dd624e309e6 /services/std_svc/psci/psci_main.c | |
parent | 50f7101a49d39243cca5942e3a2eb92ab460bd14 (diff) | |
parent | d75f2578bb01937eca71e202643d5efb3453b283 (diff) |
Merge pull request #652 from soby-mathew/sm/pmf_psci_stat
Introduce PMF and implement PSCI STAT APIs
Diffstat (limited to 'services/std_svc/psci/psci_main.c')
-rw-r--r-- | services/std_svc/psci/psci_main.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/services/std_svc/psci/psci_main.c b/services/std_svc/psci/psci_main.c index 68ad5f63..86f45ca3 100644 --- a/services/std_svc/psci/psci_main.c +++ b/services/std_svc/psci/psci_main.c @@ -110,11 +110,32 @@ int psci_cpu_suspend(unsigned int power_state, */ cpu_pd_state = state_info.pwr_domain_state[PSCI_CPU_PWR_LVL]; psci_set_cpu_local_state(cpu_pd_state); + +#if ENABLE_PSCI_STAT + /* + * Capture time-stamp before CPU standby + * No cache maintenance is needed as caches + * are ON through out the CPU standby operation. + */ + PMF_CAPTURE_TIMESTAMP(psci_svc, PSCI_STAT_ID_ENTER_LOW_PWR, + PMF_NO_CACHE_MAINT); +#endif + psci_plat_pm_ops->cpu_standby(cpu_pd_state); /* Upon exit from standby, set the state back to RUN. */ psci_set_cpu_local_state(PSCI_LOCAL_STATE_RUN); +#if ENABLE_PSCI_STAT + /* Capture time-stamp after CPU standby */ + PMF_CAPTURE_TIMESTAMP(psci_svc, PSCI_STAT_ID_EXIT_LOW_PWR, + PMF_NO_CACHE_MAINT); + + /* Update PSCI stats */ + psci_stats_update_pwr_up(PSCI_CPU_PWR_LVL, &state_info, + PMF_NO_CACHE_MAINT); +#endif + return PSCI_E_SUCCESS; } @@ -368,6 +389,14 @@ uint64_t psci_smc_handler(uint32_t smc_fid, case PSCI_FEATURES: SMC_RET1(handle, psci_features(x1)); +#if ENABLE_PSCI_STAT + case PSCI_STAT_RESIDENCY_AARCH32: + SMC_RET1(handle, psci_stat_residency(x1, x2)); + + case PSCI_STAT_COUNT_AARCH32: + SMC_RET1(handle, psci_stat_count(x1, x2)); +#endif + default: break; } @@ -393,6 +422,14 @@ uint64_t psci_smc_handler(uint32_t smc_fid, case PSCI_SYSTEM_SUSPEND_AARCH64: SMC_RET1(handle, psci_system_suspend(x1, x2)); +#if ENABLE_PSCI_STAT + case PSCI_STAT_RESIDENCY_AARCH64: + SMC_RET1(handle, psci_stat_residency(x1, x2)); + + case PSCI_STAT_COUNT_AARCH64: + SMC_RET1(handle, psci_stat_count(x1, x2)); +#endif + default: break; } |