{
jtag_event_callback_t *callback = jtag_event_callbacks;
- DEBUG("jtag event: %s", jtag_event_strings[event]);
+ LOG_DEBUG("jtag event: %s", jtag_event_strings[event]);
while (callback)
{
i++;
}
- ERROR("jtag device number %d not defined", num);
+ LOG_ERROR("jtag device number %d not defined", num);
exit(-1);
}
{
if (jtag_trst == 1)
{
- WARNING("JTAG command queued, while TRST is low (TAP in reset)");
+ LOG_WARNING("JTAG command queued, while TRST is low (TAP in reset)");
jtag_error=ERROR_JTAG_TRST_ASSERTED;
return;
}
/* if a device isn't listed, the BYPASS register should be selected */
if (!jtag_get_device(i)->bypass)
{
- ERROR("BUG: no scan data for a device not in BYPASS");
+ LOG_ERROR("BUG: no scan data for a device not in BYPASS");
exit(-1);
}
#endif
/* if a device is listed, the BYPASS register must not be selected */
if (jtag_get_device(i)->bypass)
{
- ERROR("BUG: scan data for a device in BYPASS");
+ LOG_ERROR("BUG: scan data for a device in BYPASS");
exit(-1);
}
#endif
/* if a device is listed, the BYPASS register must not be selected */
if (jtag_get_device(i)->bypass)
{
- ERROR("BUG: scan data for a device in BYPASS");
+ LOG_ERROR("BUG: scan data for a device in BYPASS");
exit(-1);
}
#endif
/* if a device isn't listed, the BYPASS register should be selected */
if (!jtag_get_device(i)->bypass)
{
- ERROR("BUG: no scan data for a device not in BYPASS");
+ LOG_ERROR("BUG: no scan data for a device not in BYPASS");
exit(-1);
}
#endif
/* the last state has to be a stable state */
if (tap_move_map[path[num_states - 1]] == -1)
{
- ERROR("BUG: TAP path doesn't finish in a stable state");
+ LOG_ERROR("BUG: TAP path doesn't finish in a stable state");
exit(-1);
}
if ((tap_transitions[cur_state].low != path[i])&&
(tap_transitions[cur_state].high != path[i]))
{
- ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_strings[cur_state], tap_state_strings[path[i]]);
+ LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_strings[cur_state], tap_state_strings[path[i]]);
exit(-1);
}
cur_state = path[i];
/* if SRST pulls TRST, we can't fulfill srst == 1 with trst == 0 */
if (((jtag_reset_config & RESET_SRST_PULLS_TRST) && (req_srst == 1)) && (req_trst == 0))
{
- WARNING("requested reset would assert trst");
+ LOG_WARNING("requested reset would assert trst");
return ERROR_JTAG_RESET_WOULD_ASSERT_TRST;
}
if (req_srst && !(jtag_reset_config & RESET_HAS_SRST))
{
- WARNING("requested nSRST assertion, but the current configuration doesn't support this");
+ LOG_WARNING("requested nSRST assertion, but the current configuration doesn't support this");
return ERROR_JTAG_RESET_CANT_SRST;
}
if (jtag_srst)
{
- DEBUG("SRST line asserted");
+ LOG_DEBUG("SRST line asserted");
}
else
{
- DEBUG("SRST line released");
+ LOG_DEBUG("SRST line released");
if (jtag_nsrst_delay)
jtag_add_sleep(jtag_nsrst_delay * 1000);
}
if (trst_with_tms)
{
- DEBUG("JTAG reset with tms instead of TRST");
+ LOG_DEBUG("JTAG reset with tms instead of TRST");
jtag_add_end_state(TAP_TLR);
jtag_add_statemove(TAP_TLR);
jtag_call_event_callbacks(JTAG_TRST_ASSERTED);
/* we just asserted nTRST, so we're now in Test-Logic-Reset,
* and inform possible listeners about this
*/
- DEBUG("TRST line asserted");
+ LOG_DEBUG("TRST line asserted");
cmd_queue_cur_state = TAP_TLR;
jtag_call_event_callbacks(JTAG_TRST_ASSERTED);
}
/* the nTRST line got deasserted, so we're still in Test-Logic-Reset,
* but we might want to add a delay to give the TAP time to settle
*/
- DEBUG("Now in TAP_TLR - Test-Logic-Reset(either due to TRST line asserted or tms reset)");
+ LOG_DEBUG("Now in TAP_TLR - Test-Logic-Reset(either due to TRST line asserted or tms reset)");
if (jtag_ntrst_delay)
jtag_add_sleep(jtag_ntrst_delay * 1000);
}
#endif
buf_set_buf(cmd->fields[i].out_value, 0, *buffer, bit_count, cmd->fields[i].num_bits);
#ifdef _DEBUG_JTAG_IO_
- DEBUG("fields[%i].out_value: 0x%s", i, char_buf);
+ LOG_DEBUG("fields[%i].out_value: 0x%s", i, char_buf);
free(char_buf);
#endif
}
char *char_buf;
char_buf = buf_to_str(captured, (num_bits > 64) ? 64 : num_bits, 16);
- DEBUG("fields[%i].in_value: 0x%s", i, char_buf);
+ LOG_DEBUG("fields[%i].in_value: 0x%s", i, char_buf);
free(char_buf);
#endif
{
if (cmd->fields[i].in_handler(cmd->fields[i].in_value, cmd->fields[i].in_handler_priv, cmd->fields+i) != ERROR_OK)
{
- WARNING("in_handler reported a failed check");
+ LOG_WARNING("in_handler reported a failed check");
retval = ERROR_JTAG_QUEUE_FAILED;
}
}
/* We're going to call the error:handler later, but if the in_handler
* reported an error we report this failure upstream
*/
- WARNING("in_handler reported a failed check");
+ LOG_WARNING("in_handler reported a failed check");
retval = ERROR_JTAG_QUEUE_FAILED;
}
}
{
char *in_check_mask_char;
in_check_mask_char = buf_to_str(field->in_check_mask, (num_bits > 64) ? 64 : num_bits, 16);
- WARNING("value captured during scan didn't pass the requested check: captured: 0x%s check_value: 0x%s check_mask: 0x%s", captured_char, in_check_value_char, in_check_mask_char);
+ LOG_WARNING("value captured during scan didn't pass the requested check: captured: 0x%s check_value: 0x%s check_mask: 0x%s", captured_char, in_check_value_char, in_check_mask_char);
free(in_check_mask_char);
}
else
{
- WARNING("value captured during scan didn't pass the requested check: captured: 0x%s check_value: 0x%s", captured_char, in_check_value_char);
+ LOG_WARNING("value captured during scan didn't pass the requested check: captured: 0x%s check_value: 0x%s", captured_char, in_check_value_char);
}
free(captured_char);
{
jtag_device_t *device = priv;
- DEBUG("-");
+ LOG_DEBUG("-");
if (event == JTAG_TRST_ASSERTED)
{
/* if there wasn't a single non-zero bit or if all bits were one, the scan isn't valid */
if ((zero_check == 0x00) || (one_check == 0xff))
{
- ERROR("JTAG communication failure, check connection, JTAG interface, target power etc.");
+ LOG_ERROR("JTAG communication failure, check connection, JTAG interface, target power etc.");
return ERROR_JTAG_INIT_FAILED;
}
part = (idcode & 0xffff000) >> 12;
version = (idcode & 0xf0000000) >> 28;
- INFO("JTAG device found: 0x%8.8x (Manufacturer: 0x%3.3x, Part: 0x%4.4x, Version: 0x%1.1x)",
+ LOG_INFO("JTAG device found: 0x%8.8x (Manufacturer: 0x%3.3x, Part: 0x%4.4x, Version: 0x%1.1x)",
idcode, manufacturer, part, version);
bit_count += 32;
/* see if number of discovered devices matches configuration */
if (device_count != jtag_num_devices)
{
- ERROR("number of discovered devices in JTAG chain (%i) doesn't match configuration (%i)",
+ LOG_ERROR("number of discovered devices in JTAG chain (%i) doesn't match configuration (%i)",
device_count, jtag_num_devices);
- ERROR("check the config file and ensure proper JTAG communication (connections, speed, ...)");
+ LOG_ERROR("check the config file and ensure proper JTAG communication (connections, speed, ...)");
return ERROR_JTAG_INIT_FAILED;
}
if (buf_get_u32(ir_test, chain_pos, 2) != 0x1)
{
char *cbuf = buf_to_str(ir_test, total_ir_length, 16);
- ERROR("Error validating JTAG scan chain, IR mismatch, scan returned 0x%s", cbuf);
+ LOG_ERROR("Error validating JTAG scan chain, IR mismatch, scan returned 0x%s", cbuf);
free(cbuf);
free(ir_test);
return ERROR_JTAG_INIT_FAILED;
if (buf_get_u32(ir_test, chain_pos, 2) != 0x3)
{
char *cbuf = buf_to_str(ir_test, total_ir_length, 16);
- ERROR("Error validating JTAG scan chain, IR mismatch, scan returned 0x%s", cbuf);
+ LOG_ERROR("Error validating JTAG scan chain, IR mismatch, scan returned 0x%s", cbuf);
free(cbuf);
free(ir_test);
return ERROR_JTAG_INIT_FAILED;
if (!jtag_interface)
{
/* nothing was previously specified by "interface" command */
- ERROR("JTAG interface has to be specified, see \"interface\" command");
+ LOG_ERROR("JTAG interface has to be specified, see \"interface\" command");
return ERROR_JTAG_INVALID_INTERFACE;
}
int validate_tries = 0;
jtag_device_t *device;
- DEBUG("-");
+ LOG_DEBUG("-");
if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
return ERROR_JTAG_INIT_FAILED;
/* examine chain first, as this could discover the real chain layout */
if (jtag_examine_chain() != ERROR_OK)
{
- ERROR("trying to validate configured JTAG chain anyway...");
+ LOG_ERROR("trying to validate configured JTAG chain anyway...");
}
while (jtag_validate_chain() != ERROR_OK)
validate_tries++;
if (validate_tries > 5)
{
- ERROR("Could not validate JTAG chain, exit");
+ LOG_ERROR("Could not validate JTAG chain, exit");
return ERROR_JTAG_INVALID_INTERFACE;
}
usleep(10000);
static int default_khz(int khz, int *jtag_speed)
{
- ERROR("Translation from khz to jtag_speed not implemented");
+ LOG_ERROR("Translation from khz to jtag_speed not implemented");
return ERROR_FAIL;
}
/* check whether the interface is already configured */
if (jtag_interface)
{
- WARNING("Interface already configured, ignoring");
+ LOG_WARNING("Interface already configured, ignoring");
return ERROR_OK;
}
/* no valid interface was found (i.e. the configuration option,
* didn't match one of the compiled-in interfaces
*/
- ERROR("No valid jtag interface found (%s)", args[0]);
- ERROR("compiled-in jtag interfaces:");
+ LOG_ERROR("No valid jtag interface found (%s)", args[0]);
+ LOG_ERROR("compiled-in jtag interfaces:");
for (i = 0; jtag_interfaces[i]; i++)
{
- ERROR("%i: %s", i, jtag_interfaces[i]->name);
+ LOG_ERROR("%i: %s", i, jtag_interfaces[i]->name);
}
return ERROR_JTAG_INVALID_INTERFACE;
jtag_reset_config = RESET_TRST_AND_SRST;
else
{
- ERROR("invalid reset_config argument, defaulting to none");
+ LOG_ERROR("invalid reset_config argument, defaulting to none");
jtag_reset_config = RESET_NONE;
return ERROR_INVALID_ARGUMENTS;
}
jtag_reset_config &= ~(RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST);
else
{
- ERROR("invalid reset_config argument, defaulting to none");
+ LOG_ERROR("invalid reset_config argument, defaulting to none");
jtag_reset_config = RESET_NONE;
return ERROR_INVALID_ARGUMENTS;
}
jtag_reset_config &= ~RESET_TRST_OPEN_DRAIN;
else
{
- ERROR("invalid reset_config argument, defaulting to none");
+ LOG_ERROR("invalid reset_config argument, defaulting to none");
jtag_reset_config = RESET_NONE;
return ERROR_INVALID_ARGUMENTS;
}
jtag_reset_config &= ~RESET_SRST_PUSH_PULL;
else
{
- ERROR("invalid reset_config argument, defaulting to none");
+ LOG_ERROR("invalid reset_config argument, defaulting to none");
jtag_reset_config = RESET_NONE;
return ERROR_INVALID_ARGUMENTS;
}
{
if (argc < 1)
{
- ERROR("jtag_nsrst_delay <ms> command takes one required argument");
+ LOG_ERROR("jtag_nsrst_delay <ms> command takes one required argument");
exit(-1);
}
else
{
if (argc < 1)
{
- ERROR("jtag_ntrst_delay <ms> command takes one required argument");
+ LOG_ERROR("jtag_ntrst_delay <ms> command takes one required argument");
exit(-1);
}
else
if (jtag == NULL)
{
- ERROR("Interface not selected yet");
+ LOG_ERROR("Interface not selected yet");
return ERROR_COMMAND_SYNTAX_ERROR;
}