aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2011-06-08 06:42:43 -0400
committerWill Deacon <will.deacon@arm.com>2011-07-07 14:20:52 -0400
commit18b9dc130c33de2d1fd46bd668e67d0e1a544b16 (patch)
tree6baac3359f06737ab27d28d2c29311334aa39313 /arch/arm/vfp
parent254cdf8ec39653d19cce71b6622f38a6b62ac3a8 (diff)
ARM: vfp: add VFPv4 capability detection and populate elf_hwcap
The presence of VFPv4 cannot be detected simply by looking at the FPSID subarchitecture field, as a value >= 2 signifies the architecture as VFPv3 or later. This patch reads from MVFR1 to check whether or not the fused multiply accumulate instructions are supported. Since these are introduced with VFPv4, this tells us what we need to know. Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r--arch/arm/vfp/vfpmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index f25e7ec8941..650d90be0f9 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -582,7 +582,6 @@ static int __init vfp_init(void)
582 elf_hwcap |= HWCAP_VFPv3D16; 582 elf_hwcap |= HWCAP_VFPv3D16;
583 } 583 }
584#endif 584#endif
585#ifdef CONFIG_NEON
586 /* 585 /*
587 * Check for the presence of the Advanced SIMD 586 * Check for the presence of the Advanced SIMD
588 * load/store instructions, integer and single 587 * load/store instructions, integer and single
@@ -590,10 +589,13 @@ static int __init vfp_init(void)
590 * for NEON if the hardware has the MVFR registers. 589 * for NEON if the hardware has the MVFR registers.
591 */ 590 */
592 if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) { 591 if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) {
592#ifdef CONFIG_NEON
593 if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100) 593 if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
594 elf_hwcap |= HWCAP_NEON; 594 elf_hwcap |= HWCAP_NEON;
595 }
596#endif 595#endif
596 if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
597 elf_hwcap |= HWCAP_VFPv4;
598 }
597 } 599 }
598 return 0; 600 return 0;
599} 601}