Commit d75f2578 authored by Soby Mathew's avatar Soby Mathew
Browse files

Enable PSCI_STAT_COUNT/RESIDENCY for ARM standard platforms

This patch enables optional PSCI functions `PSCI_STAT_COUNT` and
`PSCI_STAT_RESIDENCY` for ARM standard platforms. The optional platform
API 'translate_power_state_by_mpidr()' is implemented for the Juno
platform. 'validate_power_state()' on Juno downgrades PSCI CPU_SUSPEND
requests for the system power level to the cluster power level.
Hence, it is not suitable for validating the 'power_state' parameter
passed in a PSCI_STAT_COUNT/RESIDENCY call.

Change-Id: I9548322676fa468d22912392f2325c2a9f96e4d2
parent 170fb93d
...@@ -59,6 +59,19 @@ static int juno_validate_power_state(unsigned int power_state, ...@@ -59,6 +59,19 @@ static int juno_validate_power_state(unsigned int power_state,
return rc; return rc;
} }
/*
* Custom `translate_power_state_by_mpidr` handler for Juno. Unlike in the
* `juno_validate_power_state`, we do not down-grade the system power
* domain level request in `power_state` as it will be used to query the
* PSCI_STAT_COUNT/RESIDENCY at the system power domain level.
*/
static int juno_translate_power_state_by_mpidr(u_register_t mpidr,
unsigned int power_state,
psci_power_state_t *output_state)
{
return arm_validate_power_state(power_state, output_state);
}
/******************************************************************************* /*******************************************************************************
* Export the platform handlers via plat_arm_psci_pm_ops. The ARM Standard * Export the platform handlers via plat_arm_psci_pm_ops. The ARM Standard
* platform will take care of registering the handlers with PSCI. * platform will take care of registering the handlers with PSCI.
...@@ -74,5 +87,6 @@ const plat_psci_ops_t plat_arm_psci_pm_ops = { ...@@ -74,5 +87,6 @@ const plat_psci_ops_t plat_arm_psci_pm_ops = {
.system_reset = css_system_reset, .system_reset = css_system_reset,
.validate_power_state = juno_validate_power_state, .validate_power_state = juno_validate_power_state,
.validate_ns_entrypoint = arm_validate_ns_entrypoint, .validate_ns_entrypoint = arm_validate_ns_entrypoint,
.get_sys_suspend_power_state = css_get_sys_suspend_power_state .get_sys_suspend_power_state = css_get_sys_suspend_power_state,
.translate_power_state_by_mpidr = juno_translate_power_state_by_mpidr
}; };
...@@ -82,6 +82,9 @@ ARM_BL31_IN_DRAM := 0 ...@@ -82,6 +82,9 @@ ARM_BL31_IN_DRAM := 0
$(eval $(call assert_boolean,ARM_BL31_IN_DRAM)) $(eval $(call assert_boolean,ARM_BL31_IN_DRAM))
$(eval $(call add_define,ARM_BL31_IN_DRAM)) $(eval $(call add_define,ARM_BL31_IN_DRAM))
# Enable PSCI_STAT_COUNT/RESIDENCY APIs on ARM platforms
ENABLE_PSCI_STAT = 1
PLAT_INCLUDES += -Iinclude/common/tbbr \ PLAT_INCLUDES += -Iinclude/common/tbbr \
-Iinclude/plat/arm/common \ -Iinclude/plat/arm/common \
-Iinclude/plat/arm/common/aarch64 -Iinclude/plat/arm/common/aarch64
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment