Re: [U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()

2009-11-03 Thread Alessandro Rubini
> Well, to me READ_TIMER() sounds like a function/macro to read some > value from some timer; if that timer counts doen, then successive > calls to that macro/function would return decreasing values. Counting > up or down is a property of the specific timer and should be handled > elsewhere; such p

Re: [U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()

2009-11-03 Thread Wolfgang Denk
Dear Alessandro Rubini, In message <20091103152354.ga12...@mail.gnudd.com> you wrote: > > Um... why is READ_TIMER doing such a stupid thing as negating values? > > Because the counter counts down. I could have returns "0 - value" or > "~value". Since I chose the latter initially, this fix keeps

Re: [U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()

2009-11-03 Thread Alessandro Rubini
> Um... why is READ_TIMER doing such a stupid thing as negating values? Because the counter counts down. I could have returns "0 - value" or "~value". Since I chose the latter initially, this fix keeps the same approach. I can't return the value I read, since it goes backwards. /alessandro

Re: [U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()

2009-11-03 Thread Wolfgang Denk
Dear Alessandro Rubini, In message <20091103121250.ga8...@mail.gnudd.com> you wrote: > From: Alessandro Rubini > > The timer decrements and READ_TIMER() negates the value read. > Writing 0 in reset_timer() is this wrong, as a readback before 400us > will read back 0 and will report 1780 seconds,

[U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()

2009-11-03 Thread Alessandro Rubini
From: Alessandro Rubini The timer decrements and READ_TIMER() negates the value read. Writing 0 in reset_timer() is this wrong, as a readback before 400us will read back 0 and will report 1780 seconds, so nand operations did timeout. This patch writes ~0 in reset_timer to prevent this. Signed-o