* [U-Boot] [PATCH 0/2] Use lldiv from div64.h for 64-bit divisions
@ 2011-12-09 15:54 Christian Riesch
2011-12-09 15:54 ` [U-Boot] [PATCH 1/2] arm, davinci: Use lldiv for the 64-bit divisions in timer.c Christian Riesch
2011-12-09 15:54 ` [U-Boot] [PATCH 2/2] post/post.c: Use lldiv for 64-bit divisions Christian Riesch
0 siblings, 2 replies; 5+ messages in thread
From: Christian Riesch @ 2011-12-09 15:54 UTC (permalink / raw)
To: u-boot
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(-)
--
1.7.4.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH 1/2] arm, davinci: Use lldiv for the 64-bit divisions in timer.c
2011-12-09 15:54 [U-Boot] [PATCH 0/2] Use lldiv from div64.h for 64-bit divisions Christian Riesch
@ 2011-12-09 15:54 ` Christian Riesch
2011-12-10 22:14 ` Wolfgang Denk
2011-12-09 15:54 ` [U-Boot] [PATCH 2/2] post/post.c: Use lldiv for 64-bit divisions Christian Riesch
1 sibling, 1 reply; 5+ messages in thread
From: Christian Riesch @ 2011-12-09 15:54 UTC (permalink / raw)
To: u-boot
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)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH 2/2] post/post.c: Use lldiv for 64-bit divisions
2011-12-09 15:54 [U-Boot] [PATCH 0/2] Use lldiv from div64.h for 64-bit divisions Christian Riesch
2011-12-09 15:54 ` [U-Boot] [PATCH 1/2] arm, davinci: Use lldiv for the 64-bit divisions in timer.c Christian Riesch
@ 2011-12-09 15:54 ` Christian Riesch
2011-12-10 22:14 ` Wolfgang Denk
1 sibling, 1 reply; 5+ messages in thread
From: Christian Riesch @ 2011-12-09 15:54 UTC (permalink / raw)
To: u-boot
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"
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH 1/2] arm, davinci: Use lldiv for the 64-bit divisions in timer.c
2011-12-09 15:54 ` [U-Boot] [PATCH 1/2] arm, davinci: Use lldiv for the 64-bit divisions in timer.c Christian Riesch
@ 2011-12-10 22:14 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-12-10 22:14 UTC (permalink / raw)
To: u-boot
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
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone who isn't confused here doesn't really know what's going on.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH 2/2] post/post.c: Use lldiv for 64-bit divisions
2011-12-09 15:54 ` [U-Boot] [PATCH 2/2] post/post.c: Use lldiv for 64-bit divisions Christian Riesch
@ 2011-12-10 22:14 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2011-12-10 22:14 UTC (permalink / raw)
To: u-boot
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
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Obviously, a major malfunction has occurred."
-- Steve Nesbitt, voice of Mission Control, January 28,
1986, as the shuttle Challenger exploded within view
of the grandstands.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-10 22:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-09 15:54 [U-Boot] [PATCH 0/2] Use lldiv from div64.h for 64-bit divisions Christian Riesch
2011-12-09 15:54 ` [U-Boot] [PATCH 1/2] arm, davinci: Use lldiv for the 64-bit divisions in timer.c Christian Riesch
2011-12-10 22:14 ` Wolfgang Denk
2011-12-09 15:54 ` [U-Boot] [PATCH 2/2] post/post.c: Use lldiv for 64-bit divisions Christian Riesch
2011-12-10 22:14 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.