summaryrefslogtreecommitdiff
path: root/lib/extensions/trf/aarch64/trf.c
blob: 941692bb40b92dac7cb023587862bede9d779489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Copyright (c) 2021, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <arch.h>
#include <arch_features.h>
#include <arch_helpers.h>
#include <lib/extensions/trf.h>

void trf_enable(void)
{
	uint64_t val;

	/*
	 * MDCR_EL3.TTRF = b0
	 * Allow access of trace filter control registers from NS-EL2
	 * and NS-EL1 when NS-EL2 is implemented but not used
	 */
	val = read_mdcr_el3();
	val &= ~MDCR_TTRF_BIT;
	write_mdcr_el3(val);
}