feat(brbe): test that EL3 has properly enabled access to BRBE
Access to FEAT_BRBE control registers must be explicitly enabled in EL3,
this simple test just ensures that the registers are accessible or traps
to EL3, similar to the TRBE test.
Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I0a25c5ce6beb6aa96b9428264b75cb3569ac535a
diff --git a/include/lib/aarch64/arch.h b/include/lib/aarch64/arch.h
index 399da93..dd0f899 100644
--- a/include/lib/aarch64/arch.h
+++ b/include/lib/aarch64/arch.h
@@ -167,6 +167,11 @@
#define ID_AA64DFR0_V8_2_DEBUG_ARCH_SUPPORTED U(8)
#define ID_AA64DFR0_V8_4_DEBUG_ARCH_SUPPORTED U(9)
+/* ID_AA64DFR0_EL1.BRBE definitions */
+#define ID_AA64DFR0_BRBE_SHIFT U(52)
+#define ID_AA64DFR0_BRBE_MASK ULL(0xf)
+#define ID_AA64DFR0_BRBE_SUPPORTED ULL(1)
+
/* ID_AA64DFR0_EL1.TraceBuffer definitions */
#define ID_AA64DFR0_TRACEBUFFER_SHIFT U(44)
#define ID_AA64DFR0_TRACEBUFFER_MASK ULL(0xf)
@@ -1114,6 +1119,19 @@
#define TRBIDR_EL1 S3_0_C9_C11_7
/*******************************************************************************
+ * FEAT_BRBE - Branch Record Buffer Extension System Registers
+ ******************************************************************************/
+
+#define BRBCR_EL1 S2_1_C9_C0_0
+#define BRBCR_EL2 S2_4_C9_C0_0
+#define BRBFCR_EL1 S2_1_C9_C0_1
+#define BRBTS_EL1 S2_1_C9_C0_2
+#define BRBINFINJ_EL1 S2_1_C9_C1_0
+#define BRBSRCINJ_EL1 S2_1_C9_C1_1
+#define BRBTGTINJ_EL1 S2_1_C9_C1_2
+#define BRBIDR0_EL1 S2_1_C9_C2_0
+
+/*******************************************************************************
* Armv8.4 - Trace Filter System Registers
******************************************************************************/
#define TRFCR_EL1 S3_0_C1_C2_1