Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 7 | #include <arch.h> |
Andre Przywara | 06ea44e | 2022-11-17 17:30:43 +0000 | [diff] [blame] | 8 | #include <arch_features.h> |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 9 | #include <arch_helpers.h> |
| 10 | #include <lib/extensions/trf.h> |
| 11 | |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 12 | void trf_enable(void) |
| 13 | { |
| 14 | uint64_t val; |
| 15 | |
Andre Przywara | 06ea44e | 2022-11-17 17:30:43 +0000 | [diff] [blame] | 16 | /* |
| 17 | * MDCR_EL3.TTRF = b0 |
| 18 | * Allow access of trace filter control registers from NS-EL2 |
| 19 | * and NS-EL1 when NS-EL2 is implemented but not used |
| 20 | */ |
| 21 | val = read_mdcr_el3(); |
| 22 | val &= ~MDCR_TTRF_BIT; |
| 23 | write_mdcr_el3(val); |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 24 | } |