* [U-Boot] [PATCH] bug fix for the delay function of ARM s3c44b0
@ 2008-11-13 13:11 Chaofu Chen
2008-11-13 15:42 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 2+ messages in thread
From: Chaofu Chen @ 2008-11-13 13:11 UTC (permalink / raw)
To: u-boot
The original implementation of delay function of ARM s3c44b0 doesnt' cooperate with U-Boot kernel well, which will cause fake-time-out. What is important is to keep timestamp in unit of millisecond.
diff -purN old/cpu/s3c44b0/interrupts.c new/cpu/s3c44b0/interrupts.c
--- old/cpu/s3c44b0/interrupts.c 2005-12-17 00:39:27.000000000 +0800
+++ new/cpu/s3c44b0/interrupts.c 2008-11-13 20:36:46.000000000 +0800
@@ -147,7 +147,7 @@ static ulong lastdec;
int interrupt_init (void)
{
TCFG0 = 0x000000E9;
- TCFG1 = 0x00000004;
+ TCFG1 = 0x00000040;
TCON = 0x00000900;
TCNTB1 = TIMER_LOAD_VAL;
TCMPB1 = 0;
@@ -185,7 +185,7 @@ void udelay (unsigned long usec)
tmo = usec / 1000;
tmo *= CFG_HZ;
- tmo /= 8;
+ tmo /= 1000;
tmo += get_timer (0);
@@ -213,7 +213,7 @@ ulong get_timer_masked (void)
}
lastdec = now;
- return timestamp;
+ return (timestamp >> 3);
}
void udelay_masked (unsigned long usec)
@@ -225,10 +225,9 @@ void udelay_masked (unsigned long usec)
if (usec >= 1000) {
tmo = usec / 1000;
tmo *= CFG_HZ;
- tmo /= 8;
+ tmo /= 1000;
} else {
- tmo = usec * CFG_HZ;
- tmo /= (1000*8);
+ tmo = 1;
}
endtime = get_timer(0) + tmo;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] bug fix for the delay function of ARM s3c44b0
2008-11-13 13:11 [U-Boot] [PATCH] bug fix for the delay function of ARM s3c44b0 Chaofu Chen
@ 2008-11-13 15:42 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-13 15:42 UTC (permalink / raw)
To: u-boot
On 05:11 Thu 13 Nov , Chaofu Chen wrote:
> The original implementation of delay function of ARM s3c44b0 doesnt' cooperate with U-Boot kernel well, which will cause fake-time-out. What is important is to keep timestamp in unit of millisecond.
>
SOB please
> diff -purN old/cpu/s3c44b0/interrupts.c new/cpu/s3c44b0/interrupts.c
> --- old/cpu/s3c44b0/interrupts.c 2005-12-17 00:39:27.000000000 +0800
> +++ new/cpu/s3c44b0/interrupts.c 2008-11-13 20:36:46.000000000 +0800
> @@ -147,7 +147,7 @@ static ulong lastdec;
> int interrupt_init (void)
> {
> TCFG0 = 0x000000E9;
> - TCFG1 = 0x00000004;
> + TCFG1 = 0x00000040;
> TCON = 0x00000900;
> TCNTB1 = TIMER_LOAD_VAL;
> TCMPB1 = 0;
> @@ -185,7 +185,7 @@ void udelay (unsigned long usec)
>
> tmo = usec / 1000;
> tmo *= CFG_HZ;
now it's CFG_HZ
please rebase you code against the current tree
Best Regards,
J.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-13 15:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13 13:11 [U-Boot] [PATCH] bug fix for the delay function of ARM s3c44b0 Chaofu Chen
2008-11-13 15:42 ` Jean-Christophe PLAGNIOL-VILLARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox