arm-trusted-firmware/lib/extensions/trf/aarch32/trf.c
Boyan Karatotev 99506face1 fix(cm): set MDCR_EL3.{NSPBE, STE} explicitly
With the introduction of FEAT_RME MDCR_EL3 bits NSPB and NSPBE depend on
each other. The enable code relies on the register being initialised to
zero and omits to reset NSPBE. However, this is not obvious. Reset the
bit explicitly to document this.

Similarly, reset the STE bit , since it's part of the feature enablement.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I3714507bae10042cdccd2b7bc713b31d4cdeb02f
2023-07-24 11:04:38 +01:00

24 lines
408 B
C

/*
* Copyright (c) 2021-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdbool.h>
#include <arch.h>
#include <arch_helpers.h>
#include <lib/extensions/trf.h>
void trf_init_el3(void)
{
uint32_t val;
/*
* Allow access of trace filter control registers from
* non-monitor mode.
*/
val = read_sdcr();
val &= ~(SDCR_TTRF_BIT);
write_sdcr(val);
}