From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Tue, 5 Jul 2011 01:25:37 -0400 Subject: [U-Boot] [PATCH 21/21] Blackfin: jtag-console: fix timer usage In-Reply-To: <1309843537-1268-1-git-send-email-vapier@gentoo.org> References: <1309289787-7846-1-git-send-email-vapier@gentoo.org> <1309843537-1268-1-git-send-email-vapier@gentoo.org> Message-ID: <1309843537-1268-3-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Reported-by: Graeme Russ Signed-off-by: Mike Frysinger --- arch/blackfin/cpu/jtag-console.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/blackfin/cpu/jtag-console.c b/arch/blackfin/cpu/jtag-console.c index e0f2975..a77358a 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 timeout = get_timer(0); while (bfin_read_DBGSTAT() & 0x1) { if (overflowed) return overflowed; - if (timeout < get_timer(0)) + if (get_timer(timeout) > CONFIG_JTAG_CONSOLE_TIMEOUT) overflowed = true; } overflowed = false; -- 1.7.6