X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fjtag%2Fdrivers%2Fjlink.c;h=0414ec7103d18574e2f204a6d9c73ba4f0cf9afa;hb=61a2f3284b984abee0ffd1166ecd79a0ea82976e;hp=7a2be61fe26ef83f69fdafdb8cb3b194aefe34bd;hpb=1887e2a273797af3d5625ea3d78df3f9ce27ead3;p=fw%2Fopenocd diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 7a2be61fe..0414ec710 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -294,7 +294,7 @@ static int jlink_execute_queue(void) int ret; struct jtag_command *cmd = jtag_command_queue; - while (cmd != NULL) { + while (cmd) { ret = jlink_execute_command(cmd); if (ret != ERROR_OK) @@ -547,7 +547,7 @@ static bool jlink_usb_location_equal(struct jaylink_device *dev) return false; } - equal = jtag_usb_location_equal(bus, ports, num_ports); + equal = adapter_usb_location_equal(bus, ports, num_ports); free(ports); return equal; @@ -573,7 +573,7 @@ static int jlink_open_device(uint32_t ifaces, bool *found_device) return ERROR_JTAG_INIT_FAILED; } - use_usb_location = (jtag_usb_get_location() != NULL); + use_usb_location = !!adapter_usb_get_location(); if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) { LOG_ERROR("Multiple devices found, specify the desired device"); @@ -811,7 +811,7 @@ static int jlink_init(void) jtag_sleep(3000); jlink_tap_init(); - jlink_speed(jtag_get_speed_khz()); + jlink_speed(adapter_get_speed_khz()); if (iface == JAYLINK_TIF_JTAG) { /* @@ -2148,11 +2148,31 @@ static int jlink_swd_switch_seq(enum swd_special_seq seq) s = swd_seq_jtag_to_swd; s_len = swd_seq_jtag_to_swd_len; break; + case JTAG_TO_DORMANT: + LOG_DEBUG("JTAG-to-DORMANT"); + s = swd_seq_jtag_to_dormant; + s_len = swd_seq_jtag_to_dormant_len; + break; case SWD_TO_JTAG: LOG_DEBUG("SWD-to-JTAG"); s = swd_seq_swd_to_jtag; s_len = swd_seq_swd_to_jtag_len; break; + case SWD_TO_DORMANT: + LOG_DEBUG("SWD-to-DORMANT"); + s = swd_seq_swd_to_dormant; + s_len = swd_seq_swd_to_dormant_len; + break; + case DORMANT_TO_SWD: + LOG_DEBUG("DORMANT-to-SWD"); + s = swd_seq_dormant_to_swd; + s_len = swd_seq_dormant_to_swd_len; + break; + case DORMANT_TO_JTAG: + LOG_DEBUG("DORMANT-to-JTAG"); + s = swd_seq_dormant_to_jtag; + s_len = swd_seq_dormant_to_jtag_len; + break; default: LOG_ERROR("Sequence %d not supported", seq); return ERROR_FAIL;