aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass2013-04-12 23:26:41 -0500
committerMinkyu Kang2013-04-16 20:00:40 -0500
commitdc47e2bc7d1c5307b18b9a43f3286969e36a974e (patch)
tree51ee99dbcc2fa11119649acea7035dfa7e61a863 /arch
parent70656c79f3c85df77b65cda0237f5454851186ca (diff)
downloadu-boot-dc47e2bc7d1c5307b18b9a43f3286969e36a974e.tar.gz
u-boot-dc47e2bc7d1c5307b18b9a43f3286969e36a974e.tar.xz
u-boot-dc47e2bc7d1c5307b18b9a43f3286969e36a974e.zip
exynos: Correct use of 64-bit division
The current code is causing errors like this on my toolchains: /usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/binutils-bin/2.22/ ld.bfd.real: failed to merge target specific data of file /usr/lib/gcc/ armv7a-cros-linux-gnueabi/4.7.x-google/libgcc.a(_divdi3.o) Use do_div() to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/s5p-common/timer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c
index 6a0fa5862e..4adfaae656 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26#include <common.h> 26#include <common.h>
27#include <div64.h>
27#include <asm/io.h> 28#include <asm/io.h>
28#include <asm/arch/pwm.h> 29#include <asm/arch/pwm.h>
29#include <asm/arch/clk.h> 30#include <asm/arch/clk.h>
@@ -76,6 +77,8 @@ int timer_init(void)
76 */ 77 */
77unsigned long get_timer(unsigned long base) 78unsigned long get_timer(unsigned long base)
78{ 79{
80 unsigned long long time_ms;
81
79 ulong now = timer_get_us_down(); 82 ulong now = timer_get_us_down();
80 83
81 /* 84 /*
@@ -87,7 +90,9 @@ unsigned long get_timer(unsigned long base)
87 gd->arch.lastinc = now; 90 gd->arch.lastinc = now;
88 91
89 /* Divide by 1000 to convert from us to ms */ 92 /* Divide by 1000 to convert from us to ms */
90 return gd->arch.timer_reset_value / 1000 - base; 93 time_ms = gd->arch.timer_reset_value;
94 do_div(time_ms, 1000);
95 return time_ms - base;
91} 96}
92 97
93unsigned long timer_get_us(void) 98unsigned long timer_get_us(void)