]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: vfp: Add vfp_disable for problematic platforms
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 17 Apr 2015 23:53:58 +0000 (16:53 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Wed, 20 May 2015 22:07:00 +0000 (15:07 -0700)
Some platforms might not be able to fully utilize VFP when e.g: one CPU
out of two in a SMP complex lacks a VFP unit. Adding code to migrate
task to the CPU which has a VFP unit would be cumbersome and not
performant, instead, just add the ability to disable VFP.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
arch/arm/include/asm/vfp.h
arch/arm/vfp/vfpmodule.c

index 03f9ca3cdfa465045a03805c44bb65153a207e69..22e414056a8c253822012c18d389122317fdbfc1 100644 (file)
@@ -91,4 +91,8 @@
 #define VFPOPDESC_UNUSED_MASK  (0xFF << VFPOPDESC_UNUSED_BIT)
 #define VFPOPDESC_OPDESC_MASK  (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
 
+#ifndef __ASSEMBLY__
+void vfp_disable(void);
+#endif
+
 #endif /* __ASM_VFP_H */
index f6e4d56eda007faeb26639fc54a2014b8fae1b58..2a61e4b04600896329bb0ca8f316cb3861ed2cf2 100644 (file)
@@ -445,6 +445,19 @@ static void vfp_enable(void *unused)
        set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
 }
 
+/* Called by platforms on which we want to disable VFP because it may not be
+ * present on all CPUs within a SMP complex. Needs to be called prior to
+ * vfp_init().
+ */
+void vfp_disable(void)
+{
+       if (VFP_arch) {
+               pr_debug("%s: should be called prior to vfp_init\n", __func__);
+               return;
+       }
+       VFP_arch = 1;
+}
+
 #ifdef CONFIG_CPU_PM
 static int vfp_pm_suspend(void)
 {