summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>2012-08-14 05:01:21 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-09-01 14:58:26 +0200
commit68d919d42053af99c5220d0469aa4b3de2ae1c55 (patch)
tree01eb70f50d175cad48dbbd8030dfe4f7d09a0ae2 /arch
parentf2d3ae0739617a671c09297dc49bf6d92b4c8bdc (diff)
downloadu-boot-imx-68d919d42053af99c5220d0469aa4b3de2ae1c55.zip
u-boot-imx-68d919d42053af99c5220d0469aa4b3de2ae1c55.tar.gz
u-boot-imx-68d919d42053af99c5220d0469aa4b3de2ae1c55.tar.bz2
mx5/6 timer: Round up tick_to_time() value
Round up tick_to_time() value instead of truncating it. This avoids stopping waits instantly for low usec values, and this generally guarantees that the code always waits for at least the requested duration. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Stefano Babic <sbabic@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/imx-common/timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/imx-common/timer.c b/arch/arm/cpu/armv7/imx-common/timer.c
index 1645ff8..e2725e1 100644
--- a/arch/arm/cpu/armv7/imx-common/timer.c
+++ b/arch/arm/cpu/armv7/imx-common/timer.c
@@ -61,7 +61,7 @@ static inline unsigned long long tick_to_time(unsigned long long tick)
static inline unsigned long long us_to_tick(unsigned long long usec)
{
- usec *= CLK_32KHZ;
+ usec = usec * CLK_32KHZ + 999999;
do_div(usec, 1000000);
return usec;