All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alessandro Rubini <rubini-list@gnudd.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()
Date: Tue, 3 Nov 2009 13:12:50 +0100	[thread overview]
Message-ID: <20091103121250.GA8577@mail.gnudd.com> (raw)

From: Alessandro Rubini <rubini@unipv.it>

The timer decrements and READ_TIMER() negates the value read.
Writing 0 in reset_timer() is this wrong, as a readback before 400us
will read back 0 and will report 1780 seconds, so nand operations did
timeout.  This patch writes ~0 in reset_timer to prevent this.

Signed-off-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
---

This must be applied for nand to work. It's a simple bugfix so
I think it got simply forgotten.

BTW: I got no feedback for the lcd/keypad stuff, neither positive
nor negative. Shall I repost my current status in that regard?

thanks
/alessandro

 cpu/arm926ejs/nomadik/timer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpu/arm926ejs/nomadik/timer.c b/cpu/arm926ejs/nomadik/timer.c
index 16067c9..2115b71 100644
--- a/cpu/arm926ejs/nomadik/timer.c
+++ b/cpu/arm926ejs/nomadik/timer.c
@@ -46,10 +46,10 @@ int timer_init(void)
 	return 0;
 }
 
-/* Restart counting from 0 */
+/* Restart counting from ~0 (can't be 0, since READ_TIMER negates) */
 void reset_timer(void)
 {
-	writel(0, CONFIG_SYS_TIMERBASE + MTU_LR(0)); /* Immediate effect */
+	writel(~0, CONFIG_SYS_TIMERBASE + MTU_LR(0)); /* Immediate effect */
 }
 
 /* Return how many HZ passed since "base" */
-- 
1.5.6.5

             reply	other threads:[~2009-11-03 12:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-03 12:12 Alessandro Rubini [this message]
2009-11-03 13:27 ` [U-Boot] [PATCH (repost)] Nomadik: fix reset_timer() Wolfgang Denk
2009-11-03 15:23   ` Alessandro Rubini
2009-11-03 15:59     ` Wolfgang Denk
2009-11-03 16:03       ` Alessandro Rubini

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=20091103121250.GA8577@mail.gnudd.com \
    --to=rubini-list@gnudd.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.