summaryrefslogtreecommitdiff
path: root/include/arch/aarch32/el3_common_macros.S
diff options
context:
space:
mode:
authorManish V Badarkhe <Manish.Badarkhe@arm.com>2021-07-18 02:26:27 +0100
committerManish V Badarkhe <Manish.Badarkhe@arm.com>2021-08-26 09:29:51 +0100
commit5de20ece38f782c8459f546a08c6a97b9e0f5bc5 (patch)
tree0d9e1539626ea6d1be950fd746f272e0d3ee01cb /include/arch/aarch32/el3_common_macros.S
parentd4582d30885673987240cf01fd4f5d2e6780e84c (diff)
feat(trf): initialize trap settings of trace filter control registers access
Trap bits of trace filter control registers access are in architecturally UNKNOWN state at boot hence 1. Initialized trap bits to one to prohibit trace filter control registers accesses in lower ELs (EL2, EL1) in all security states when FEAT_TRF is implemented. 2. These bits are RES0 when FEAT_TRF is not implemented and hence set it to zero to aligns with the Arm ARM reference recommendation, that mentions software must writes RES0 bits with all 0s. Change-Id: I1b7abf2170ece84ee585c91cda32d22b25c0fc34 Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Diffstat (limited to 'include/arch/aarch32/el3_common_macros.S')
-rw-r--r--include/arch/aarch32/el3_common_macros.S15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/arch/aarch32/el3_common_macros.S b/include/arch/aarch32/el3_common_macros.S
index 49e8518d3..65f9a8e6b 100644
--- a/include/arch/aarch32/el3_common_macros.S
+++ b/include/arch/aarch32/el3_common_macros.S
@@ -131,9 +131,22 @@
* in Secure state. This bit is RES0 in versions of the architecture
* earlier than ARMv8.5, setting it to 1 doesn't have any effect on
* them.
+ *
+ * SDCR.TTRF: Set to one so that access to trace filter control
+ * registers in non-monitor mode generate Monitor trap exception,
+ * unless the access generates a higher priority exception when
+ * trace filter control(FEAT_TRF) is implemented.
+ * When FEAT_TRF is not implemented, this bit is RES0.
* ---------------------------------------------------------------------
*/
- ldr r0, =(SDCR_RESET_VAL | SDCR_SPD(SDCR_SPD_DISABLE) | SDCR_SCCD_BIT)
+ ldr r0, =((SDCR_RESET_VAL | SDCR_SPD(SDCR_SPD_DISABLE) | \
+ SDCR_SCCD_BIT) & ~SDCR_TTRF_BIT)
+ ldcopr r1, ID_DFR0
+ ubfx r1, r1, #ID_DFR0_TRACEFILT_SHIFT, #ID_DFR0_TRACEFILT_LENGTH
+ cmp r1, #ID_DFR0_TRACEFILT_SUPPORTED
+ bne 1f
+ orr r0, r0, #SDCR_TTRF_BIT
+1:
stcopr r0, SDCR
/* ---------------------------------------------------------------------