Commit 215e362d authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King

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: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 2374b063
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include <asm/param.h> /* HZ */ #include <asm/param.h> /* HZ */
#define MAX_UDELAY_MS 2 #define MAX_UDELAY_MS 2
#define UDELAY_MULT ((UL(2199023) * HZ) >> 11) #define UDELAY_MULT UL(2047 * HZ + 483648 * HZ / 1000000)
#define UDELAY_SHIFT 30 #define UDELAY_SHIFT 31
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -34,7 +34,7 @@ extern struct arm_delay_ops { ...@@ -34,7 +34,7 @@ extern struct arm_delay_ops {
* it, it means that you're calling udelay() with an out of range value. * it, it means that you're calling udelay() with an out of range value.
* *
* With currently imposed limits, this means that we support a max delay * With currently imposed limits, this means that we support a max delay
* of 2000us. Further limits: HZ<=1000 and bogomips<=3355 * of 2000us. Further limits: HZ<=1000
*/ */
extern void __bad_udelay(void); extern void __bad_udelay(void);
......
...@@ -29,7 +29,10 @@ else ...@@ -29,7 +29,10 @@ else
lib-y += io-readsw-armv4.o io-writesw-armv4.o lib-y += io-readsw-armv4.o io-writesw-armv4.o
endif endif
lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o ifeq ($(CONFIG_ARCH_RPC),y)
lib-y += ecard.o io-acorn.o floppydma.o
AFLAGS_delay-loop.o += -march=armv4
endif
$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S $(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S
$(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/delay.h> #include <asm/delay.h>
.text .text
.LC0: .word loops_per_jiffy .LC0: .word loops_per_jiffy
...@@ -17,7 +18,6 @@ ...@@ -17,7 +18,6 @@
/* /*
* r0 <= 2000 * r0 <= 2000
* lpj <= 0x01ffffff (max. 3355 bogomips)
* HZ <= 1000 * HZ <= 1000
*/ */
...@@ -25,16 +25,11 @@ ENTRY(__loop_udelay) ...@@ -25,16 +25,11 @@ ENTRY(__loop_udelay)
ldr r2, .LC1 ldr r2, .LC1
mul r0, r2, r0 mul r0, r2, r0
ENTRY(__loop_const_udelay) @ 0 <= r0 <= 0x7fffff06 ENTRY(__loop_const_udelay) @ 0 <= r0 <= 0x7fffff06
mov r1, #-1
ldr r2, .LC0 ldr r2, .LC0
ldr r2, [r2] @ max = 0x01ffffff ldr r2, [r2]
add r0, r0, r1, lsr #32-14 umull r1, r0, r2, r0
mov r0, r0, lsr #14 @ max = 0x0001ffff adds r1, r1, #0xffffffff
add r2, r2, r1, lsr #32-10 adcs r0, r0, r0
mov r2, r2, lsr #10 @ max = 0x00007fff
mul r0, r2, r0 @ max = 2^32-1
add r0, r0, r1, lsr #32-6
movs r0, r0, lsr #6
reteq lr reteq lr
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment