Skip to content
Snippets Groups Projects
Commit dc47e2bc authored by Simon Glass's avatar Simon Glass Committed by Minkyu Kang
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
Signed-off-by: default avatarMinkyu Kang <mk7.kang@samsung.com>
parent 70656c79
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@
*/
#include <common.h>
#include <div64.h>
#include <asm/io.h>
#include <asm/arch/pwm.h>
#include <asm/arch/clk.h>
......@@ -76,6 +77,8 @@ int timer_init(void)
*/
unsigned long get_timer(unsigned long base)
{
unsigned long long time_ms;
ulong now = timer_get_us_down();
/*
......@@ -87,7 +90,9 @@ unsigned long get_timer(unsigned long base)
gd->arch.lastinc = now;
/* Divide by 1000 to convert from us to ms */
return gd->arch.timer_reset_value / 1000 - base;
time_ms = gd->arch.timer_reset_value;
do_div(time_ms, 1000);
return time_ms - base;
}
unsigned long timer_get_us(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment