]> code.ossystems Code Review - bsp/u-boot.git/commit
imx-common: timer: fix 32-bit overflow
authorKnut Wohlrab <knut.wohlrab@de.bosch.com>
Mon, 4 Mar 2013 04:16:02 +0000 (04:16 +0000)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 9 Apr 2013 14:14:39 +0000 (11:14 -0300)
commit6b4440e80efcd6096eaf02d339c8dac74181b39d
tree84a0a5273019e45527005ee9a1fff03dd2ffa788
parentdb45d518c0cc99395da462b0d8112f5cbfeec5da
imx-common: timer: fix 32-bit overflow

The i.MX6 common timer uses the 32-bit variable tbl (time base lower)
to record the overflow of the 32-bit counter. I.e. if the counter
overflows, the variable tbl does overflow, too.

To capture this overflow, use the variable tbu (time base upper), too.
Return the combined value of tbl and tbu.

lastinc is unused then, remove it.

Signed-off-by: Knut Wohlrab <knut.wohlrab@de.bosch.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Stefano Babic <sbabic@denx.de>
arch/arm/imx-common/timer.c