MX51EVK: fix return value of get_timer_masked
authorLi Haibo <hbli@sinocastel.com>
Tue, 10 Aug 2010 06:18:38 +0000 (14:18 +0800)
committerStefano Babic <sbabic@denx.de>
Tue, 10 Aug 2010 07:46:44 +0000 (09:46 +0200)
get_timer_masked() should return current timestamp,
not current ticks from hardware register.

Tested on one custom board with NAND flash.
Without this patch, NAND write always TIMEOUT
because get_timer(0) return a big value.

This patch applies for u-boot-2010.06

Signed-off-by: Li Haibo <hbli@sinocastel.com>
arch/arm/cpu/armv7/mx51/timer.c

index 81c4a06143554d5f963d0de08f987e5149fd2070..110edbfa85e2d48f3fa7de7856ea0ae8ae4a72df 100644 (file)
@@ -89,7 +89,7 @@ ulong get_timer_masked(void)
                timestamp += ((0xFFFFFFFF / (CONFIG_MX51_CLK32 / CONFIG_SYS_HZ))
                                - lastinc) + val;
        lastinc = val;
-       return val;
+       return timestamp;
 }
 
 ulong get_timer(ulong base)