From 3f34ed9c7908ac78ed3f83d436cd6a365ddd4d7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20J=C3=B8rvang?= Date: Tue, 17 Sep 2013 14:21:38 +0100 Subject: [PATCH] bus_blaster: do not fail on missing get_latency_timer Patch submitted from Trac #64 Seems certain clones do not correctly emulate the ftdi chip, if the call to read the latency timer fails then do not treat this as a failure. Change-Id: Iae671b926d101adf1010639d11ca46c58d0af524 Signed-off-by: Spencer Oliver Reviewed-on: http://openocd.zylin.com/1627 Tested-by: jenkins Reviewed-by: Xiaofan --- src/jtag/drivers/usb_blaster/ublast_access_ftd2xx.c | 7 +++---- src/jtag/drivers/usb_blaster/ublast_access_ftdi.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/jtag/drivers/usb_blaster/ublast_access_ftd2xx.c b/src/jtag/drivers/usb_blaster/ublast_access_ftd2xx.c index e350650d..14351fbd 100644 --- a/src/jtag/drivers/usb_blaster/ublast_access_ftd2xx.c +++ b/src/jtag/drivers/usb_blaster/ublast_access_ftd2xx.c @@ -136,12 +136,11 @@ static int ublast_ftd2xx_init(struct ublast_lowlevel *low) } status = FT_GetLatencyTimer(*ftdih, &latency_timer); - if (status != FT_OK) { + if (status != FT_OK) LOG_ERROR("unable to get latency timer: %s", ftd2xx_status_string(status)); - return ERROR_JTAG_INIT_FAILED; - } - LOG_DEBUG("current latency timer: %i", latency_timer); + else + LOG_DEBUG("current latency timer: %i", latency_timer); status = FT_SetBitMode(*ftdih, 0x00, 0); if (status != FT_OK) { diff --git a/src/jtag/drivers/usb_blaster/ublast_access_ftdi.c b/src/jtag/drivers/usb_blaster/ublast_access_ftdi.c index 23893e14..2527fe9a 100644 --- a/src/jtag/drivers/usb_blaster/ublast_access_ftdi.c +++ b/src/jtag/drivers/usb_blaster/ublast_access_ftdi.c @@ -99,11 +99,10 @@ static int ublast_ftdi_init(struct ublast_lowlevel *low) return ERROR_JTAG_INIT_FAILED; } - if (ftdi_get_latency_timer(ftdic, &latency_timer) < 0) { + if (ftdi_get_latency_timer(ftdic, &latency_timer) < 0) LOG_ERROR("unable to get latency timer"); - return ERROR_JTAG_INIT_FAILED; - } - LOG_DEBUG("current latency timer: %u", latency_timer); + else + LOG_DEBUG("current latency timer: %u", latency_timer); ftdi_disable_bitbang(ftdic); return ERROR_OK; -- 2.39.5