mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 18:14:24 +00:00

This change adds "FEAT_BRBE" to be part of feature detection mechanism. Previously feature enablement flags were of boolean type, possessing either 0 or 1. With the introduction of feature detection procedure we now support three states for feature enablement build flags(0 to 2). Accordingly, "ENABLE_BRBE_FOR_NS" flag is now modified from boolean to numeric type to align with the feature detection. Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com> Change-Id: I1eb52863b4afb10b808e2f0b6584a8a210d0f38c
27 lines
516 B
C
27 lines
516 B
C
/*
|
|
* Copyright (c) 2022, Arm Limited. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <arch.h>
|
|
#include <arch_features.h>
|
|
#include <arch_helpers.h>
|
|
|
|
void brbe_enable(void)
|
|
{
|
|
uint64_t val;
|
|
|
|
if (is_feat_brbe_present()) {
|
|
/*
|
|
* MDCR_EL3.SBRBE = 0b01
|
|
*
|
|
* Allows BRBE usage in non-secure world and prohibited in
|
|
* secure world.
|
|
*/
|
|
val = read_mdcr_el3();
|
|
val &= ~(MDCR_SBRBE_MASK << MDCR_SBRBE_SHIFT);
|
|
val |= (0x1UL << MDCR_SBRBE_SHIFT);
|
|
write_mdcr_el3(val);
|
|
}
|
|
}
|