.. | .. |
---|
4 | 4 | |
---|
5 | 5 | #include <asm/barrier.h> |
---|
6 | 6 | #include <asm/errno.h> |
---|
| 7 | +#include <asm/hwcap.h> |
---|
7 | 8 | #include <linux/clocksource.h> |
---|
8 | 9 | #include <linux/init.h> |
---|
9 | 10 | #include <linux/types.h> |
---|
.. | .. |
---|
11 | 12 | #include <clocksource/arm_arch_timer.h> |
---|
12 | 13 | |
---|
13 | 14 | #ifdef CONFIG_ARM_ARCH_TIMER |
---|
| 15 | +/* 32bit ARM doesn't know anything about timer errata... */ |
---|
| 16 | +#define has_erratum_handler(h) (false) |
---|
| 17 | +#define erratum_handler(h) (arch_timer_##h) |
---|
| 18 | + |
---|
14 | 19 | int arch_timer_arch_init(void); |
---|
15 | 20 | |
---|
16 | 21 | /* |
---|
.. | .. |
---|
79 | 84 | return val; |
---|
80 | 85 | } |
---|
81 | 86 | |
---|
82 | | -static inline u64 arch_counter_get_cntpct(void) |
---|
| 87 | +static inline u64 __arch_counter_get_cntpct(void) |
---|
83 | 88 | { |
---|
84 | 89 | u64 cval; |
---|
85 | 90 | |
---|
.. | .. |
---|
88 | 93 | return cval; |
---|
89 | 94 | } |
---|
90 | 95 | |
---|
91 | | -static inline u64 arch_counter_get_cntvct(void) |
---|
| 96 | +static inline u64 __arch_counter_get_cntpct_stable(void) |
---|
| 97 | +{ |
---|
| 98 | + return __arch_counter_get_cntpct(); |
---|
| 99 | +} |
---|
| 100 | + |
---|
| 101 | +static inline u64 __arch_counter_get_cntvct(void) |
---|
92 | 102 | { |
---|
93 | 103 | u64 cval; |
---|
94 | 104 | |
---|
95 | 105 | isb(); |
---|
96 | 106 | asm volatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (cval)); |
---|
97 | 107 | return cval; |
---|
| 108 | +} |
---|
| 109 | + |
---|
| 110 | +static inline u64 __arch_counter_get_cntvct_stable(void) |
---|
| 111 | +{ |
---|
| 112 | + return __arch_counter_get_cntvct(); |
---|
98 | 113 | } |
---|
99 | 114 | |
---|
100 | 115 | static inline u32 arch_timer_get_cntkctl(void) |
---|
.. | .. |
---|
110 | 125 | isb(); |
---|
111 | 126 | } |
---|
112 | 127 | |
---|
| 128 | +static inline void arch_timer_set_evtstrm_feature(void) |
---|
| 129 | +{ |
---|
| 130 | + elf_hwcap |= HWCAP_EVTSTRM; |
---|
| 131 | +} |
---|
| 132 | + |
---|
| 133 | +static inline bool arch_timer_have_evtstrm_feature(void) |
---|
| 134 | +{ |
---|
| 135 | + return elf_hwcap & HWCAP_EVTSTRM; |
---|
| 136 | +} |
---|
113 | 137 | #endif |
---|
114 | 138 | |
---|
115 | 139 | #endif |
---|