diff options
author | kc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-01-23 07:10:11 +0000 |
---|---|---|
committer | kc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-01-23 07:10:11 +0000 |
commit | d5209daeb117af7378c3c0088caaa2ba67ea5cdf (patch) | |
tree | 19df837af946b3133ccaa69b63498f7b56512f43 /src/jtag/bitbang.c | |
parent | 6f612fb9597e038d4be5d26b2c17c7adf29c1a09 (diff) | |
download | riscv-openocd-d5209daeb117af7378c3c0088caaa2ba67ea5cdf.zip riscv-openocd-d5209daeb117af7378c3c0088caaa2ba67ea5cdf.tar.gz riscv-openocd-d5209daeb117af7378c3c0088caaa2ba67ea5cdf.tar.bz2 |
xvsf player fixes by Dick Hollenbeck <dick@softplc.com>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1360 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/bitbang.c')
-rw-r--r-- | src/jtag/bitbang.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/jtag/bitbang.c b/src/jtag/bitbang.c index e4191d1..0541600 100644 --- a/src/jtag/bitbang.c +++ b/src/jtag/bitbang.c @@ -38,6 +38,14 @@ #include <unistd.h> +/** + * Function bitbang_stableclocks + * issues a number of clock cycles while staying in a stable state. + * Because the TMS value required to stay in the RESET state is a 1, whereas + * the TMS value required to stay in any of the other stable states is a 0, + * this function checks the current stable state to decide on the value of TMS + * to use. + */ static void bitbang_stableclocks(int num_cycles); @@ -162,13 +170,14 @@ void bitbang_runtest(int num_cycles) static void bitbang_stableclocks(int num_cycles) { + int tms = (cur_state == TAP_RESET ? 1 : 0); int i; /* send num_cycles clocks onto the cable */ for (i = 0; i < num_cycles; i++) { - bitbang_interface->write(1, 0, 0); - bitbang_interface->write(0, 0, 0); + bitbang_interface->write(1, tms, 0); + bitbang_interface->write(0, tms, 0); } } @@ -293,6 +302,9 @@ int bitbang_execute_queue(void) break; case JTAG_STABLECLOCKS: + /* this is only allowed while in a stable state. A check for a stable + * state was done in jtag_add_clocks() + */ bitbang_stableclocks(cmd->cmd.stableclocks->num_cycles); break; |