blob: 463353b6e4dec807c073ccad457020a9785a90c5 [file] [log] [blame]
Jimmy Brisson945095a2020-04-16 10:54:59 -05001/*
2 * Copyright (c) 2020, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <test_helpers.h>
8#include <tftf.h>
9#include <tftf_lib.h>
10#include <string.h>
11
12/*
13 * TF-A is expected to allow access to CNTPOFF_EL2 register from EL2.
14 * Reading this register will trap to EL3 and crash when TF-A has not
15 * allowed access.
16 */
17test_result_t test_ecv_enabled(void)
18{
19 SKIP_TEST_IF_AARCH32();
20
21#ifdef __aarch64__
22 SKIP_TEST_IF_ECV_NOT_SELF_SYNC();
23 read_cntpoff_el2();
24
25 return TEST_RESULT_SUCCESS;
26#endif /* __aarch64__ */
27}