Antonio Nino Diaz | c326c34 | 2019-01-11 11:20:10 +0000 | [diff] [blame] | 1 | /* |
| 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 Diaz | d29d21e | 2019-02-06 09:23:04 +0000 | [diff] [blame] | 14 | static 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 | |
Antonio Nino Diaz | c326c34 | 2019-01-11 11:20:10 +0000 | [diff] [blame] | 20 | static inline bool is_armv8_2_ttcnp_present(void) |
| 21 | { |
| 22 | return ((read_id_mmfr4() >> ID_MMFR4_CNP_SHIFT) & |
| 23 | ID_MMFR4_CNP_MASK) != 0U; |
| 24 | } |
| 25 | |
| 26 | #endif /* ARCH_FEATURES_H */ |