On 10 Sep 02, Nicolas Pitre wrote:
> On Thu, 2 Sep 2010, Amit Kucheria wrote:
> 
> Instead of having this empty mx51_neon_fixup() in the #else part...
> 
> > @@ -98,3 +120,4 @@ static int __init post_cpu_init(void)
> >  }
> >  
> >  postcore_initcall(post_cpu_init);
> > +late_initcall(mx51_neon_fixup);
> 
> ... why don't you move this late_initcall() _inside_ the #ifdef CONFIG_NEON ?

Elegant. Please find patch attached. If someone with a TO2 board can test
this, there is a uImage with this patch and Nico's at
http://people.canonical.com/~amitk/imx5/uImage

Regards,
Amit

>From ee41c96eb92a1561cbbde6bafffa87ba11c7544d Mon Sep 17 00:00:00 2001
Message-Id: 
<ee41c96eb92a1561cbbde6bafffa87ba11c7544d.1283442320.git.amit.kuche...@linaro.org>
From: Amit Kucheria <amit.kuche...@verdurent.com>
Date: Wed, 1 Sep 2010 22:49:13 +0300
Subject: [PATCH] mxc: turn off HWCAP_NEON for older versions of imx51 silicon

Versions of silicon older than TO3 have broken NEON implementation. Turn off
NEON in such cases.

Signed-off-by: Amit Kucheria <amit.kuche...@linaro.org>
---
 arch/arm/mach-mx5/cpu.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
index 2d37785..06e1717 100644
--- a/arch/arm/mach-mx5/cpu.c
+++ b/arch/arm/mach-mx5/cpu.c
@@ -70,6 +70,25 @@ int mx51_revision(void)
 }
 EXPORT_SYMBOL(mx51_revision);
 
+#ifdef CONFIG_NEON
+
+/* All versions of the silicon before Rev. 3 have broken NEON implementations.
+ * Dependent on link order - so the assumption is that vfp_init is called 
before us
+ */
+static int __init mx51_neon_fixup(void)
+{
+       if (mx51_revision() <  MX51_CHIP_REV_3_0) {
+               if (elf_hwcap & HWCAP_NEON) {
+                       elf_hwcap &= ~HWCAP_NEON;
+                       pr_info("Turning off NEON support, detected broken NEON 
implemention\n");
+               }
+       }
+       return 0;
+}
+
+late_initcall(mx51_neon_fixup);
+#endif
+
 static int __init post_cpu_init(void)
 {
        unsigned int reg;
-- 
1.7.0.4


_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to