From: Wolfgang Denk Date: Tue, 22 Jun 2010 23:29:51 +0200 Subject: [U-Boot] [PATCH] sa1100 change get_timer(base) to return time since base In-Reply-To: <1274031318-22876-1-git-send-email-jochen@scram.de> References: <1274031318-22876-1-git-send-email-jochen@scram.de> Message-ID: <20100622212951.836F81524EE@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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 -- 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