From becdbaa12d58850efa65da9a3f623795aed8acfb Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Thu, 31 Dec 2009 08:32:05 +0000 Subject: Enable and initialize VFP on imx31. VFP state is not saved on thread change, and it is initialized for scalar operations, rounding toward zero, with exception/error handling and "correct" handling of NaN and denormal values disabled. In this mode it should still be usable for integer divisions (by casting operands to double and result to int or unsigned). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24129 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx31/crt0.S | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/firmware/target/arm/imx31/crt0.S b/firmware/target/arm/imx31/crt0.S index 7118c7572f..4afec85568 100644 --- a/firmware/target/arm/imx31/crt0.S +++ b/firmware/target/arm/imx31/crt0.S @@ -292,6 +292,25 @@ remap_end: /* Switch back to supervisor mode */ msr cpsr_c, #0xd3 + +#ifndef BOOTLOADER + /* Enable access to VFP */ + mrc p15, 0, r3, c1, c0, 2 + orr r3, r3, #0xf00000 + mcr p15, 0, r3, c1, c0, 2 + + /* Enable VFP */ + mrc p10, 7, r3, c8, c0, 0 + orr r3, r3, #1<<30 + mcr p10, 7, r3, c8, c0, 0 + + /* Disable exceptions, enable default NaN, flush-to-zero, round toward 0 */ + mrc p10, 7, r3, c1, c0, 0 + orr r3, r3, #15<<22 + bic r3, r3, #31<<8 + mcr p10, 7, r3, c1, c0, 0 +#endif + bl main #ifdef BOOTLOADER -- cgit v1.2.3