diff options
author | Stefan Krsmanovic <stefan.krsmanovic@aggios.com> | 2016-05-09 18:00:47 +0200 |
---|---|---|
committer | Soren Brinkmann <soren.brinkmann@xilinx.com> | 2016-09-13 09:19:02 -0700 |
commit | eccc7cde9f3eba2de4e533dcc7fde117adbf59cc (patch) | |
tree | 43890b6d1c5c415051595980bce712483221a085 | |
parent | 797ab652fbd33d9ef12dc641edcb665808c4d2aa (diff) |
zynqmp: Add simple implementation of zynqmp_validate_power_state()
Implementation is based on arm_validate_power_state().
This function is called during CPU_SUSPEND PSCI call to validate
power_state parameter. If state is valid this function populate it
in req_state array as power domain level specific local state.
ATF platform migration guide chapter 2.2 defines this function as
mandatory for PSCIv1.0 CPU_SUSPEND support.
Signed-off-by: Stefan Krsmanovic <stefan.krsmanovic@aggios.com>
-rw-r--r-- | plat/xilinx/zynqmp/plat_psci.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plat/xilinx/zynqmp/plat_psci.c b/plat/xilinx/zynqmp/plat_psci.c index 56eb742a..f0e260de 100644 --- a/plat/xilinx/zynqmp/plat_psci.c +++ b/plat/xilinx/zynqmp/plat_psci.c @@ -308,7 +308,20 @@ int zynqmp_validate_power_state(unsigned int power_state, { VERBOSE("%s: power_state: 0x%x\n", __func__, power_state); - /* FIXME: populate req_state */ + int pstate = psci_get_pstate_type(power_state); + + assert(req_state); + + /* Sanity check the requested state */ + if (pstate == PSTATE_TYPE_STANDBY) + req_state->pwr_domain_state[MPIDR_AFFLVL0] = PLAT_MAX_RET_STATE; + else + req_state->pwr_domain_state[MPIDR_AFFLVL0] = PLAT_MAX_OFF_STATE; + + /* We expect the 'state id' to be zero */ + if (psci_get_pstate_id(power_state)) + return PSCI_E_INVALID_PARAMS; + return PSCI_E_SUCCESS; } |