Skip to contentSkip to conversation

sa1100 change get_timer(base) to return time since base

PATCH New Jochen Friedrich 4 participants 9 messages May 16, 2010 – Jun 28, 2010 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

similar to 274737e5eb25b2bcd3af3a96da923effd543284f

This patch changes get_timer() for sa1100 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.

---
 arch/arm/cpu/sa1100/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/sa1100/timer.c +1 -1
index 0207501..aea90ab 100644
@@ -41,7 +41,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.7.1
#1 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

Quoted 10 lines · Jochen Friedrich

similar to 274737e5eb25b2bcd3af3a96da923effd543284f

This patch changes get_timer() for sa1100 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.

---

Did this get applied anywhere? Fail to see it inside the git log.

Quoted 23 lines
 arch/arm/cpu/sa1100/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/sa1100/timer.c +1 -1
index 0207501..aea90ab 100644
@@ -41,7 +41,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 · 6 lines
1.7.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
#2 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

Hi Kristoffer,

Quoted 1 line

Did this get applied anywhere? Fail to see it inside the git log.

Nope, I didn't get any response yet.

Thanks,
Jochen

#3 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

Quoted 5 lines · Jochen Friedrich

Hi Kristoffer,

Quoted 1 line

Did this get applied anywhere? Fail to see it inside the git log.

Nope, I didn't get any response yet.

Wolgang, there doesnt seem to be any submaintainers to push patches to for SA11xx. For future reference, where should they go?

Quoted 3 lines

Thanks,
Jochen

#4 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

In reply to Jochen Friedrich
Quoted 5 lines · Jochen Friedrich

Hi Kristoffer,

Quoted 1 line

Did this get applied anywhere? Fail to see it inside the git log.

Nope, I didn't get any response yet.

Any idea on why SSP and sa1111 is non-working atm? I must be missing setting something inside bootloader/kernel.

SA1111 is reported failure to set trigger mode 3, while SSP is just not working inside kernel.

Quoted 3 lines

Thanks,
Jochen

#5 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

In reply to Jochen Friedrich

Dear Jochen Friedrich,

Quoted 18 lines · In message <[email protected]> you wrote:

similar to 274737e5eb25b2bcd3af3a96da923effd543284f

This patch changes get_timer() for sa1100 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.

---
 arch/arm/cpu/sa1100/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/sa1100/timer.c +0 -0
index 0207501..aea90ab 100644

arch/arm/cpu/sa1100/timer.c void reset_timer (void) · line 44

Quoted 5 lines
arch/arm/cpu/sa1100/timer.c +1 -1
@@ -41,7 +41,7 @@ void reset_timer (void)
 
 ulong get_timer (ulong base)
 {
-	return get_timer_masked ();
+	return get_timer_masked () - base;

This patch is wrong. The get_timer() code is as it was designed to be. If it is causing problems, then the caller must be fixed.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Time is fluid ... like a river with currents, eddies, backwash.
	-- Spock, "The City on the Edge of Forever", stardate 3134.0
#6 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

Quoted 22 lines · Wolfgang Denk

Dear Jochen Friedrich,

Quoted 19 lines · In message <[email protected]> you wrote:

similar to 274737e5eb25b2bcd3af3a96da923effd543284f

This patch changes get_timer() for sa1100 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.

---
?arch/arm/cpu/sa1100/timer.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

arch/arm/cpu/sa1100/timer.c +0 -0
index 0207501..aea90ab 100644
@@ -41,7 +41,7 @@ void reset_timer (void)
 
Quoted 7 lines

arch/arm/cpu/sa1100/timer.c void reset_timer (void) · line 44

Quoted 4 lines
arch/arm/cpu/sa1100/timer.c +1 -1
 ?ulong get_timer (ulong base)
 ?{
- ? ? return get_timer_masked ();
+ ? ? return get_timer_masked () - base;

This patch is wrong. The get_timer() code is as it was designed to be. If it is causing problems, then the caller must be fixed.

Hmmm. I put the same patch in a long time ago for imx for the same reason.
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/45922
Looking at some other arm timer implementations they do it the same way.

I see the cfi_flash code now has reset_timer calls sprinkled through it that should make the base offset functionality in the timer mostly a nop (assuming it's implemented). Maybe the OP has old cfi_flash code?

#7 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

Dear Andrew,

Quoted 13 lines · In message <[email protected]> you…
Quoted 5 lines
Quoted 5 lines
arch/arm/cpu/sa1100/timer.c +0 -0
@@ -41,7 +41,7 @@ void reset_timer (void)
 
Quoted 7 lines

arch/arm/cpu/sa1100/timer.c void reset_timer (void) · line 44

Quoted 4 lines
arch/arm/cpu/sa1100/timer.c +1 -1
 ulong get_timer (ulong base)
 {
-     return get_timer_masked ();
+     return get_timer_masked () - base;

This patch is wrong. The get_timer() code is as it was designed to be. If it is causing problems, then the caller must be fixed.

Quoted 3 lines

Hmmm. I put the same patch in a long time ago for imx for the same reason.
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/45922
Looking at some other arm timer implementations they do it the same way.

Hm... ouch...

Guess this needs fixing.

Quoted 4 lines

I see the cfi_flash code now has reset_timer calls sprinkled through it that should make the base offset functionality in the timer mostly a nop (assuming it's implemented). Maybe the OP has old cfi_flash code?

Well, "sprinkled" - I see exactly two such calls. And I think these are only needed because the implementer did not understand the concept of how to implement a timeout using unsigned arithmentic in a way that works even when the timer wraps around.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Buddha, the Godhead, resides quite as comfortably in the circuits
of a digital computer or the gears of a cycle transmission as he does
at the top of a mountain or in the petals of a flower.
            - R.  Pirsig, "Zen and the Art of Motorcycle Maintenance"
#8 lore raw

PATCH 1/1 sa1100 change get_timer(base) to return time since base

In reply to Andrew Dyer

Hi Andrew,

Quoted 4 lines

I see the cfi_flash code now has reset_timer calls sprinkled through it that should make the base offset functionality in the timer mostly a nop (assuming it's implemented). Maybe the OP has old cfi_flash code?

You're right. reset_timer() was added in commit 22d6c8faac4e9fa43232b0cf4da427ec14d72ad3, which was committed after i submitted this patch.

Thanks,
Jochen