Skip to contentSkip to conversation

MX51EVK: fix return value of get_timer_masked

PATCH New Li Haibo 2 participants 2 messages Aug 10, 2010 Arm (32-bit)

lore
Share & tools
lore

Li Haibo

author
#0 lore raw

PATCH v2 1/1 MX51EVK: fix return value of get_timer_masked

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

---
v2: resend without "base-64 encoded".

 arch/arm/cpu/arm_cortexa8/mx51/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/arm_cortexa8/mx51/timer.c +1 -1
index 81c4a06..110edbf 100644
@@ -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)
Signature · 13 lines
1.6.5.2



-- 
This e-mail and its attachments contain confidential information from
Shenzhen CASTEL Wireless Telecommunications Co., Ltd.,
Which is intended only for the person or entity whose address is listed above.
Any use of theinformation contained herein in any way (Including,
but not limited to, total or partial disclosure,reproduction,
or dissemination) by persons other than the Intended recipient(s) is prohibited.
If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
#1 lore raw

PATCH v2 1/1 MX51EVK: fix return value of get_timer_masked

Quoted 21 lines · Li Haibo

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

---
v2: resend without "base-64 encoded".

 arch/arm/cpu/arm_cortexa8/mx51/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/arm_cortexa8/mx51/timer.c +0 -0
index 81c4a06..110edbf 100644

arch/arm/cpu/arm_cortexa8/mx51/timer.c ulong get_timer_masked(void) · line 95

Quoted 8 lines
arch/arm/cpu/arm_cortexa8/mx51/timer.c +1 -1
@@ -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)

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================