[U-Boot] [PATCH] MX51EVK: fix return value of get_timer_masked

Li Haibo hbli at sinocastel.com
Wed Jul 21 14:10:12 CEST 2010


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 at sinocastel.com>
---
 arch/arm/cpu/arm_cortexa8/mx51/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm_cortexa8/mx51/timer.c b/arch/arm/cpu/arm_cortexa8/mx51/timer.c
index 81c4a06..110edbf 100644
--- a/arch/arm/cpu/arm_cortexa8/mx51/timer.c
+++ b/arch/arm/cpu/arm_cortexa8/mx51/timer.c
@@ -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)
-- 
1.6.5.2


-- 
李海波
多媒体电子部
深圳市航天无线通信技术有限公司
深圳市南山区高新中三道2号深圳市软件园5栋5层   
Tel:+86-755-86185111-3667
Email:hbli at sinocastel.com
Website:www.sinocastel.com 

本邮件及其附件含有深圳市航天无线通信技术有限公司的保密信息,仅限于发送给
上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全
部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立
即电话或邮件通知发件人并删除本邮件!
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!







More information about the U-Boot mailing list