diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-03-27 13:09:23 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-03-30 11:03:43 +0100 |
commit | 359b706473b47da3c93bd99fd10d798fe411ab67 (patch) | |
tree | 2b0727207e192f5fe08b39bc55d6263a7a2cd01b /arch/arm64/include | |
parent | fef7f2b2010381c795ae43743ad31931cc58f5ad (diff) | |
download | talos-op-linux-359b706473b47da3c93bd99fd10d798fe411ab67.tar.gz talos-op-linux-359b706473b47da3c93bd99fd10d798fe411ab67.zip |
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.h | 15 |
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 @@ #ifndef __ASSEMBLY__ +struct arm64_cpu_capabilities { + const char *desc; + u16 capability; + bool (*matches)(const struct arm64_cpu_capabilities *); + union { + struct { /* To be used for erratum handling only */ + u32 midr_model; + u32 midr_range_min, midr_range_max; + }; + }; +}; + extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); static inline bool cpu_have_feature(unsigned int num) @@ -51,7 +63,10 @@ static inline void cpus_set_cap(unsigned int num) __set_bit(num, cpu_hwcaps); } +void check_cpu_capabilities(const struct arm64_cpu_capabilities *caps, + const char *info); void check_local_cpu_errata(void); +void check_local_cpu_features(void); bool cpu_supports_mixed_endian_el0(void); bool system_supports_mixed_endian_el0(void); |