From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 28 Jun 2011 21:45:53 -0700 Subject: [U-Boot] [PATCH v1 (WIP) 16/16] [Timer]Replace get_timer() usage in arch/ In-Reply-To: <1309261269-4363-17-git-send-email-graeme.russ@gmail.com> References: <1309261269-4363-1-git-send-email-graeme.russ@gmail.com> <1309261269-4363-17-git-send-email-graeme.russ@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Graeme, On Tue, Jun 28, 2011 at 4:41 AM, Graeme Russ wrote: > > Signed-off-by: Graeme Russ > --- > ?arch/blackfin/cpu/jtag-console.c ? ? ? ? ? | ? ?4 ++-- > ?arch/microblaze/lib/time.c ? ? ? ? ? ? ? ? | ? ?4 ++-- > ?arch/nios2/cpu/epcs.c ? ? ? ? ? ? ? ? ? ? ?| ? 12 ++++++------ > ?arch/powerpc/cpu/mpc824x/drivers/i2c/i2c.c | ? ?8 ++++---- > ?arch/powerpc/cpu/mpc8260/ether_fcc.c ? ? ? | ? 12 ++++++------ > ?5 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/arch/blackfin/cpu/jtag-console.c b/arch/blackfin/cpu/jtag-console.c > index e0f2975..97ff1de 100644 > --- a/arch/blackfin/cpu/jtag-console.c > +++ b/arch/blackfin/cpu/jtag-console.c > @@ -48,11 +48,11 @@ static inline uint32_t bfin_read_emudat(void) > ?static bool jtag_write_emudat(uint32_t emudat) > ?{ > ? ? ? ?static bool overflowed = false; > - ? ? ? ulong timeout = get_timer(0) + CONFIG_JTAG_CONSOLE_TIMEOUT; > + ? ? ? ulong start = time_now_ms(); > ? ? ? ?while (bfin_read_DBGSTAT() & 0x1) { > ? ? ? ? ? ? ? ?if (overflowed) > ? ? ? ? ? ? ? ? ? ? ? ?return overflowed; > - ? ? ? ? ? ? ? if (timeout < get_timer(0)) > + ? ? ? ? ? ? ? if (time_since_ms(start) >= CONFIG_JTAG_CONSOLE_TIMEOUT) > ? ? ? ? ? ? ? ? ? ? ? ?overflowed = true; > ? ? ? ?} > ? ? ? ?overflowed = false; Here I think I have found a use of future time. It is true what they say (or should say) that there is every kind of timeout in U-Boot. Regards, Simon