diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2015-02-25 16:50:39 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2016-06-22 14:55:12 -0400 |
commit | 215e362dafede7cc691d8a573d2b31bc7138a770 (patch) | |
tree | 0d74459f20b700a50e6f3e637d5f8a017e3aecfd | |
parent | 2374b063c3dfbb68a40b52067eaff81510f384b1 (diff) |
ARM: 8306/1: loop_udelay: remove bogomips value limitation
Now that we don't support ARMv3 anymore, the loop based delay code can
convert microsecs into number of loops using a 64-bit multiplication
and more precision.
This allows us to lift the hard limit of 3355 on the bogomips value as
loops_per_jiffy may now safely span the full 32-bit range.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/include/asm/delay.h | 6 | ||||
-rw-r--r-- | arch/arm/lib/Makefile | 5 | ||||
-rw-r--r-- | arch/arm/lib/delay-loop.S | 15 |
3 files changed, 12 insertions, 14 deletions
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h index dff714d886d5..b7a428154355 100644 --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h | |||
@@ -10,8 +10,8 @@ | |||
10 | #include <asm/param.h> /* HZ */ | 10 | #include <asm/param.h> /* HZ */ |
11 | 11 | ||
12 | #define MAX_UDELAY_MS 2 | 12 | #define MAX_UDELAY_MS 2 |
13 | #define UDELAY_MULT ((UL(2199023) * HZ) >> 11) | 13 | #define UDELAY_MULT UL(2047 * HZ + 483648 * HZ / 1000000) |
14 | #define UDELAY_SHIFT 30 | 14 | #define UDELAY_SHIFT 31 |
15 | 15 | ||
16 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
17 | 17 | ||
@@ -34,7 +34,7 @@ extern struct arm_delay_ops { | |||
34 | * it, it means that you're calling udelay() with an out of range value. | 34 | * it, it means that you're calling udelay() with an out of range value. |
35 | * | 35 | * |
36 | * With currently imposed limits, this means that we support a max delay | 36 | * With currently imposed limits, this means that we support a max delay |
37 | * of 2000us. Further limits: HZ<=1000 and bogomips<=3355 | 37 | * of 2000us. Further limits: HZ<=1000 |
38 | */ | 38 | */ |
39 | extern void __bad_udelay(void); | 39 | extern void __bad_udelay(void); |
40 | 40 | ||
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index d8a780799506..27f4d96258a2 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile | |||
@@ -29,7 +29,10 @@ else | |||
29 | lib-y += io-readsw-armv4.o io-writesw-armv4.o | 29 | lib-y += io-readsw-armv4.o io-writesw-armv4.o |
30 | endif | 30 | endif |
31 | 31 | ||
32 | lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o | 32 | ifeq ($(CONFIG_ARCH_RPC),y) |
33 | lib-y += ecard.o io-acorn.o floppydma.o | ||
34 | AFLAGS_delay-loop.o += -march=armv4 | ||
35 | endif | ||
33 | 36 | ||
34 | $(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S | 37 | $(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S |
35 | $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S | 38 | $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S |
diff --git a/arch/arm/lib/delay-loop.S b/arch/arm/lib/delay-loop.S index 518bf6e93f78..792c59d885bc 100644 --- a/arch/arm/lib/delay-loop.S +++ b/arch/arm/lib/delay-loop.S | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <asm/assembler.h> | 11 | #include <asm/assembler.h> |
12 | #include <asm/delay.h> | 12 | #include <asm/delay.h> |
13 | |||
13 | .text | 14 | .text |
14 | 15 | ||
15 | .LC0: .word loops_per_jiffy | 16 | .LC0: .word loops_per_jiffy |
@@ -17,7 +18,6 @@ | |||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * r0 <= 2000 | 20 | * r0 <= 2000 |
20 | * lpj <= 0x01ffffff (max. 3355 bogomips) | ||
21 | * HZ <= 1000 | 21 | * HZ <= 1000 |
22 | */ | 22 | */ |
23 | 23 | ||
@@ -25,16 +25,11 @@ ENTRY(__loop_udelay) | |||
25 | ldr r2, .LC1 | 25 | ldr r2, .LC1 |
26 | mul r0, r2, r0 | 26 | mul r0, r2, r0 |
27 | ENTRY(__loop_const_udelay) @ 0 <= r0 <= 0x7fffff06 | 27 | ENTRY(__loop_const_udelay) @ 0 <= r0 <= 0x7fffff06 |
28 | mov r1, #-1 | ||
29 | ldr r2, .LC0 | 28 | ldr r2, .LC0 |
30 | ldr r2, [r2] @ max = 0x01ffffff | 29 | ldr r2, [r2] |
31 | add r0, r0, r1, lsr #32-14 | 30 | umull r1, r0, r2, r0 |
32 | mov r0, r0, lsr #14 @ max = 0x0001ffff | 31 | adds r1, r1, #0xffffffff |
33 | add r2, r2, r1, lsr #32-10 | 32 | adcs r0, r0, r0 |
34 | mov r2, r2, lsr #10 @ max = 0x00007fff | ||
35 | mul r0, r2, r0 @ max = 2^32-1 | ||
36 | add r0, r0, r1, lsr #32-6 | ||
37 | movs r0, r0, lsr #6 | ||
38 | reteq lr | 33 | reteq lr |
39 | 34 | ||
40 | /* | 35 | /* |