diff options
author | dbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-10-07 19:02:21 +0000 |
---|---|---|
committer | dbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-10-07 19:02:21 +0000 |
commit | cdc33b38088e6435393b86808b6833d09ea4aa73 (patch) | |
tree | 854784d7fad5516c9c26165cdeca20d276a3ad2a | |
parent | 246ff4f6019ed59fe47295b3753728b3e4c0dc40 (diff) | |
download | openocd+libswd-cdc33b38088e6435393b86808b6833d09ea4aa73.tar.gz openocd+libswd-cdc33b38088e6435393b86808b6833d09ea4aa73.tar.bz2 openocd+libswd-cdc33b38088e6435393b86808b6833d09ea4aa73.tar.xz openocd+libswd-cdc33b38088e6435393b86808b6833d09ea4aa73.zip |
Force sane SRST and TRST initialization
At least some FT2232 based adapters don't necessarily come up
in the expected state, with SRST and TRST disabled. Since
other adapters could suffer the same problem, let's avoid
needing to patch every driver and just force *all* adapters
to initialize those values properly at server startup.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2824 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/jtag/core.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index e6bde518..f7d55b79 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -68,10 +68,12 @@ static const char *jtag_event_strings[] = /* * JTAG adapters must initialize with TRST and SRST de-asserted - * (they're negative logic, so that means *high*) + * (they're negative logic, so that means *high*). But some + * hardware doesn't necessarily work that way ... so set things + * up so that jtag_init() always forces that state. */ -static int jtag_trst = 0; -static int jtag_srst = 0; +static int jtag_trst = -1; +static int jtag_srst = -1; /** * List all TAPs that have been created. @@ -1337,9 +1339,15 @@ int jtag_init_reset(struct command_context_s *cmd_ctx) int jtag_init(struct command_context_s *cmd_ctx) { int retval; + if ((retval = jtag_interface_init(cmd_ctx)) != ERROR_OK) return retval; + /* guard against oddball hardware: force resets to be inactive */ + jtag_add_reset(0, 0); + if ((retval = jtag_execute_queue()) != ERROR_OK) + return retval; + if (Jim_Eval_Named(interp, "jtag_init", __FILE__, __LINE__) != JIM_OK) return ERROR_FAIL; |