diff options
author | johpow01 <john.powell@arm.com> | 2020-04-22 14:05:13 -0500 |
---|---|---|
committer | John <john.powell@arm.com> | 2020-05-19 21:49:52 +0000 |
commit | 6cac724d52cc8d6cac9b47f186cc47f4b3cf6bd6 (patch) | |
tree | 1dbf1feb70c4dbc8636b87f0fdb83766f0bac6e8 /plat/common | |
parent | f1a1653ce17861441383ae58a3df929cb521c9d8 (diff) | |
download | trusted-firmware-a-6cac724d52cc8d6cac9b47f186cc47f4b3cf6bd6.tar.gz |
Enable v8.6 WFE trap delays
This patch enables the v8.6 extension to add a delay before WFE traps
are taken. A weak hook plat_arm_set_twedel_scr_el3 has been added in
plat/common/aarch64/plat_common.c that disables this feature by default
but platform-specific code can override it when needed.
The only hook provided sets the TWED fields in SCR_EL3, there are similar
fields in HCR_EL2, SCTLR_EL2, and SCTLR_EL1 to control WFE trap delays in
lower ELs but these should be configured by code running at EL2 and/or EL1
depending on the platform configuration and is outside the scope of TF-A.
Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I0a9bb814205efeab693a3d0a0623e62144abba2d
Diffstat (limited to 'plat/common')
-rw-r--r-- | plat/common/aarch64/plat_common.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c index 63871d9e57..b8a4d012e8 100644 --- a/plat/common/aarch64/plat_common.c +++ b/plat/common/aarch64/plat_common.c @@ -11,6 +11,7 @@ #if RAS_EXTENSION #include <lib/extensions/ras.h> #endif +#include <lib/extensions/twed.h> #include <lib/xlat_tables/xlat_mmu_helpers.h> #include <plat/common/platform.h> @@ -20,6 +21,7 @@ * platforms but may also be overridden by a platform if required. */ #pragma weak bl31_plat_runtime_setup +#pragma weak plat_arm_set_twedel_scr_el3 #if SDEI_SUPPORT #pragma weak plat_sdei_handle_masked_trigger @@ -100,3 +102,16 @@ void plat_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie, #endif panic(); } + +/******************************************************************************* + * In v8.6+ platforms with delayed trapping of WFE this hook sets the delay. It + * is a weak function definition so can be overridden depending on the + * requirements of a platform. The only hook provided is for the TWED fields + * in SCR_EL3, the TWED fields in HCR_EL2, SCTLR_EL2, and SCTLR_EL1 should be + * configured as needed in lower exception levels. + ******************************************************************************/ + +uint32_t plat_arm_set_twedel_scr_el3(void) +{ + return TWED_DISABLED; +} |