diff options
author | Soby Mathew <soby.mathew@arm.com> | 2016-07-04 17:39:34 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2016-07-14 15:00:55 +0100 |
commit | 87efb3474ac4f168c364d76db26909a1ee1a5207 (patch) | |
tree | dcb771d969d1617c069f3426247a0b4a7bedba1d /tests/runtime_services | |
parent | b9724af4d9244ec6372b6bf5453d07fb2847ab9b (diff) |
Add helper for querying PSCI_FEATURES
This patch adds a new helper `tftf_get_psci_feature_info()` to
query the PSCI_FEATURES API. The tests which used PSCI_FEATURES API
are modified to use this new helper function.
Change-Id: If26e7739eafb6d6c410023e2cdc36f02fbb24823
Diffstat (limited to 'tests/runtime_services')
2 files changed, 6 insertions, 34 deletions
diff --git a/tests/runtime_services/standard_service/psci/api_tests/psci_features/test_psci_features.c b/tests/runtime_services/standard_service/psci/api_tests/psci_features/test_psci_features.c index db0baac..10a4492 100644 --- a/tests/runtime_services/standard_service/psci/api_tests/psci_features/test_psci_features.c +++ b/tests/runtime_services/standard_service/psci/api_tests/psci_features/test_psci_features.c @@ -34,24 +34,6 @@ #include <tftf_lib.h> /* - * Helper function to query PSCI features. - * Requires the PSCI function ID to query as an argument. - * Returns: Return code of the PSCI_FEATURES call - * (refer to the PSCI specification for details) - */ -static inline int32_t get_psci_feature_info(uint32_t psci_func_id) -{ - smc64_args args = { - SMC_PSCI_FEATURES, - psci_func_id - }; - smc64_ret_values ret; - - ret = tftf_smc64(&args); - return ret.ret0; -} - -/* * @Test_Aim@ Check the list of PSCI functions for PSCI support * * Call PSCI_FEATURES for each PSCI function ID. @@ -69,7 +51,7 @@ test_result_t test_psci_features(void) for (unsigned int i = 0; i < PSCI_NUM_CALLS; i++) { psci_fn = &psci_functions[i]; - ret_flag = get_psci_feature_info(psci_fn->id); + ret_flag = tftf_get_psci_feature_info(psci_fn->id); if (!psci_fn->mandatory) { /* @@ -124,7 +106,7 @@ test_result_t test_psci_features_invalid_id(void) { /* Invalid function ids for negative testing */ uint32_t invalid_psci_func = 0xc400a011; - uint32_t ret_flag = get_psci_feature_info(invalid_psci_func); + uint32_t ret_flag = tftf_get_psci_feature_info(invalid_psci_func); if (ret_flag == PSCI_E_NOT_SUPPORTED) return TEST_RESULT_SUCCESS; diff --git a/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c b/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c index 06dbdf5..dbb896e 100644 --- a/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c +++ b/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c @@ -50,6 +50,10 @@ #define SUSPEND_TIME_10_SECS 10000 #define TEST_ITERATION_COUNT 0x5 +/* Helper macro to verify if system suspend API is supported */ +#define is_psci_sys_susp_supported(void) \ + tftf_get_psci_feature_info(SMC_PSCI_SYSTEM_SUSPEND64) + static unsigned int deepest_power_state; static unsigned int test_target_node = PWR_DOMAIN_INIT; static event_t cpu_ready[PLATFORM_CORE_COUNT]; @@ -91,20 +95,6 @@ static int is_sys_suspend_state_ready(void) return 1; } -/* Helper function to verify if system suspend API is supported */ -static test_result_t is_psci_sys_susp_supported(void) -{ - smc64_args args = { - SMC_PSCI_FEATURES, - SMC_PSCI_SYSTEM_SUSPEND64 - }; - - smc64_ret_values ret; - - ret = tftf_smc64(&args); - return ret.ret0; -} - static int suspend_wakeup_handler(void *data) { unsigned int core_pos = platform_get_core_pos(read_mpidr_el1()); |