blob: e2c2f2ccfcb7e142798ebd5d8bd1b299014ba329 [file] [log] [blame]
Antonio Nino Diaz69068db2019-01-11 13:01:45 +00001/*
2 * Copyright (c) 2019, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef ARCH_FEATURES_H
8#define ARCH_FEATURES_H
9
10#include <stdbool.h>
11
12#include <arch_helpers.h>
13
Antonio Nino Diazffdfd162019-02-11 15:34:32 +000014static inline bool is_armv7_gentimer_present(void)
15{
16 return ((read_id_pfr1() >> ID_PFR1_GENTIMER_SHIFT) &
17 ID_PFR1_GENTIMER_MASK) != 0U;
18}
19
Ambroise Vincentfae77722019-03-07 10:17:15 +000020static inline bool is_armv8_2_sve_present(void)
21{
22 /* SVE is not usable in aarch32 */
23 return false;
24}
25
Antonio Nino Diaz69068db2019-01-11 13:01:45 +000026static inline bool is_armv8_2_ttcnp_present(void)
27{
28 return ((read_id_mmfr4() >> ID_MMFR4_CNP_SHIFT) &
29 ID_MMFR4_CNP_MASK) != 0U;
30}
31
Petre-Ionut Tudorf1a45f72019-10-08 16:51:45 +010032static inline uint32_t arch_get_debug_version(void)
33{
34 return ((read_dbgdidr() & DBGDIDR_VERSION_BITS) >>
35 DBGDIDR_VERSION_SHIFT);
36}
37
Antonio Nino Diaz69068db2019-01-11 13:01:45 +000038#endif /* ARCH_FEATURES_H */