X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Fdsp5680xx.c;h=116f609d7e67ed6a533d9ccc84bc587a53906174;hb=f80ec2aa3723c59528198b275a348b6b8804929a;hp=e56861e4cea651c0a31b336b03abdd501f40597f;hpb=fb164bca55ec5a1c9c70837b576e1d43426cd05b;p=openocd.git diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c index e56861e4ce..116f609d7e 100644 --- a/src/target/dsp5680xx.c +++ b/src/target/dsp5680xx.c @@ -450,7 +450,7 @@ static int eonce_exit_debug_mode(struct target * target,uint8_t * eonce_status){ return retval; } -int switch_tap(struct target * target, struct jtag_tap * master_tap,struct jtag_tap * core_tap){ +static int switch_tap(struct target * target, struct jtag_tap * master_tap,struct jtag_tap * core_tap){ int retval = ERROR_OK; uint32_t instr; uint32_t ir_out;//not used, just to make jtag happy. @@ -582,11 +582,11 @@ static int eonce_enter_debug_mode(struct target * target, uint16_t * eonce_statu instr = MASTER_TAP_CMD_IDCODE; retval = dsp5680xx_irscan(target, & instr, & ir_out,DSP5680XX_JTAG_MASTER_TAP_IRLEN); err_check_propagate(retval); - usleep(TIME_DIV_FREESCALE*100*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*100*1000); // Enable EOnCE module jtag_add_reset(0,1); - usleep(TIME_DIV_FREESCALE*200*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*200*1000); instr = 0x0606ffff;// This was selected experimentally. retval = dsp5680xx_drscan(target,(uint8_t *) & instr,(uint8_t *) & ir_out,32); err_check_propagate(retval); @@ -608,9 +608,9 @@ static int eonce_enter_debug_mode(struct target * target, uint16_t * eonce_statu retval = dsp5680xx_drscan(target,(uint8_t *) & instr_16,(uint8_t *) & read_16,8); instr_16 = 0x20; retval = dsp5680xx_drscan(target,(uint8_t *) & instr_16,(uint8_t *) & read_16,8); - usleep(TIME_DIV_FREESCALE*100*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*100*1000); jtag_add_reset(0,0); - usleep(TIME_DIV_FREESCALE*300*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*300*1000); instr = JTAG_INSTR_ENABLE_ONCE; //Two rounds of jtag 0x6 (enable eonce) to enable EOnCE. @@ -1600,7 +1600,7 @@ int dsp5680xx_f_wr(struct target * target, uint8_t *buffer, uint32_t address, ui } // Reset state machine -int reset_jtag(void){ +static int reset_jtag(void){ int retval; tap_state_t states[2]; const char *cp = "RESET"; @@ -1640,11 +1640,11 @@ int dsp5680xx_f_unlock(struct target * target){ } jtag_add_reset(0,1); - usleep(TIME_DIV_FREESCALE*200*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*200*1000); retval = reset_jtag(); err_check(retval,"Failed to reset JTAG state machine"); - usleep(150); + jtag_add_sleep(150); // Enable core tap tap_chp->enabled = true; @@ -1654,9 +1654,9 @@ int dsp5680xx_f_unlock(struct target * target){ instr = JTAG_INSTR_DEBUG_REQUEST; retval = dsp5680xx_irscan(target, & instr, & ir_out,DSP5680XX_JTAG_CORE_TAP_IRLEN); err_check_propagate(retval); - usleep(TIME_DIV_FREESCALE*100*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*100*1000); jtag_add_reset(0,0); - usleep(TIME_DIV_FREESCALE*300*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*300*1000); // Enable master tap tap_chp->enabled = false; @@ -1672,13 +1672,13 @@ int dsp5680xx_f_unlock(struct target * target){ retval = dsp5680xx_drscan(target,(uint8_t *) & instr,(uint8_t *) & ir_out,16); err_check_propagate(retval); - usleep(TIME_DIV_FREESCALE*150*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*150*1000); jtag_add_reset(0,1); - usleep(TIME_DIV_FREESCALE*200*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*200*1000); retval = reset_jtag(); err_check(retval,"Failed to reset JTAG state machine"); - usleep(150); + jtag_add_sleep(150); instr = 0x0606ffff; retval = dsp5680xx_drscan(target,(uint8_t *) & instr,(uint8_t *) & ir_out,32); @@ -1706,9 +1706,9 @@ int dsp5680xx_f_unlock(struct target * target){ retval = dsp5680xx_drscan(target,(uint8_t *) & instr_16,(uint8_t *) & read_16,8); instr_16 = 0x20; retval = dsp5680xx_drscan(target,(uint8_t *) & instr_16,(uint8_t *) & read_16,8); - usleep(TIME_DIV_FREESCALE*100*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*100*1000); jtag_add_reset(0,0); - usleep(TIME_DIV_FREESCALE*300*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*300*1000); return retval; } @@ -1719,13 +1719,13 @@ int dsp5680xx_f_lock(struct target * target){ err_check_propagate(retval); jtag_add_reset(0,1); - usleep(TIME_DIV_FREESCALE*200*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*200*1000); retval = reset_jtag(); err_check(retval,"Failed to reset JTAG state machine"); - usleep(TIME_DIV_FREESCALE*100*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*100*1000); jtag_add_reset(0,0); - usleep(TIME_DIV_FREESCALE*300*1000); + jtag_add_sleep(TIME_DIV_FREESCALE*300*1000); return retval; }