URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 39 |
Rev 45 |
Line 367... |
Line 367... |
/* counts retries and returns zero if we should abort */
|
/* counts retries and returns zero if we should abort */
|
static int retry_no = 0;
|
static int retry_no = 0;
|
int retry_do() {
|
int retry_do() {
|
|
|
unsigned char stalled;
|
unsigned char stalled;
|
|
int tap_id_reads = 0;
|
|
|
//printf("RETRY\n");
|
//printf("RETRY\n");
|
if (retry_no == 0)
|
if (retry_no == 0)
|
printf("Communication error. Retrying\n");
|
printf("Communication error. Retrying\n");
|
|
|
Line 389... |
Line 390... |
return 0;
|
return 0;
|
}
|
}
|
*/
|
*/
|
|
|
// Try a readback of the TAP ID
|
// Try a readback of the TAP ID
|
|
read_tap:
|
// Set ID code instruction in IR
|
// Set ID code instruction in IR
|
usb_set_tap_ir(JI_IDCODE);
|
usb_set_tap_ir(JI_IDCODE);
|
|
|
// Now read out the IDCODE for the device
|
// Now read out the IDCODE for the device
|
uint32_t id = usb_read_stream(32, RUN_TEST_IDLE_STATE);
|
uint32_t id = usb_read_stream(32, RUN_TEST_IDLE_STATE);
|
Line 401... |
Line 402... |
//Return the chain to DEBUG mode
|
//Return the chain to DEBUG mode
|
usb_set_tap_ir(JI_DEBUG);
|
usb_set_tap_ir(JI_DEBUG);
|
|
|
if((id&0xffffffff) != (id_read_at_reset&0xffffffff))
|
if((id&0xffffffff) != (id_read_at_reset&0xffffffff))
|
{
|
{
|
|
if (tap_id_reads == 10)
|
|
{
|
// Pretty big problem - can't even read the ID of the TAP anymore
|
// Pretty big problem - can't even read the ID of the TAP anymore
|
// So return error
|
// So return error
|
printf("Unable to read JTAG TAP ID - read %08x, expected %08x\n", id, id_read_at_reset);
|
printf("Unable to read JTAG TAP ID - read %08x, expected %08x\n",
|
|
id, id_read_at_reset);
|
|
|
return 1;
|
return 1;
|
}
|
}
|
|
|
|
tap_id_reads++;
|
|
|
|
goto read_tap;
|
|
}
|
|
|
current_chain = -1;
|
current_chain = -1;
|
|
|
if (retry_no == 1)
|
if (retry_no == 1)
|
sleep(1);
|
sleep(1);
|
|
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.