diff options
Diffstat (limited to 'src/jtag/core.c')
-rw-r--r-- | src/jtag/core.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index ff9f3e0..78f67db 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -93,6 +93,8 @@ static int jtag_verify = 1; /* how long the OpenOCD should wait before attempting JTAG communication after reset lines deasserted (in ms) */ static int jtag_nsrst_delay = 0; /* default to no nSRST delay */ static int jtag_ntrst_delay = 0; /* default to no nTRST delay */ +static int jtag_nsrst_assert_width = 0; /* width of assertion */ +static int jtag_ntrst_assert_width = 0; /* width of assertion */ typedef struct jtag_event_callback_s { @@ -661,7 +663,11 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst) if (jtag_srst != new_srst) { jtag_srst = new_srst; if (jtag_srst) + { LOG_DEBUG("SRST line asserted"); + if (jtag_nsrst_assert_width) + jtag_add_sleep(jtag_nsrst_assert_width * 1000); + } else { LOG_DEBUG("SRST line released"); if (jtag_nsrst_delay) @@ -685,6 +691,8 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst) if (jtag_trst) { LOG_DEBUG("TRST line asserted"); tap_set_state(TAP_RESET); + if (jtag_ntrst_assert_width) + jtag_add_sleep(jtag_ntrst_assert_width * 1000); } else { LOG_DEBUG("TRST line released"); if (jtag_ntrst_delay) @@ -1480,3 +1488,21 @@ unsigned jtag_get_ntrst_delay(void) { return jtag_ntrst_delay; } + + +void jtag_set_nsrst_assert_width(unsigned delay) +{ + jtag_nsrst_assert_width = delay; +} +unsigned jtag_get_nsrst_assert_width(void) +{ + return jtag_nsrst_assert_width; +} +void jtag_set_ntrst_assert_width(unsigned delay) +{ + jtag_ntrst_assert_width = delay; +} +unsigned jtag_get_ntrst_assert_width(void) +{ + return jtag_ntrst_assert_width; +} |