aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-03-27 09:09:23 -0400
committerWill Deacon <will.deacon@arm.com>2015-03-30 06:03:43 -0400
commit359b706473b47da3c93bd99fd10d798fe411ab67 (patch)
tree2b0727207e192f5fe08b39bc55d6263a7a2cd01b /arch/arm64/include
parentfef7f2b2010381c795ae43743ad31931cc58f5ad (diff)
arm64: Extract feature parsing code from cpu_errata.c
As we detect more architectural features at runtime, it makes sense to reuse the existing framework whilst avoiding to call a feature an erratum... This patch extract the core capability parsing, moves it into a new file (cpufeature.c), and let the CPU errata detection code use it. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/cpufeature.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index b6c16d5f622f..6ae35d160464 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -28,6 +28,18 @@
28 28
29#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
30 30
31struct arm64_cpu_capabilities {
32 const char *desc;
33 u16 capability;
34 bool (*matches)(const struct arm64_cpu_capabilities *);
35 union {
36 struct { /* To be used for erratum handling only */
37 u32 midr_model;
38 u32 midr_range_min, midr_range_max;
39 };
40 };
41};
42
31extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); 43extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS);
32 44
33static inline bool cpu_have_feature(unsigned int num) 45static inline bool cpu_have_feature(unsigned int num)
@@ -51,7 +63,10 @@ static inline void cpus_set_cap(unsigned int num)
51 __set_bit(num, cpu_hwcaps); 63 __set_bit(num, cpu_hwcaps);
52} 64}
53 65
66void check_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
67 const char *info);
54void check_local_cpu_errata(void); 68void check_local_cpu_errata(void);
69void check_local_cpu_features(void);
55bool cpu_supports_mixed_endian_el0(void); 70bool cpu_supports_mixed_endian_el0(void);
56bool system_supports_mixed_endian_el0(void); 71bool system_supports_mixed_endian_el0(void);
57 72