aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/vfp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 15:58:32 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 15:58:32 -0800
commite05135d1550e73f722ae92909f9c9f44b305e9e2 (patch)
tree2348efab16091746012672c65b8b5140792a2da1 /arch/arm/vfp
parent8eefb2b7ad6195f4324629f35be0b9443cd8ee96 (diff)
parente9ccb79927225d8cd8d022a7c09bfb2fad935b89 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 4017/1: [Jornada7xx] - Updating Jornada720.c [ARM] 3992/1: i.MX/MX1 CPU Frequency scaling support [ARM] Provide a method to alter the control register [ARM] 4016/1: prefetch macro is wrong wrt gcc's "delete-null-pointer-checks" [ARM] Remove empty fixup function [ARM] 4014/1: include drivers/hid/Kconfig [ARM] 4013/1: clocksource driver for netx [ARM] 4012/1: Clocksource for pxa [ARM] Clean up ioremap code [ARM] Unuse another Linux PTE bit [ARM] Clean up KERNEL_RAM_ADDR [ARM] Add sys_*at syscalls [ARM] 4004/1: S3C24XX: UDC remove implict addition of VA to regs [ARM] Formalise the ARMv6 processor name string [ARM] Handle HWCAP_VFP in VFP support code [ARM] 4011/1: AT91SAM9260: Fix compilation with NAND driver [ARM] 4010/1: AT91SAM9260-EK board: Prepare for MACB Ethernet support
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r--arch/arm/vfp/vfpmodule.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index f08eafbddcc..e26cc1f5994 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -263,13 +263,24 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
if (exceptions)
vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs);
}
-
+
/*
* VFP support code initialisation.
*/
static int __init vfp_init(void)
{
unsigned int vfpsid;
+ unsigned int cpu_arch = cpu_architecture();
+ u32 access = 0;
+
+ if (cpu_arch >= CPU_ARCH_ARMv6) {
+ access = get_copro_access();
+
+ /*
+ * Enable full access to VFP (cp10 and cp11)
+ */
+ set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
+ }
/*
* First check that there is a VFP that we can use.
@@ -281,6 +292,12 @@ static int __init vfp_init(void)
printk(KERN_INFO "VFP support v0.3: ");
if (VFP_arch) {
printk("not present\n");
+
+ /*
+ * Restore the copro access register.
+ */
+ if (cpu_arch >= CPU_ARCH_ARMv6)
+ set_copro_access(access);
} else if (vfpsid & FPSID_NODOUBLE) {
printk("no double precision support\n");
} else {
@@ -291,9 +308,16 @@ static int __init vfp_init(void)
(vfpsid & FPSID_PART_MASK) >> FPSID_PART_BIT,
(vfpsid & FPSID_VARIANT_MASK) >> FPSID_VARIANT_BIT,
(vfpsid & FPSID_REV_MASK) >> FPSID_REV_BIT);
+
vfp_vector = vfp_support_entry;
thread_register_notifier(&vfp_notifier_block);
+
+ /*
+ * We detected VFP, and the support code is
+ * in place; report VFP support to userspace.
+ */
+ elf_hwcap |= HWCAP_VFP;
}
return 0;
}