All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] ARM: highbank: fix us_to_tick calculation
Date: Wed,  1 Feb 2012 20:57:52 -0600	[thread overview]
Message-ID: <1328151477-8026-2-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1328151477-8026-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <rob.herring@calxeda.com>

udelay calls were off due to failing to convert us to ns. Fix this and drop
the unnecessary shifts since NS_PER_TICK is only 7ns.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/cpu/armv7/highbank/timer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/highbank/timer.c b/arch/arm/cpu/armv7/highbank/timer.c
index d8a0288..d5b6cb6 100644
--- a/arch/arm/cpu/armv7/highbank/timer.c
+++ b/arch/arm/cpu/armv7/highbank/timer.c
@@ -66,10 +66,10 @@ static inline unsigned long long time_to_tick(unsigned long long time)
 
 static inline unsigned long long us_to_tick(unsigned long long us)
 {
-	unsigned long long tick = us << 16;
+	unsigned long long tick = us * 1000;
 	tick += NS_PER_TICK - 1;
 	do_div(tick, NS_PER_TICK);
-	return tick >> 16;
+	return tick;
 }
 
 unsigned long long get_ticks(void)
-- 
1.7.5.4

  reply	other threads:[~2012-02-02  2:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
2012-02-02  2:57 ` Rob Herring [this message]
2012-02-02  2:57 ` [U-Boot] [PATCH 2/6] ARM: highbank: change TEXT_BASE to 0x8000 Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 3/6] ARM: highbank: Add boot counter support Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 4/6] ARM: highbank: add reset support Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 5/6] ARM: highbank: change env config to use nvram Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 6/6] ARM: highbank: setup env from boot source register Rob Herring
2012-02-18 16:02 ` [U-Boot] [PATCH 0/6] Highbank platform updates Albert ARIBAUD
2012-02-21 22:55   ` Rob Herring

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=1328151477-8026-2-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.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.