summaryrefslogtreecommitdiff
path: root/cpu
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
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')
-rw-r--r--cpu/arm926ejs/mx25/generic.c7
-rw-r--r--cpu/arm926ejs/mx25/timer.c22
2 files changed, 12 insertions, 17 deletions
diff --git a/cpu/arm926ejs/mx25/generic.c b/cpu/arm926ejs/mx25/generic.c
index 23b5cce..5ee10d4 100644
--- a/cpu/arm926ejs/mx25/generic.c
+++ b/cpu/arm926ejs/mx25/generic.c
@@ -70,6 +70,11 @@ unsigned int mx25_get_ipg_clk(void)
return mx25_get_ahb_clk()/2;
}
+unsigned int mx25_get_cspi_clk(void)
+{
+ return mx25_get_ipg_clk();
+}
+
void mx25_dump_clocks(void)
{
u32 cpufreq = mx25_get_mcu_main_clk();
@@ -88,6 +93,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
case MXC_IPG_PERCLK:
case MXC_IPG_CLK:
return mx25_get_ipg_clk();
+ case MXC_CSPI_CLK:
+ return mx25_get_cspi_clk();
case MXC_UART_CLK:
break;
}
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 */