Skip to contentSkip to conversation

i.mx change get_timer(base) to return time since base

PATCH New Andrew Dyer 1 participant 1 message Aug 26, 2008 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i.mx change get_timer(base) to return time since base

This patch changes get_timer() for i.MX to return the time since 'base' instead of the time since the counter was at zero.

Symptom seen is flash timeout errors when erasing or programming a sector using the common cfi flash code.

This patch has been discussed before:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/21941

and also been done for other arm cpus:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/12390

a quick grep shows the same problem exists for cpu/sa1100/interrupts.c, but I don't have the h/w to test it.

---
 cpu/arm920t/imx/interrupts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cpu/arm920t/imx/interrupts.c +1 -1
index 03ce06d..c61d3bc 100644
@@ -60,7 +60,7 @@ void reset_timer (void)
 
 ulong get_timer (ulong base)
 {
-	return get_timer_masked ();
+	return get_timer_masked() - base;
 }
 
 void set_timer (ulong t)
Signature · 1 line
1.5.4.3