diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2007-09-25 10:22:24 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-26 09:41:28 -0500 |
commit | 25ebee020bd34d1f4c5678538204f0b10bf9f6d5 (patch) | |
tree | b9b04ddf0b9916922a3cba47a7f64f44cd0b28ff /include/asm-arm | |
parent | c98929c07a01c9ec2e1e5253456acc7168da8b66 (diff) |
[ARM] 4583/1: ARMv7: Add VFPv3 support
This patch adds the support for VFPv3 (the kernel currently supports
VFPv2). The main difference is 32 double registers (compared to 16).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/fpstate.h | 9 | ||||
-rw-r--r-- | include/asm-arm/vfp.h | 6 | ||||
-rw-r--r-- | include/asm-arm/vfpmacros.h | 18 |
3 files changed, 29 insertions, 4 deletions
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h index f31cda5a55ee..392eb5332323 100644 --- a/include/asm-arm/fpstate.h +++ b/include/asm-arm/fpstate.h | |||
@@ -17,14 +17,18 @@ | |||
17 | /* | 17 | /* |
18 | * VFP storage area has: | 18 | * VFP storage area has: |
19 | * - FPEXC, FPSCR, FPINST and FPINST2. | 19 | * - FPEXC, FPSCR, FPINST and FPINST2. |
20 | * - 16 double precision data registers | 20 | * - 16 or 32 double precision data registers |
21 | * - an implementation-dependant word of state for FLDMX/FSTMX | 21 | * - an implementation-dependant word of state for FLDMX/FSTMX (pre-ARMv6) |
22 | * | 22 | * |
23 | * FPEXC will always be non-zero once the VFP has been used in this process. | 23 | * FPEXC will always be non-zero once the VFP has been used in this process. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | struct vfp_hard_struct { | 26 | struct vfp_hard_struct { |
27 | #ifdef CONFIG_VFPv3 | ||
28 | __u64 fpregs[32]; | ||
29 | #else | ||
27 | __u64 fpregs[16]; | 30 | __u64 fpregs[16]; |
31 | #endif | ||
28 | #if __LINUX_ARM_ARCH__ < 6 | 32 | #if __LINUX_ARM_ARCH__ < 6 |
29 | __u32 fpmx_state; | 33 | __u32 fpmx_state; |
30 | #endif | 34 | #endif |
@@ -35,6 +39,7 @@ struct vfp_hard_struct { | |||
35 | */ | 39 | */ |
36 | __u32 fpinst; | 40 | __u32 fpinst; |
37 | __u32 fpinst2; | 41 | __u32 fpinst2; |
42 | |||
38 | #ifdef CONFIG_SMP | 43 | #ifdef CONFIG_SMP |
39 | __u32 cpu; | 44 | __u32 cpu; |
40 | #endif | 45 | #endif |
diff --git a/include/asm-arm/vfp.h b/include/asm-arm/vfp.h index 9d474d47b266..5f9a2cb3d452 100644 --- a/include/asm-arm/vfp.h +++ b/include/asm-arm/vfp.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | #define FPSID cr0 | 8 | #define FPSID cr0 |
9 | #define FPSCR cr1 | 9 | #define FPSCR cr1 |
10 | #define MVFR1 cr6 | ||
11 | #define MVFR0 cr7 | ||
10 | #define FPEXC cr8 | 12 | #define FPEXC cr8 |
11 | #define FPINST cr9 | 13 | #define FPINST cr9 |
12 | #define FPINST2 cr10 | 14 | #define FPINST2 cr10 |
@@ -70,6 +72,10 @@ | |||
70 | #define FPSCR_IXC (1<<4) | 72 | #define FPSCR_IXC (1<<4) |
71 | #define FPSCR_IDC (1<<7) | 73 | #define FPSCR_IDC (1<<7) |
72 | 74 | ||
75 | /* MVFR0 bits */ | ||
76 | #define MVFR0_A_SIMD_BIT (0) | ||
77 | #define MVFR0_A_SIMD_MASK (0xf << MVFR0_A_SIMD_BIT) | ||
78 | |||
73 | /* Bit patterns for decoding the packaged operation descriptors */ | 79 | /* Bit patterns for decoding the packaged operation descriptors */ |
74 | #define VFPOPDESC_LENGTH_BIT (9) | 80 | #define VFPOPDESC_LENGTH_BIT (9) |
75 | #define VFPOPDESC_LENGTH_MASK (0x07 << VFPOPDESC_LENGTH_BIT) | 81 | #define VFPOPDESC_LENGTH_MASK (0x07 << VFPOPDESC_LENGTH_BIT) |
diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h index 27fe028b4e72..cccb3892e73c 100644 --- a/include/asm-arm/vfpmacros.h +++ b/include/asm-arm/vfpmacros.h | |||
@@ -15,19 +15,33 @@ | |||
15 | .endm | 15 | .endm |
16 | 16 | ||
17 | @ read all the working registers back into the VFP | 17 | @ read all the working registers back into the VFP |
18 | .macro VFPFLDMIA, base | 18 | .macro VFPFLDMIA, base, tmp |
19 | #if __LINUX_ARM_ARCH__ < 6 | 19 | #if __LINUX_ARM_ARCH__ < 6 |
20 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} | 20 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} |
21 | #else | 21 | #else |
22 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} | 22 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} |
23 | #endif | 23 | #endif |
24 | #ifdef CONFIG_VFPv3 | ||
25 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | ||
26 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | ||
27 | cmp \tmp, #2 @ 32 x 64bit registers? | ||
28 | ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | ||
29 | addne \base, \base, #32*4 @ step over unused register space | ||
30 | #endif | ||
24 | .endm | 31 | .endm |
25 | 32 | ||
26 | @ write all the working registers out of the VFP | 33 | @ write all the working registers out of the VFP |
27 | .macro VFPFSTMIA, base | 34 | .macro VFPFSTMIA, base, tmp |
28 | #if __LINUX_ARM_ARCH__ < 6 | 35 | #if __LINUX_ARM_ARCH__ < 6 |
29 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} | 36 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} |
30 | #else | 37 | #else |
31 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} | 38 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} |
32 | #endif | 39 | #endif |
40 | #ifdef CONFIG_VFPv3 | ||
41 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | ||
42 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | ||
43 | cmp \tmp, #2 @ 32 x 64bit registers? | ||
44 | stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | ||
45 | addne \base, \base, #32*4 @ step over unused register space | ||
46 | #endif | ||
33 | .endm | 47 | .endm |