feat(brbe): add brbe under feature detection mechanism
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
diff --git a/lib/extensions/brbe/brbe.c b/lib/extensions/brbe/brbe.c
index 6975b04..1982619 100644
--- a/lib/extensions/brbe/brbe.c
+++ b/lib/extensions/brbe/brbe.c
@@ -5,22 +5,14 @@
*/
#include <arch.h>
+#include <arch_features.h>
#include <arch_helpers.h>
-static bool brbe_supported(void)
-{
- uint64_t features;
-
- features = read_id_aa64dfr0_el1() >> ID_AA64DFR0_BRBE_SHIFT;
- return ((features & ID_AA64DFR0_BRBE_MASK) ==
- ID_AA64DFR0_BRBE_SUPPORTED);
-}
-
void brbe_enable(void)
{
uint64_t val;
- if (brbe_supported()) {
+ if (is_feat_brbe_present()) {
/*
* MDCR_EL3.SBRBE = 0b01
*