Browse Source
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>pull/2000/merge
Govindraj Raja
5 months ago
4 changed files with 93 additions and 2 deletions
@ -0,0 +1,25 @@ |
|||
/*
|
|||
* Copyright (c) 2024, ARM Limited and Contributors. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
#ifndef FVP_CPU_PWR_H |
|||
#define FVP_CPU_PWR_H |
|||
|
|||
#ifndef __ASSEMBLER__ |
|||
#include <stdbool.h> |
|||
#include <stdint.h> |
|||
|
|||
#if __aarch64__ |
|||
bool check_cpupwrctrl_el1_is_available(void); |
|||
#endif /* __aarch64__ */ |
|||
#endif /* __ASSEMBLER__ */ |
|||
|
|||
/*******************************************************************************
|
|||
* CPU Power Control register specific definitions |
|||
******************************************************************************/ |
|||
#define CPUPWRCTLR_EL1 S3_0_C15_C2_7 |
|||
#define CPUPWRCTLR_EL1_CORE_PWRDN_BIT U(1) |
|||
|
|||
#endif /* FVP_CPU_PWR_H */ |
@ -0,0 +1,45 @@ |
|||
/*
|
|||
* 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__ */ |
Loading…
Reference in new issue