[U-Boot,v2,04/14] power, timer: reset TBL before TBU
diff mbox

Message ID 8c120b42746264bbfcb8ef87047a8d727ac86aba.1499945943.git.christophe.leroy@c-s.fr
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Christophe Leroy July 13, 2017, 1:09 p.m. UTC
In order to avoid TBU increment due to TBL reaching its max
and wrapping, reset TBL before resetting TBU

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/lib/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini July 25, 2017, 12:43 a.m. UTC | #1
On Thu, Jul 13, 2017 at 03:09:50PM +0200, Christophe Leroy wrote:

> In order to avoid TBU increment due to TBL reaching its max
> and wrapping, reset TBL before resetting TBU
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to u-boot/master, thanks!

Patch
diff mbox

diff --git a/arch/powerpc/lib/time.c b/arch/powerpc/lib/time.c
index ff9bb67e28..c43f254481 100644
--- a/arch/powerpc/lib/time.c
+++ b/arch/powerpc/lib/time.c
@@ -66,7 +66,7 @@  int timer_init(void)
 	unsigned long temp;
 
 	/* reset */
-	asm volatile("li %0,0 ; mttbu %0 ; mttbl %0;"
+	asm volatile("li %0,0 ; mttbl %0 ; mttbu %0;"
 	     : "=&r"(temp) );
 
 	return (0);