summaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-02-01 16:57:52 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-03-28 23:31:08 +0200
commitceb2071c6bdb9b0f6cfe9b0adecbe8d657be496e (patch)
tree50f986fee227df5b86b6ea185969c381cc194e6b /arch/arm/cpu
parentf1e2d1762dd727e43e22a474f0935475f77c19a5 (diff)
downloadu-boot-imx-ceb2071c6bdb9b0f6cfe9b0adecbe8d657be496e.zip
u-boot-imx-ceb2071c6bdb9b0f6cfe9b0adecbe8d657be496e.tar.gz
u-boot-imx-ceb2071c6bdb9b0f6cfe9b0adecbe8d657be496e.tar.bz2
ARM: highbank: fix us_to_tick calculation
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>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv7/highbank/timer.c4
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 d92503f..0f985e2 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)