summaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-11 06:52:52 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-11 06:52:52 +0000
commit7805be1b3a8f65aff9a861fd8ca62518143f1524 (patch)
tree781e28e65d50b238decb01f06fac51b9d609c236 /src/openocd.c
parenta7d3a4a7f8a0def61ed3caa7fb461b82b2d6ade1 (diff)
downloadopenocd+libswd-7805be1b3a8f65aff9a861fd8ca62518143f1524.tar.gz
openocd+libswd-7805be1b3a8f65aff9a861fd8ca62518143f1524.tar.bz2
openocd+libswd-7805be1b3a8f65aff9a861fd8ca62518143f1524.tar.xz
openocd+libswd-7805be1b3a8f65aff9a861fd8ca62518143f1524.zip
added target->type->examine(). Eventually this will allow for bringing up telnet/gdb *before* jtag chain has been validated + it might fix some reset halt problems seen as examine() needs to run after TRST has been asserted.
git-svn-id: svn://svn.berlios.de/openocd/trunk@563 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 71963cb9..3c7816ea 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -95,6 +95,10 @@ int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
atexit(exit_handler);
+ /* FIX!!! this should happen *after* target_init(), but
+ * for now there are target initialisations that talk
+ * to JTAG whereas that *should* happen during target_examine()
+ */
if (jtag_init(cmd_ctx) != ERROR_OK)
return ERROR_FAIL;
LOG_DEBUG("jtag init complete");
@@ -103,6 +107,10 @@ int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
return ERROR_FAIL;
LOG_DEBUG("target init complete");
+ if (target_examine(cmd_ctx) != ERROR_OK)
+ return ERROR_FAIL;
+ LOG_DEBUG("target examine complete");
+
if (flash_init_drivers(cmd_ctx) != ERROR_OK)
return ERROR_FAIL;
LOG_DEBUG("flash init complete");