mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-08 18:41:22 +00:00
refactor(psci): don't use PSCI_INVALID_PWR_LVL to signal OFF state
The target_pwrlvl field in the psci cpu data struct only stores the highest power domain that a CPU_SUSPEND call affected, and is used to resume those same domains on warm reset. If the cpu is otherwise OFF (never turned on or CPU_OFF), then this needs to be the highest power level because we don't know the highest level that will be off. So skip the invalidation and always keep the field to the maximum value. During suspend the field will be lowered to the appropriate value and then put back after wakeup. Also, do that in the suspend to standby path as well as it will have been written before the sleep and it might end up incorrect. Change-Id: I614272ec387e1d83023c94700780a0f538a9a6b6 Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
This commit is contained in:
parent
39fba640de
commit
0c836554b2
4 changed files with 11 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -54,6 +54,9 @@ static void psci_suspend_to_standby_finisher(unsigned int cpu_idx,
|
|||
*/
|
||||
psci_plat_pm_ops->pwr_domain_suspend_finish(&state_info);
|
||||
|
||||
/* This loses its meaning when not suspending, reset so it's correct for OFF */
|
||||
psci_set_suspend_pwrlvl(PLAT_MAX_PWR_LVL);
|
||||
|
||||
/*
|
||||
* Set the requested and target state of this CPU and all the higher
|
||||
* power domain levels for this CPU to run.
|
||||
|
@ -363,8 +366,8 @@ void psci_cpu_suspend_finish(unsigned int cpu_idx, const psci_power_state_t *sta
|
|||
psci_spd_pm->svc_suspend_finish(max_off_lvl);
|
||||
}
|
||||
|
||||
/* Invalidate the suspend level for the cpu */
|
||||
psci_set_suspend_pwrlvl(PSCI_INVALID_PWR_LVL);
|
||||
/* This loses its meaning when not suspending, reset so it's correct for OFF */
|
||||
psci_set_suspend_pwrlvl(PLAT_MAX_PWR_LVL);
|
||||
|
||||
PUBLISH_EVENT(psci_suspend_pwrdown_finish);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue