diff options
author | Soby Mathew <soby.mathew@arm.com> | 2016-10-10 17:26:45 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2016-11-25 16:38:27 +0000 |
commit | c946ed3a0338d2afe7d2f433f8b7f9051fee388e (patch) | |
tree | 201e94fc5e3470ddca4dd4840ffd8dcd5476002a /plat/common | |
parent | 9a0dcf4fde72376d811c3d672ab6b639a6080ed3 (diff) |
Add helper to get the deepest pstate at a given power level
This patch adds a new TFTF framework API `tftf_set_deepest_pstate_idx`
which sets the pstate indices corresponding to the deepest pstate at
a given power level for a platform. These indices can then be used to
construct the full `power_state` parameter using `tftf_get_pstate_vars()`
helper function.
Change-Id: Ie5c5ad1dd056c45f69f553d5cfadc6d33b4ef945
Diffstat (limited to 'plat/common')
-rw-r--r-- | plat/common/plat_state_id.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plat/common/plat_state_id.c b/plat/common/plat_state_id.c index 6128510..50609c6 100644 --- a/plat/common/plat_state_id.c +++ b/plat/common/plat_state_id.c @@ -119,6 +119,23 @@ void tftf_set_next_state_id_idx(unsigned int power_level, } } +void tftf_set_deepest_pstate_idx(unsigned int power_level, + unsigned int pstate_id_idx[]) +{ + int i; + + /* Verify that this is a valid power level. */ + assert(power_level <= PLAT_MAX_PWR_LEVEL); + + /* + * Assign the highest pstate_id_idx starting from the lowest power + * level + */ + for (i = 0; i <= power_level; i++) + pstate_id_idx[i] = power_states_per_level[i] - 1; +} + + int tftf_get_pstate_vars(unsigned int *test_power_level, unsigned int *test_suspend_type, unsigned int *suspend_state_id, |