aboutsummaryrefslogtreecommitdiff
path: root/src/target/dsp5680xx.c
diff options
context:
space:
mode:
authorRodrigo L. Rosa <rodrigorosa.LG@gmail.com>2011-08-30 14:46:20 -0700
committerRodrigo L. Rosa <rodrigorosa.LG@gmail.com>2011-08-30 15:17:00 -0700
commit573cbeac1ee0bfadef5c924ff4a13c8e251c773c (patch)
tree8b45770fd8fb5a147ef88282ab8352553b9d8cc5 /src/target/dsp5680xx.c
parenteb0734de19c51f48dd66f6bc8af4e20bdb534e63 (diff)
downloadriscv-openocd-573cbeac1ee0bfadef5c924ff4a13c8e251c773c.zip
riscv-openocd-573cbeac1ee0bfadef5c924ff4a13c8e251c773c.tar.gz
riscv-openocd-573cbeac1ee0bfadef5c924ff4a13c8e251c773c.tar.bz2
fix irlen handling
sometimes the master tap will be enabled, since tap switching is required during halt/lock/unlocking procedures. now irscan handles this, avoiding unnecessary warnings and preventing errors.
Diffstat (limited to 'src/target/dsp5680xx.c')
-rw-r--r--src/target/dsp5680xx.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index 675dfce..7a1f990 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -90,12 +90,17 @@ static int dsp5680xx_irscan(struct target * target, uint32_t * data_to_shift_int
err_check(retval,"Invalid tap");
}
if (ir_len != target->tap->ir_length){
- LOG_WARNING("%s: Invalid ir_len of core tap. If you are removing protection on flash then do not worry about this warninig.",__FUNCTION__);
- //return ERROR_FAIL;//TODO this was commented out to enable unlocking using the master tap. did not find a way to enable the master tap without using tcl.
+ if(target->tap->enabled){
+ retval = ERROR_FAIL;
+ err_check(retval,"Invalid irlen");
+ }else{
+ struct jtag_tap * master_tap = jtag_tap_by_string("dsp568013.chp");
+ if((master_tap == NULL) || ((master_tap->enabled) && (ir_len != DSP5680XX_JTAG_MASTER_TAP_IRLEN))){
+ retval = ERROR_FAIL;
+ err_check(retval,"Invalid irlen");
+ }
+ }
}
- //TODO what values of len are valid for jtag_add_plain_ir_scan?
- //can i send as many bits as i want?
- //is the casting necessary?
jtag_add_plain_ir_scan(ir_len,(uint8_t *)data_to_shift_into_ir,(uint8_t *)data_shifted_out_of_ir, TAP_IDLE);
if(dsp5680xx_context.flush){
retval = dsp5680xx_execute_queue();