refactor(fvp): add support for cluster power-on

All new FVP's have incorporated the following PYSR bits

bit 31 is cluster ON status
bit 30 is core ON status
bit 29 is thread ON status

So add support to check cluster power ON which is supported from
affinity-level-2

But older cores with no DSU still uses affinity-level-1 for cluster
power-on status.

Ref: https://developer.arm.com/documentation/100964/1125/Base-Platform/Base---components

Change-Id: Id86811b14685d9ca900021301e5e8b7d52189963
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
This commit is contained in:
Govindraj Raja 2024-10-15 16:59:36 -05:00
parent 1b9795244e
commit b9c3a8c028

View file

@ -323,13 +323,13 @@ static int fvp_node_hw_state(u_register_t target_cpu,
unsigned int power_level)
{
unsigned int psysr;
int ret;
int ret = 0;
/*
* The format of 'power_level' is implementation-defined, but 0 must
* mean a CPU. We also allow 1 to denote the cluster
*/
if ((power_level != ARM_PWR_LVL0) && (power_level != ARM_PWR_LVL1))
if ((power_level < ARM_PWR_LVL0) || (power_level > ARM_PWR_LVL1))
return PSCI_E_INVALID_PARAMS;
/*
@ -343,9 +343,14 @@ static int fvp_node_hw_state(u_register_t target_cpu,
if (power_level == ARM_PWR_LVL0) {
ret = ((psysr & PSYSR_AFF_L0) != 0U) ? HW_ON : HW_OFF;
} else {
/* power_level == ARM_PWR_LVL1 */
ret = ((psysr & PSYSR_AFF_L1) != 0U) ? HW_ON : HW_OFF;
} else if (power_level == ARM_PWR_LVL1) {
/*
* Use L1 affinity if MPIDR_EL1.MT bit is not set else use L2 affinity.
*/
if ((read_mpidr_el1() & MPIDR_MT_MASK) == 0U)
ret = ((psysr & PSYSR_AFF_L1) != 0U) ? HW_ON : HW_OFF;
else
ret = ((psysr & PSYSR_AFF_L2) != 0U) ? HW_ON : HW_OFF;
}
return ret;