summaryrefslogtreecommitdiff
path: root/src/jtag
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-11 14:06:42 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-11 14:06:42 +0000
commitc4a2fdbc39dd31170e61e7fe0be332826825acbd (patch)
treee2c5b5221f3f882bee7386e24e0fed2fed9a5822 /src/jtag
parent0d7d64b5e9a463f63deb19f00efa14e6e5b1c34e (diff)
downloadopenocd_libswd-c4a2fdbc39dd31170e61e7fe0be332826825acbd.tar.gz
openocd_libswd-c4a2fdbc39dd31170e61e7fe0be332826825acbd.tar.bz2
openocd_libswd-c4a2fdbc39dd31170e61e7fe0be332826825acbd.tar.xz
openocd_libswd-c4a2fdbc39dd31170e61e7fe0be332826825acbd.zip
Reset wip. Just adding hooks. This is just to reduce the size of the actual change, no change in behaviour.
git-svn-id: svn://svn.berlios.de/openocd/trunk@565 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag')
-rw-r--r--src/jtag/jtag.c13
-rw-r--r--src/jtag/jtag.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c
index 8ebd92b1..fa439ec5 100644
--- a/src/jtag/jtag.c
+++ b/src/jtag/jtag.c
@@ -1482,6 +1482,9 @@ int jtag_register_commands(struct command_context_s *cmd_ctx)
int jtag_interface_init(struct command_context_s *cmd_ctx)
{
+ if (jtag)
+ return ERROR_OK;
+
if (!jtag_interface)
{
/* nothing was previously specified by "interface" command */
@@ -1511,11 +1514,12 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
{
int validate_tries = 0;
jtag_device_t *device;
+ int retval;
LOG_DEBUG("-");
- if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
- return ERROR_JTAG_INIT_FAILED;
+ if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
+ return retval;
device = jtag_devices;
jtag_ir_scan_size = 0;
@@ -1528,7 +1532,8 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
}
jtag_add_tlr();
- jtag_execute_queue();
+ if ((retval=jtag_execute_queue())==ERROR_OK)
+ return retval;
/* examine chain first, as this could discover the real chain layout */
if (jtag_examine_chain() != ERROR_OK)
@@ -1930,7 +1935,7 @@ int handle_jtag_reset_command(struct command_context_s *cmd_ctx, char *cmd, char
return ERROR_COMMAND_SYNTAX_ERROR;
}
- if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
+ if (jtag_interface_init(cmd_ctx) != ERROR_OK)
return ERROR_JTAG_INIT_FAILED;
jtag_add_reset(trst, srst);
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h
index b7ce094d..27ffbf87 100644
--- a/src/jtag/jtag.h
+++ b/src/jtag/jtag.h
@@ -241,6 +241,10 @@ enum reset_types
extern enum reset_types jtag_reset_config;
+/* initialize interface upon startup. A successful no-op
+ * upon subsequent invocations
+ */
+extern int jtag_interface_init(struct command_context_s *cmd_ctx);
/* initialize JTAG chain using only a TLR reset. If init fails,
* try reset + init.
*/