diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-16 00:23:00 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-16 00:23:00 +0000 |
commit | 5f9b74d0557ec577b45d7af18312bab58098c9d9 (patch) | |
tree | b64201d781c926d1db56fe12ce0601473bbd9d8a /src | |
parent | 03803a9d792d613e60fcc0b5e810e68488e17b87 (diff) | |
download | openocd+libswd-5f9b74d0557ec577b45d7af18312bab58098c9d9.tar.gz openocd+libswd-5f9b74d0557ec577b45d7af18312bab58098c9d9.tar.bz2 openocd+libswd-5f9b74d0557ec577b45d7af18312bab58098c9d9.tar.xz openocd+libswd-5f9b74d0557ec577b45d7af18312bab58098c9d9.zip |
David Brownell <david-b@pacbell.net>:
Doc update: say "jtag newtap ... -disable" records the
state after exiting the RESET state, matching the only
implementation we're working with so far (TI ICEpick-C).
Matching code updates. Now we can be sure that the
"enabled" flag value is correct after JTAG resets.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2246 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/core.c | 2 | ||||
-rw-r--r-- | src/jtag/jtag.h | 6 | ||||
-rw-r--r-- | src/jtag/tcl.c | 10 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index 347196c0..0cec11ad 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -792,6 +792,8 @@ static int jtag_reset_callback(enum jtag_event event, void *priv) if (event == JTAG_TRST_ASSERTED) { + tap->enabled = !tap->disabled_after_reset; + buf_set_ones(tap->cur_instr, tap->ir_length); tap->bypass = 1; } diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index 34a099b8..956343ee 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -151,8 +151,10 @@ struct jtag_tap_s const char* tapname; const char* dotted_name; int abs_chain_position; - /// Is this TAP enabled? - int enabled; + /// Is this TAP disabled after JTAG reset? + bool disabled_after_reset; + /// Is this TAP currently enabled? + bool enabled; int ir_length; /**< size of instruction register */ u32 ir_capture_value; u8* expected; /**< Capture-IR expected value */ diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index fc113a39..8a7e38c3 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -359,9 +359,6 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi ) LOG_DEBUG("Creating New Tap, Chip: %s, Tap: %s, Dotted: %s, %d params", pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc); - /* default is enabled */ - pTap->enabled = 1; - /* deal with options */ #define NTREQ_IRLEN 1 #define NTREQ_IRCAPTURE 2 @@ -379,10 +376,10 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi ) LOG_DEBUG("Processing option: %s", n->name ); switch( n->value ){ case NTAP_OPT_ENABLED: - pTap->enabled = 1; + pTap->disabled_after_reset = false; break; case NTAP_OPT_DISABLED: - pTap->enabled = 0; + pTap->disabled_after_reset = true; break; case NTAP_OPT_EXPECTED_ID: { @@ -446,6 +443,9 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi ) } /* switch(n->value) */ } /* while( goi->argc ) */ + /* default is enabled-after-reset */ + pTap->enabled = !pTap->disabled_after_reset; + /* Did all the required option bits get cleared? */ if (0 == reqbits) { |