[U-Boot] [PATCH 0/2] Use lldiv from div64.h for 64-bit divisions

Hi, During the review of my patchset
[PATCH v5 0/6] Add an SPL to boot the da850evm from SPI http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/119249/
a linker problem was discovered by Tom Rini and Wolfgang Denk that occured only with certain toolchains:
arm-linux-gnueabi-ld: error: no memory region specified for loadable section `.ARM.exidx'
This section .ARM.exidx is only present when the 64-bit division from libgcc is used.
The two patches in this patchset replace the 64-bit divisions in arch/arm/cpu/arm926ejs/davinci/timer.c and post/post.c by the lldiv function from div64.h and thus fix the linker problem.
Regards, Christian
Cc: Tom Rini trini@ti.com Cc: Heiko Schocher hs@denx.de Cc: Wolfgang Denk wd@denx.de
Christian Riesch (2): arm, davinci: Use lldiv for the 64-bit divisions in timer.c post/post.c: Use lldiv for 64-bit divisions
arch/arm/cpu/arm926ejs/davinci/timer.c | 6 ++++-- post/post.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-)

Signed-off-by: Christian Riesch christian.riesch@omicron.at Cc: Tom Rini trini@ti.com Cc: Heiko Schocher hs@denx.de Cc: Wolfgang Denk wd@denx.de --- arch/arm/cpu/arm926ejs/davinci/timer.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/davinci/timer.c b/arch/arm/cpu/arm926ejs/davinci/timer.c index c7bf7a5..a06d449 100644 --- a/arch/arm/cpu/arm926ejs/davinci/timer.c +++ b/arch/arm/cpu/arm926ejs/davinci/timer.c @@ -40,6 +40,7 @@ #include <common.h> #include <asm/io.h> #include <asm/arch/timer_defs.h> +#include <div64.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -86,14 +87,15 @@ ulong get_timer(ulong base)
timer_diff = get_ticks() - gd->timer_reset_value;
- return (timer_diff / (gd->timer_rate_hz / CONFIG_SYS_HZ)) - base; + return lldiv(timer_diff, (gd->timer_rate_hz / CONFIG_SYS_HZ)) - base; }
void __udelay(unsigned long usec) { unsigned long long endtime;
- endtime = ((unsigned long long)usec * gd->timer_rate_hz) / 1000000UL; + endtime = lldiv((unsigned long long)usec * gd->timer_rate_hz, + 1000000UL); endtime += get_ticks();
while (get_ticks() < endtime)

Dear Christian Riesch,
In message 1323446043-22656-2-git-send-email-christian.riesch@omicron.at you wrote:
Signed-off-by: Christian Riesch christian.riesch@omicron.at Cc: Tom Rini trini@ti.com Cc: Heiko Schocher hs@denx.de Cc: Wolfgang Denk wd@denx.de
arch/arm/cpu/arm926ejs/davinci/timer.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Signed-off-by: Christian Riesch christian.riesch@omicron.at Cc: Tom Rini trini@ti.com Cc: Heiko Schocher hs@denx.de Cc: Wolfgang Denk wd@denx.de --- post/post.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/post/post.c b/post/post.c index 0e67ad7..45e08f8 100644 --- a/post/post.c +++ b/post/post.c @@ -24,6 +24,7 @@ #include <common.h> #include <stdio_dev.h> #include <watchdog.h> +#include <div64.h> #include <post.h>
#ifdef CONFIG_SYS_POST_HOTKEYS_GPIO @@ -495,7 +496,7 @@ void post_reloc(void) unsigned long post_time_ms(unsigned long base) { #if defined(CONFIG_PPC) || defined(CONFIG_ARM) - return (unsigned long)(get_ticks() / (get_tbclk() / CONFIG_SYS_HZ)) + return (unsigned long)lldiv(get_ticks(), get_tbclk() / CONFIG_SYS_HZ) - base; #else #warning "Not implemented yet"

Dear Christian Riesch,
In message 1323446043-22656-3-git-send-email-christian.riesch@omicron.at you wrote:
Signed-off-by: Christian Riesch christian.riesch@omicron.at Cc: Tom Rini trini@ti.com Cc: Heiko Schocher hs@denx.de Cc: Wolfgang Denk wd@denx.de
post/post.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (2)
-
Christian Riesch
-
Wolfgang Denk