From: Øyvind H. <go...@us...> - 2010-02-10 22:55:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 65cc81ddb609456707c2ba47cfe8540192c6dce7 (commit) from 84ac6bb0d99275ccf7ff15691ffa1b22127d7339 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 65cc81ddb609456707c2ba47cfe8540192c6dce7 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Feb 10 20:04:00 2010 +0100 arm11: fix another infinite loop bug reset init would get stuck in an infinite loop when e.g. khz was too high. Added timeout. This is a copy of paste of a number of such bugfixes in the arm11 code. Arm11 code reviewed for further such infinite loop bugs and I couldn't find any more. Xing fingers it's the last one... Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index 088981f..6d132a7 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -854,7 +854,9 @@ int arm11_sc7_run(struct arm11_common * arm11, struct arm11_sc7_action * actions AddressOut = 0; } - do + /* Timeout here so we don't get stuck. */ + int i = 0; + while (1) { JTAG_DEBUG("SC7 <= c%-3d Data %08x %s", (unsigned) AddressOut, @@ -866,10 +868,27 @@ int arm11_sc7_run(struct arm11_common * arm11, struct arm11_sc7_action * actions CHECK_RETVAL(jtag_execute_queue()); - if (!Ready) - JTAG_DEBUG("SC7 => !ready"); + /* 'nRW' is 'Ready' on read out */ + if (Ready) + break; + + long long then = 0; + + if (i == 1000) + { + then = timeval_ms(); + } + if (i >= 1000) + { + if ((timeval_ms()-then) > 1000) + { + LOG_WARNING("Timeout (1000ms) waiting for instructions to complete"); + return ERROR_FAIL; + } + } + + i++; } - while (!Ready); /* 'nRW' is 'Ready' on read out */ if (!nRW) JTAG_DEBUG("SC7 => Data %08x", (unsigned) DataIn); ----------------------------------------------------------------------- Summary of changes: src/target/arm11_dbgtap.c | 27 +++++++++++++++++++++++---- 1 files changed, 23 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |