[PATCH] UBUNTU: SAUCE: IMX51: only export NEON flag to userspace on Freescale iMX51 rev3.x or later silicon

Bryan Wu bryan.wu at canonical.com
Wed Jan 27 05:00:22 UTC 2010


BugLink: http://bugs.launchpad.net/bugs/507416

NEON function is broken on old Freescale iMX51 silicons, such as rev1.x and
rev2.x. Since more and more iMX51 based products will move to rev3.x or later
silicon, we need to enable NEON on these newer silicons and disable NEON on
those old ones.

This patch will detect the silicon revision dynamically and only export NEON
flag to userspace on Freescale iMX51 rev3.x or later silicon. It was tested on
Babbage 3.0 board and Babbage 2.x board.

Signed-off-by: Bryan Wu <bryan.wu at canonical.com>
---
 arch/arm/vfp/vfpmodule.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 2d7423a..e0d6b01 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -432,6 +432,10 @@ out:
 
 #include <linux/smp.h>
 
+#if defined(CONFIG_ARCH_MX51) && defined(CONFIG_NEON)
+#include <mach/hardware.h>
+#endif
+
 /*
  * VFP support code initialisation.
  */
@@ -498,7 +502,8 @@ static int __init vfp_init(void)
 		 * load/store instructions, integer and single
 		 * precision floating point operations.
 		 */
-		if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
+		if (((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
+			&& cpu_is_mx51_rev(CHIP_REV_3_0) > 0)
 			elf_hwcap |= HWCAP_NEON;
 #endif
 	}
-- 
1.6.3.3





More information about the kernel-team mailing list