usleep to jtag_sleep
authorRodrigo L. Rosa <rodrigorosa.LG@gmail.com>
Wed, 31 Aug 2011 22:43:11 +0000 (15:43 -0700)
committerRodrigo L. Rosa <rodrigorosa.LG@gmail.com>
Wed, 31 Aug 2011 22:46:05 +0000 (15:46 -0700)
this will help avoid platform specific timing issues

src/target/dsp5680xx.c

index ff28be1e4613c26d5b9c375abb4eac95930310bc..116f609d7e67ed6a533d9ccc84bc587a53906174 100644 (file)
@@ -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.
@@ -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;
 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)