X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fjtag%2Fdrivers%2Fusb_blaster%2Fusb_blaster.c;h=55b511e1acc7c469b0cb814a2eefd30c05cb3cd5;hp=8ccf871724c7b636ad7d246278ea26a7683b2e9a;hb=8b9560349fb78887d8e353e20b303966d9ac2d1b;hpb=e57f8e12da6da02c192cd9365185fe8eee46b080 diff --git a/src/jtag/drivers/usb_blaster/usb_blaster.c b/src/jtag/drivers/usb_blaster/usb_blaster.c index 8ccf871724..55b511e1ac 100644 --- a/src/jtag/drivers/usb_blaster/usb_blaster.c +++ b/src/jtag/drivers/usb_blaster/usb_blaster.c @@ -174,7 +174,7 @@ static int ublast_buf_read(uint8_t *buf, unsigned size, uint32_t *bytes_read) int ret = info.drv->read(info.drv, buf, size, bytes_read); char *str = hexdump(buf, *bytes_read); - DEBUG_JTAG_IO("(size=%d, buf=[%s]) -> %u", size, str, + LOG_DEBUG_IO("(size=%d, buf=[%s]) -> %u", size, str, *bytes_read); free(str); return ret; @@ -185,7 +185,7 @@ static int ublast_buf_write(uint8_t *buf, int size, uint32_t *bytes_written) int ret = info.drv->write(info.drv, buf, size, bytes_written); char *str = hexdump(buf, *bytes_written); - DEBUG_JTAG_IO("(size=%d, buf=[%s]) -> %u", size, str, + LOG_DEBUG_IO("(size=%d, buf=[%s]) -> %u", size, str, *bytes_written); free(str); return ret; @@ -266,7 +266,7 @@ static void ublast_queue_byte(uint8_t abyte) info.buf[info.bufidx++] = abyte; if (nb_buf_remaining() == 0) ublast_flush_buffer(); - DEBUG_JTAG_IO("(byte=0x%02x)", abyte); + LOG_DEBUG_IO("(byte=0x%02x)", abyte); } /** @@ -337,7 +337,7 @@ static void ublast_clock_tms(int tms) { uint8_t out; - DEBUG_JTAG_IO("(tms=%d)", !!tms); + LOG_DEBUG_IO("(tms=%d)", !!tms); info.tms = !!tms; info.tdi = 0; out = ublast_build_out(SCAN_OUT); @@ -354,7 +354,7 @@ static void ublast_idle_clock(void) { uint8_t out = ublast_build_out(SCAN_OUT); - DEBUG_JTAG_IO("."); + LOG_DEBUG_IO("."); ublast_queue_byte(out); } @@ -375,7 +375,7 @@ static void ublast_clock_tdi(int tdi, enum scan_type type) { uint8_t out; - DEBUG_JTAG_IO("(tdi=%d)", !!tdi); + LOG_DEBUG_IO("(tdi=%d)", !!tdi); info.tdi = !!tdi; out = ublast_build_out(SCAN_OUT); @@ -400,7 +400,7 @@ static void ublast_clock_tdi_flip_tms(int tdi, enum scan_type type) { uint8_t out; - DEBUG_JTAG_IO("(tdi=%d)", !!tdi); + LOG_DEBUG_IO("(tdi=%d)", !!tdi); info.tdi = !!tdi; info.tms = !info.tms; @@ -430,7 +430,7 @@ static void ublast_queue_bytes(uint8_t *bytes, int nb_bytes) info.bufidx + nb_bytes); exit(-1); } - DEBUG_JTAG_IO("(nb_bytes=%d, bytes=[0x%02x, ...])", nb_bytes, + LOG_DEBUG_IO("(nb_bytes=%d, bytes=[0x%02x, ...])", nb_bytes, bytes ? bytes[0] : 0); if (bytes) memcpy(&info.buf[info.bufidx], bytes, nb_bytes); @@ -457,7 +457,7 @@ static void ublast_tms_seq(const uint8_t *bits, int nb_bits, int skip) { int i; - DEBUG_JTAG_IO("(bits=%02x..., nb_bits=%d)", bits[0], nb_bits); + LOG_DEBUG_IO("(bits=%02x..., nb_bits=%d)", bits[0], nb_bits); for (i = skip; i < nb_bits; i++) ublast_clock_tms((bits[i / 8] >> (i % 8)) & 0x01); ublast_idle_clock(); @@ -469,7 +469,7 @@ static void ublast_tms_seq(const uint8_t *bits, int nb_bits, int skip) */ static void ublast_tms(struct tms_command *cmd) { - DEBUG_JTAG_IO("(num_bits=%d)", cmd->num_bits); + LOG_DEBUG_IO("(num_bits=%d)", cmd->num_bits); ublast_tms_seq(cmd->bits, cmd->num_bits, 0); } @@ -487,7 +487,7 @@ static void ublast_path_move(struct pathmove_command *cmd) { int i; - DEBUG_JTAG_IO("(num_states=%d, last_state=%d)", + LOG_DEBUG_IO("(num_states=%d, last_state=%d)", cmd->num_states, cmd->path[cmd->num_states - 1]); for (i = 0; i < cmd->num_states; i++) { if (tap_state_transition(tap_get_state(), false) == cmd->path[i]) @@ -512,7 +512,7 @@ static void ublast_state_move(tap_state_t state, int skip) uint8_t tms_scan; int tms_len; - DEBUG_JTAG_IO("(from %s to %s)", tap_state_name(tap_get_state()), + LOG_DEBUG_IO("(from %s to %s)", tap_state_name(tap_get_state()), tap_state_name(state)); if (tap_get_state() == state) return; @@ -541,7 +541,7 @@ static int ublast_read_byteshifted_tdos(uint8_t *buf, int nb_bytes) unsigned int retlen; int ret = ERROR_OK; - DEBUG_JTAG_IO("%s(buf=%p, num_bits=%d)", __func__, buf, nb_bytes * 8); + LOG_DEBUG_IO("%s(buf=%p, num_bits=%d)", __func__, buf, nb_bytes * 8); ublast_flush_buffer(); while (ret == ERROR_OK && nb_bytes > 0) { ret = ublast_buf_read(buf, nb_bytes, &retlen); @@ -573,7 +573,7 @@ static int ublast_read_bitbang_tdos(uint8_t *buf, int nb_bits) unsigned int retlen; uint8_t tmp[8]; - DEBUG_JTAG_IO("%s(buf=%p, num_bits=%d)", __func__, buf, nb_bits); + LOG_DEBUG_IO("%s(buf=%p, num_bits=%d)", __func__, buf, nb_bits); /* * Ensure all previous bitbang writes were issued to the dongle, so that @@ -688,7 +688,7 @@ static void ublast_queue_tdi(uint8_t *bits, int nb_bits, enum scan_type scan) static void ublast_runtest(int cycles, tap_state_t state) { - DEBUG_JTAG_IO("%s(cycles=%i, end_state=%d)", __func__, cycles, state); + LOG_DEBUG_IO("%s(cycles=%i, end_state=%d)", __func__, cycles, state); ublast_state_move(TAP_IDLE, 0); ublast_queue_tdi(NULL, cycles, SCAN_OUT); @@ -697,7 +697,7 @@ static void ublast_runtest(int cycles, tap_state_t state) static void ublast_stableclocks(int cycles) { - DEBUG_JTAG_IO("%s(cycles=%i)", __func__, cycles); + LOG_DEBUG_IO("%s(cycles=%i)", __func__, cycles); ublast_queue_tdi(NULL, cycles, SCAN_OUT); } @@ -727,7 +727,7 @@ static int ublast_scan(struct scan_command *cmd) ublast_state_move(TAP_DRSHIFT, 0); log_buf = hexdump(buf, DIV_ROUND_UP(scan_bits, 8)); - DEBUG_JTAG_IO("%s(scan=%s, type=%s, bits=%d, buf=[%s], end_state=%d)", __func__, + LOG_DEBUG_IO("%s(scan=%s, type=%s, bits=%d, buf=[%s], end_state=%d)", __func__, cmd->ir_scan ? "IRSCAN" : "DRSCAN", type2str[type], scan_bits, log_buf, cmd->end_state); @@ -749,7 +749,7 @@ static int ublast_scan(struct scan_command *cmd) static void ublast_usleep(int us) { - DEBUG_JTAG_IO("%s(us=%d)", __func__, us); + LOG_DEBUG_IO("%s(us=%d)", __func__, us); jtag_sleep(us); }