mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 01:24:27 +00:00

Most newer CPU's have DSU and CPU power control core-off bit which means before turning off CPUs from base power controller we need to turn individual cores off from CPU Power control. However there are certain older CPU's that don't have DSU and don't support CPUPWRCTRL_EL1, so populate them as a list and ignore setting core-off bit for those older CPU's as all newer CPU's have them. Note: unfortunately there is no mechanism to identify if a DSU is present and CPUPWRCTRL_EL1 is supported through any CPU control registers and CPUPWRCTRL_EL1 is supported only for ARM64 platforms and not available in ARM32 platforms. Change-Id: Iba6c3c8db60dbeb177cead7ebc65df8265860da7 Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
45 lines
974 B
C
45 lines
974 B
C
/*
|
|
* Copyright (c) 2024, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#if __aarch64__
|
|
|
|
#include <aem_generic.h>
|
|
#include <arch_helpers.h>
|
|
#include <cortex_a35.h>
|
|
#include <cortex_a53.h>
|
|
#include <cortex_a57.h>
|
|
#include <cortex_a72.h>
|
|
#include <cortex_a73.h>
|
|
#include <cortex_a78_ae.h>
|
|
#include <drivers/arm/fvp/fvp_cpu_pwr.h>
|
|
#include <lib/utils_def.h>
|
|
#include <neoverse_e1.h>
|
|
|
|
bool check_cpupwrctrl_el1_is_available(void)
|
|
{
|
|
/* Poupulate list of CPU midr that doesn't support CPUPWRCTL_EL1 */
|
|
const unsigned int midr_no_cpupwrctl[] = {
|
|
BASE_AEM_MIDR,
|
|
CORTEX_A35_MIDR,
|
|
CORTEX_A53_MIDR,
|
|
CORTEX_A57_MIDR,
|
|
CORTEX_A72_MIDR,
|
|
CORTEX_A73_MIDR,
|
|
CORTEX_A78_AE_MIDR,
|
|
NEOVERSE_E1_MIDR
|
|
};
|
|
unsigned int midr = (unsigned int)read_midr();
|
|
|
|
for (unsigned int i = 0U; i < ARRAY_SIZE(midr_no_cpupwrctl); i++) {
|
|
if (midr_no_cpupwrctl[i] == midr) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
#endif /* __arch64__ */
|