[U-Boot] [PATCH] 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.
Signed-off-by: Jochen Friedrich jochen@scram.de --- arch/arm/cpu/sa1100/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c index 0207501..aea90ab 100644 --- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -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)

On Sun, May 16, 2010 at 07:35:18PM +0200, Jochen Friedrich 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.
Signed-off-by: Jochen Friedrich jochen@scram.de
Did this get applied anywhere? Fail to see it inside the git log.
arch/arm/cpu/sa1100/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c index 0207501..aea90ab 100644 --- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -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)
1.7.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On Wed, Jun 02, 2010 at 12:34:26PM +0200, Jochen Friedrich wrote:
Hi Kristoffer,
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?
Thanks, Jochen

On Wed, Jun 02, 2010 at 12:34:26PM +0200, Jochen Friedrich wrote:
Hi Kristoffer,
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.
Thanks, Jochen

Dear Jochen Friedrich,
In message 1274031318-22876-1-git-send-email-jochen@scram.de 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.
Signed-off-by: Jochen Friedrich jochen@scram.de
arch/arm/cpu/sa1100/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c index 0207501..aea90ab 100644 --- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -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

On Tue, Jun 22, 2010 at 4:29 PM, Wolfgang Denk wd@denx.de wrote:
Dear Jochen Friedrich,
In message 1274031318-22876-1-git-send-email-jochen@scram.de 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.
Signed-off-by: Jochen Friedrich jochen@scram.de
arch/arm/cpu/sa1100/timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c index 0207501..aea90ab 100644 --- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -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.
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?

Dear Andrew,
In message AANLkTim48UHND2wg0jCqs-EIZ2T_CGV-DUVatPzh6h6l@mail.gmail.com you wrote:
--- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -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.
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.
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

Hi Andrew,
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
participants (4)
-
Andrew Dyer
-
Jochen Friedrich
-
Kristoffer Ericson
-
Wolfgang Denk