summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2015-11-02 15:00:10 -0800
committerStefan Agner <stefan.agner@toradex.com>2015-11-02 15:00:10 -0800
commit7244ed40615a16cfa238b4ae2666d7825d5bc734 (patch)
treee105c50f0ecb526209a737c9af3f5283f3ff023e
parent80887f182ddfced8fa32bd2e2c303d2c192d946f (diff)
arm: vf610: fix delay when using global timer
The global timer used to divide the waiting cycles by two for no reason, which lead to too short delays (e.g. when waiting for PHY). This fixes an issue seen when bootdelay is 0 and the boot command requires network: FEC Waiting for PHY auto negotiation to complete......... TIMEOUT !
-rw-r--r--arch/arm/cpu/armv7/vf610/global_timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv7/vf610/global_timer.c b/arch/arm/cpu/armv7/vf610/global_timer.c
index db5c510b641..ab318fbe4f5 100644
--- a/arch/arm/cpu/armv7/vf610/global_timer.c
+++ b/arch/arm/cpu/armv7/vf610/global_timer.c
@@ -65,7 +65,7 @@ void __udelay(unsigned long usec)
u64 wait;
start = get_cpu_global_timer();
- wait = (u64)((usec * CLK2MHZ(mxc_get_clock(MXC_BUS_CLK))) >> 2);
+ wait = (u64)(usec * CLK2MHZ(mxc_get_clock(MXC_BUS_CLK)));
do {
current = get_cpu_global_timer();
} while ((current - start) < wait);
@@ -83,5 +83,5 @@ unsigned long long get_ticks(void)
ulong get_tbclk(void)
{
- return (ulong)(mxc_get_clock(MXC_BUS_CLK) >> 2);
+ return (ulong)mxc_get_clock(MXC_ARM_CLK);
}