+// SPDX-License-Identifier: GPL-2.0-or-later
+
/***************************************************************************
* Copyright (C) 2013 by Andes Technology *
* Hsiangkai Wang <hkwang@andestech.com> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
if (cmd_ack_code != AICE_CMD_SCAN_CHAIN) {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_SCAN_CHAIN, cmd_ack_code);
return ERROR_FAIL;
}
LOG_DEBUG("READ_CTRL response, data: 0x%" PRIx32, *data);
if (cmd_ack_code != AICE_CMD_READ_CTRL) {
- LOG_ERROR("aice command error (command=0x%" PRIx32 ", response=0x%" PRIx8 ")",
- (uint32_t)AICE_CMD_READ_CTRL, cmd_ack_code);
+ LOG_ERROR("aice command error (command=0x%x, response=0x%" PRIx8 ")",
+ AICE_CMD_READ_CTRL, cmd_ack_code);
return ERROR_FAIL;
}
LOG_DEBUG("WRITE_CTRL response");
if (cmd_ack_code != AICE_CMD_WRITE_CTRL) {
- LOG_ERROR("aice command error (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command error (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_WRITE_CTRL, cmd_ack_code);
return ERROR_FAIL;
}
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_READ_DTR, cmd_ack_code);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_READ_DTR_TO_BUFFER, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_DTR, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_WRITE_DTR_FROM_BUFFER, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MISC, cmd_ack_code);
return ERROR_FAIL;
}
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MISC, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_READ_EDMSR, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_EDMSR, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8
- ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_DIM, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_EXECUTE, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MEM_B, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MEM_H, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_WRITE_MEM, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_FASTREAD_MEM, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_FASTWRITE_MEM, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MEM_B, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MEM_H, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_T_READ_MEM, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_BATCH_BUFFER_READ, cmd_ack_code);
return ERROR_FAIL;
break;
} else {
if (retry_times > aice_max_retry_times) {
- LOG_ERROR("aice command timeout (command=0x%" PRIx8 ", response=0x%" PRIx8 ")",
+ LOG_ERROR("aice command timeout (command=0x%x, response=0x%" PRIx8 ")",
AICE_CMD_BATCH_BUFFER_WRITE, cmd_ack_code);
return ERROR_FAIL;
const uint16_t pids[] = { param->pid, 0 };
struct libusb_device_handle *devh;
- if (jtag_libusb_open(vids, pids, NULL, &devh, NULL) != ERROR_OK)
+ if (jtag_libusb_open(vids, pids, &devh, NULL) != ERROR_OK)
return ERROR_FAIL;
/* BE ***VERY CAREFUL*** ABOUT MAKING CHANGES IN THIS
/* reopen jlink after usb_reset
* on win32 this may take a second or two to re-enumerate */
int retval;
- while ((retval = jtag_libusb_open(vids, pids, NULL, &devh, NULL)) != ERROR_OK) {
+ while ((retval = jtag_libusb_open(vids, pids, &devh, NULL)) != ERROR_OK) {
usleep(1000);
timeout--;
if (!timeout)