summaryrefslogtreecommitdiff
path: root/cpu/arm926ejs/mx25/timer.c
diff options
context:
space:
mode:
authorSammy He <r62914@freescale.com>2009-11-16 11:59:54 +0800
committerSammy He <r62914@freescale.com>2009-11-20 17:14:44 +0800
commit1701c3caa7ed7d183a57301f6513c1f5fb4102cd (patch)
tree6146e2b73d560b8b5225047cc922b6ce6fd2037d /cpu/arm926ejs/mx25/timer.c
parentcbee64d544a2bd8b5e2ae17bcfdfe79480690292 (diff)
downloadu-boot-imx-1701c3caa7ed7d183a57301f6513c1f5fb4102cd.zip
u-boot-imx-1701c3caa7ed7d183a57301f6513c1f5fb4102cd.tar.gz
u-boot-imx-1701c3caa7ed7d183a57301f6513c1f5fb4102cd.tar.bz2
ENGR00118576 MX25: Support Smc911x ethernet
1. Add imx cspi support for cpld access. 2. Add smc911x ethernet support from cpld. Signed-off-by: Sammy He <r62914@freescale.com>
Diffstat (limited to 'cpu/arm926ejs/mx25/timer.c')
-rw-r--r--cpu/arm926ejs/mx25/timer.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/cpu/arm926ejs/mx25/timer.c b/cpu/arm926ejs/mx25/timer.c
index 8b6a061..1900240 100644
--- a/cpu/arm926ejs/mx25/timer.c
+++ b/cpu/arm926ejs/mx25/timer.c
@@ -84,15 +84,10 @@ void reset_timer(void)
ulong get_timer_masked(void)
{
- ulong now = GPTCNT; /* current tick value */
-
- if (now >= lastinc) /* normal mode (non roll) */
- /* move stamp forward with absolut diff ticks */
- timestamp += (now - lastinc);
- else /* we have rollover of incrementer */
- timestamp += (0xFFFFFFFF - lastinc) + now;
- lastinc = now;
- return timestamp;
+ ulong now = GPTCNT;
+ now = now * 1000 / CONFIG_SYS_HZ; /* current tick value */
+
+ return now;
}
ulong get_timer(ulong base)
@@ -111,14 +106,7 @@ void udelay(unsigned long usec)
setup_gpt();
- if (usec >= 1000) { /* if "big" number, spread normalize to secs */
- tmo = usec / 1000; /* normalize usec to ticks per sec */
- tmo *= CONFIG_SYS_HZ; /* find number of "ticks" to wait */
- tmo /= 1000; /* finish normalize. */
- } else { /* don't kill prior to HZ multiply */
- tmo = usec * CONFIG_SYS_HZ;
- tmo /= (1000*1000);
- }
+ tmo = usec / 1000; /* Current precision is Millisecond */
tmp = get_timer(0); /* get current timestamp */
if ((tmo + tmp + 1) < tmp) /* if overflow time stamp */