diff options
author | Andre Przywara <andre.przywara@arm.com> | 2022-11-17 16:42:09 +0000 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2023-02-27 18:04:14 +0000 |
commit | ff491036603c34bd80137f5fd43878eae5585197 (patch) | |
tree | a99e2a46cdc393e71b0528a6e97d7dd24a74a5ff /lib/el3_runtime | |
parent | f5360cfa819f13ed1caf1cfb774a876bc3f29377 (diff) | |
download | arm-trusted-firmware-ff491036603c34bd80137f5fd43878eae5585197.tar.gz |
refactor(brbe): enable FEAT_BRBE for FEAT_STATE_CHECKED
At the moment we only support FEAT_BRBE to be either unconditionally
compiled in, or to be not supported at all.
Add support for runtime detection (ENABLE_BRBE_FOR_NS=2), by splitting
is_feat_brbe_present() into an ID register reading function and a second
function to report the support status. That function considers both
build time settings and runtime information (if needed), and is used
before we access BRBE related registers.
The FVP platform decided to compile in support unconditionally (=1),
even though FEAT_BRBE is an ARMv9 feature, so is not available with the
FVP model's default command line.
Change that to the now supported dynamic option (=2), so the right
decision can be made by the code at runtime.
Change-Id: I5f2e2c9648300f65f0fa9a5f8e2f34e73529d053
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'lib/el3_runtime')
-rw-r--r-- | lib/el3_runtime/aarch64/context_mgmt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c index 1dfb71f76..54e257b75 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -499,9 +499,9 @@ static void manage_extensions_nonsecure(bool el2_unused, cpu_context_t *ctx) trbe_enable(); } -#if ENABLE_BRBE_FOR_NS - brbe_enable(); -#endif /* ENABLE_BRBE_FOR_NS */ + if (is_feat_brbe_supported()) { + brbe_enable(); + } #if ENABLE_SYS_REG_TRACE_FOR_NS sys_reg_trace_enable(ctx); |