summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-12-31 08:32:05 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-12-31 08:32:05 +0000
commitbecdbaa12d58850efa65da9a3f623795aed8acfb (patch)
tree7c56258a5d04449a3952f3841e18b051fc57feaa /firmware
parentccb644191331dd506f96c474997895ce3ee2b279 (diff)
downloadrockbox-becdbaa12d58850efa65da9a3f623795aed8acfb.tar.gz
rockbox-becdbaa12d58850efa65da9a3f623795aed8acfb.tar.bz2
rockbox-becdbaa12d58850efa65da9a3f623795aed8acfb.zip
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
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/imx31/crt0.S19
1 files changed, 19 insertions, 0 deletions
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