All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Dyer <adyer@righthandtech.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [patch] i.mx change get_timer(base) to return time since base
Date: Tue, 26 Aug 2008 18:51:07 -0500	[thread overview]
Message-ID: <48B496EB.9070904@righthandtech.com> (raw)


This patch changes get_timer() for i.MX to return the time since
'base' instead of the time since the counter was at zero.

Symptom seen is flash timeout errors when erasing or programming a
sector using the common cfi flash code.


This patch has been discussed before:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/21941

and also been done for other arm cpus:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/12390


a quick grep shows the same problem exists for
cpu/sa1100/interrupts.c, but I don't have the h/w to test it.


Signed-off-by: Andrew Dyer <adyer@righthandtech.com>
---
 cpu/arm920t/imx/interrupts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/arm920t/imx/interrupts.c b/cpu/arm920t/imx/interrupts.c
index 03ce06d..c61d3bc 100644
--- a/cpu/arm920t/imx/interrupts.c
+++ b/cpu/arm920t/imx/interrupts.c
@@ -60,7 +60,7 @@ void reset_timer (void)
 
 ulong get_timer (ulong base)
 {
-	return get_timer_masked ();
+	return get_timer_masked() - base;
 }
 
 void set_timer (ulong t)
-- 
1.5.4.3

                 reply	other threads:[~2008-08-26 23:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B496EB.9070904@righthandtech.com \
    --to=adyer@righthandtech.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.