retval = allow_transports(CMD_CTX, (const char **)transports);
if (retval != ERROR_OK) {
- for (unsigned i = 0; transports[i]; i++)
+ for (unsigned int i = 0; transports[i]; i++)
free(transports[i]);
free(transports);
}
return ERROR_COMMAND_SYNTAX_ERROR;
command_print(CMD, "The following debug adapters are available:");
- for (unsigned i = 0; adapter_drivers[i]; i++) {
+ for (unsigned int i = 0; adapter_drivers[i]; i++) {
const char *name = adapter_drivers[i]->name;
command_print(CMD, "%u: %s", i + 1, name);
}
if (CMD_ARGC != 1 || CMD_ARGV[0][0] == '\0')
return ERROR_COMMAND_SYNTAX_ERROR;
- for (unsigned i = 0; adapter_drivers[i]; i++) {
+ for (unsigned int i = 0; adapter_drivers[i]; i++) {
if (strcmp(CMD_ARGV[0], adapter_drivers[i]->name) != 0)
continue;
if (CMD_ARGC > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (CMD_ARGC == 1) {
- unsigned delay;
+ unsigned int delay;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
jtag_set_nsrst_delay(delay);
if (CMD_ARGC > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (CMD_ARGC == 1) {
- unsigned width;
+ unsigned int width;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], width);
jtag_set_nsrst_assert_width(width);
int retval = ERROR_OK;
if (CMD_ARGC == 1) {
- unsigned khz = 0;
+ unsigned int khz = 0;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], khz);
retval = adapter_config_khz(khz);
}
/* returns a pointer to the n-th device in the scan chain */
-struct jtag_tap *jtag_tap_by_position(unsigned n)
+struct jtag_tap *jtag_tap_by_position(unsigned int n)
{
struct jtag_tap *t = jtag_all_taps();
}
/* no tap found by name, so try to parse the name as a number */
- unsigned n;
+ unsigned int n;
if (parse_uint(s, &n) != ERROR_OK)
return NULL;
*/
static int bitbang_execute_tms(struct jtag_command *cmd)
{
- unsigned num_bits = cmd->cmd.tms->num_bits;
+ unsigned int num_bits = cmd->cmd.tms->num_bits;
const uint8_t *bits = cmd->cmd.tms->bits;
LOG_DEBUG_IO("TMS: %u bits", num_bits);
int tms = 0;
- for (unsigned i = 0; i < num_bits; i++) {
+ for (unsigned int i = 0; i < num_bits; i++) {
tms = ((bits[i/8] >> (i % 8)) & 1);
if (bitbang_interface->write(0, tms, 0) != ERROR_OK)
return ERROR_FAIL;
}
static int bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer,
- unsigned scan_size)
+ unsigned int scan_size)
{
tap_state_t saved_end_state = tap_get_end_state();
- unsigned bit_cnt;
+ unsigned int bit_cnt;
if (!((!ir_scan &&
(tap_get_state() == TAP_DRSHIFT)) ||
if (type != SCAN_OUT && bitbang_interface->buf_size &&
(buffered == bitbang_interface->buf_size ||
bit_cnt == scan_size - 1)) {
- for (unsigned i = bit_cnt + 1 - buffered; i <= bit_cnt; i++) {
+ for (unsigned int i = bit_cnt + 1 - buffered; i <= bit_cnt; i++) {
switch (bitbang_interface->read_sample()) {
case BB_LOW:
buffer[i/8] &= ~(1 << (i % 8));
{
uint8_t *command = cmsis_dap_handle->command;
- for (unsigned i = 0; i < CMD_ARGC; i++)
+ for (unsigned int i = 0; i < CMD_ARGC; i++)
COMMAND_PARSE_NUMBER(u8, CMD_ARGV[i], command[i]);
int retval = cmsis_dap_xfer(cmsis_dap_handle, CMD_ARGC);
CMD_ARGC -= 1;
}
- unsigned i;
+ unsigned int i;
for (i = 0; i < CMD_ARGC; i += 2) {
COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i], cmsis_dap_vid[i >> 1]);
COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i + 1], cmsis_dap_pid[i >> 1]);
return ERROR_OK;
}
-int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
+int interface_add_tms_seq(unsigned int num_bits, const uint8_t *seq, enum tap_state state)
{
struct jtag_command *cmd;
*/
static void ft232r_write(int tck, int tms, int tdi)
{
- unsigned out_value = (1<<ntrst_gpio) | (1<<nsysrst_gpio);
+ unsigned int out_value = (1 << ntrst_gpio) | (1 << nsysrst_gpio);
if (tck)
out_value |= (1<<tck_gpio);
if (tms)
*/
static void ft232r_reset(int trst, int srst)
{
- unsigned out_value = (1<<ntrst_gpio) | (1<<nsysrst_gpio);
+ unsigned int out_value = (1 << ntrst_gpio) | (1 << nsysrst_gpio);
LOG_DEBUG("ft232r_reset(%d,%d)", trst, srst);
if (trst == 1)
}
/* Exactly 500 nsec between updates. */
- unsigned divisor = 1;
+ unsigned int divisor = 1;
unsigned char latency_timer = 1;
/* Frequency divisor is 14-bit non-zero value. */
*/
static int syncbb_execute_tms(struct jtag_command *cmd)
{
- unsigned num_bits = cmd->cmd.tms->num_bits;
+ unsigned int num_bits = cmd->cmd.tms->num_bits;
const uint8_t *bits = cmd->cmd.tms->bits;
LOG_DEBUG_IO("TMS: %u bits", num_bits);
int tms = 0;
- for (unsigned i = 0; i < num_bits; i++) {
+ for (unsigned int i = 0; i < num_bits; i++) {
tms = ((bits[i/8] >> (i % 8)) & 1);
ft232r_write(0, tms, 0);
ft232r_write(1, tms, 0);
unsigned int i = cmd->cmd.runtest->num_cycles;
while (i > 0) {
/* there are no state transitions in this code, so omit state tracking */
- unsigned this_len = i > 7 ? 7 : i;
+ unsigned int this_len = i > 7 ? 7 : i;
mpsse_clock_tms_cs_out(mpsse_ctx, &zero, 0, this_len, false, ftdi_jtag_mode);
i -= this_len;
}
tap_state_name(path[num_states-1]));
int state_count = 0;
- unsigned bit_count = 0;
+ unsigned int bit_count = 0;
uint8_t tms_byte = 0;
LOG_DEBUG_IO("-");
ftdi_end_state(cmd->cmd.scan->end_state);
struct scan_field *field = cmd->cmd.scan->fields;
- unsigned scan_size = 0;
+ unsigned int scan_size = 0;
for (unsigned int i = 0; i < cmd->cmd.scan->num_fields; i++, field++) {
scan_size += field->num_bits;
* the correct level and remain there during the scan */
while (num_cycles > 0) {
/* there are no state transitions in this code, so omit state tracking */
- unsigned this_len = num_cycles > 7 ? 7 : num_cycles;
+ unsigned int this_len = num_cycles > 7 ? 7 : num_cycles;
mpsse_clock_tms_cs_out(mpsse_ctx, &tms, 0, this_len, false, ftdi_jtag_mode);
num_cycles -= this_len;
}
uint16_t input_mask = 0;
bool invert_oe = false;
uint16_t oe_mask = 0;
- for (unsigned i = 1; i < CMD_ARGC; i += 2) {
+ for (unsigned int i = 1; i < CMD_ARGC; i += 2) {
if (strcmp("-data", CMD_ARGV[i]) == 0) {
invert_data = false;
COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i + 1], data_mask);
CMD_ARGC -= 1;
}
- unsigned i;
+ unsigned int i;
for (i = 0; i < CMD_ARGC; i += 2) {
COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i], ftdi_vid[i >> 1]);
COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i + 1], ftdi_pid[i >> 1]);
* @param in_offset A bit offset for TDO data.
* @param length Amount of bits to transfer out and in.
*/
-static void jlink_clock_data(const uint8_t *out, unsigned out_offset,
- const uint8_t *tms_out, unsigned tms_offset,
- uint8_t *in, unsigned in_offset,
- unsigned length);
+static void jlink_clock_data(const uint8_t *out, unsigned int out_offset,
+ const uint8_t *tms_out, unsigned int tms_offset,
+ uint8_t *in, unsigned int in_offset,
+ unsigned int length);
static enum tap_state jlink_last_state = TAP_RESET;
static int queued_retval;
jlink_end_state(cmd->cmd.scan->end_state);
struct scan_field *field = cmd->cmd.scan->fields;
- unsigned scan_size = 0;
+ unsigned int scan_size = 0;
for (unsigned int i = 0; i < cmd->cmd.scan->num_fields; i++, field++) {
scan_size += field->num_bits;
/***************************************************************************/
/* J-Link tap functions */
-static unsigned tap_length;
+static unsigned int tap_length;
/* In SWD mode use tms buffer for direction control */
static uint8_t tms_buffer[JLINK_TAP_BUFFER_SIZE];
static uint8_t tdi_buffer[JLINK_TAP_BUFFER_SIZE];
struct pending_scan_result {
/** First bit position in tdo_buffer to read. */
- unsigned first;
+ unsigned int first;
/** Number of bits to read. */
- unsigned length;
+ unsigned int length;
/** Location to store the result */
void *buffer;
/** Offset in the destination buffer */
- unsigned buffer_offset;
+ unsigned int buffer_offset;
/** SWD command */
uint8_t swd_cmd;
};
memset(tdi_buffer, 0, sizeof(tdi_buffer));
}
-static void jlink_clock_data(const uint8_t *out, unsigned out_offset,
- const uint8_t *tms_out, unsigned tms_offset,
- uint8_t *in, unsigned in_offset,
- unsigned length)
+static void jlink_clock_data(const uint8_t *out, unsigned int out_offset,
+ const uint8_t *tms_out, unsigned int tms_offset,
+ uint8_t *in, unsigned int in_offset,
+ unsigned int length)
{
do {
- unsigned available_length = JLINK_TAP_BUFFER_SIZE - tap_length / 8;
+ unsigned int available_length = JLINK_TAP_BUFFER_SIZE - tap_length / 8;
if (!available_length ||
(in && pending_scan_results_length == MAX_PENDING_SCAN_RESULTS)) {
struct pending_scan_result *pending_scan_result =
&pending_scan_results_buffer[pending_scan_results_length];
- unsigned scan_length = length > available_length ?
+ unsigned int scan_length = length > available_length ?
available_length : length;
if (out)
static int jtag_vpi_receive_cmd(struct vpi_cmd *vpi)
{
- unsigned bytes_buffered = 0;
+ unsigned int bytes_buffered = 0;
while (bytes_buffered < sizeof(struct vpi_cmd)) {
int bytes_to_receive = sizeof(struct vpi_cmd) - bytes_buffered;
int retval = read_socket(sockfd, ((char *)vpi) + bytes_buffered, bytes_to_receive);
bool jtag_libusb_match_ids(struct libusb_device_descriptor *dev_desc,
const uint16_t vids[], const uint16_t pids[])
{
- for (unsigned i = 0; vids[i]; i++) {
+ for (unsigned int i = 0; vids[i]; i++) {
if (dev_desc->idVendor == vids[i] &&
dev_desc->idProduct == pids[i]) {
return true;
static inline void interface_jtag_add_scan_check_alloc(struct scan_field *field)
{
- unsigned num_bytes = DIV_ROUND_UP(field->num_bits, 8);
+ unsigned int num_bytes = DIV_ROUND_UP(field->num_bits, 8);
field->in_value = cmd_queue_alloc(num_bytes);
}
uint8_t interface;
enum ftdi_chip_type type;
uint8_t *write_buffer;
- unsigned write_size;
- unsigned write_count;
+ unsigned int write_size;
+ unsigned int write_count;
uint8_t *read_buffer;
- unsigned read_size;
- unsigned read_count;
+ unsigned int read_size;
+ unsigned int read_count;
uint8_t *read_chunk;
- unsigned read_chunk_size;
+ unsigned int read_chunk_size;
struct bit_copy_queue read_queue;
int retval;
};
}
}
-static unsigned buffer_write_space(struct mpsse_ctx *ctx)
+static unsigned int buffer_write_space(struct mpsse_ctx *ctx)
{
/* Reserve one byte for SEND_IMMEDIATE */
return ctx->write_size - ctx->write_count - 1;
}
-static unsigned buffer_read_space(struct mpsse_ctx *ctx)
+static unsigned int buffer_read_space(struct mpsse_ctx *ctx)
{
return ctx->read_size - ctx->read_count;
}
ctx->write_buffer[ctx->write_count++] = data;
}
-static unsigned buffer_write(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
- unsigned bit_count)
+static unsigned int buffer_write(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset,
+ unsigned int bit_count)
{
LOG_DEBUG_IO("%d bits", bit_count);
assert(ctx->write_count + DIV_ROUND_UP(bit_count, 8) <= ctx->write_size);
return bit_count;
}
-static unsigned buffer_add_read(struct mpsse_ctx *ctx, uint8_t *in, unsigned in_offset,
- unsigned bit_count, unsigned offset)
+static unsigned int buffer_add_read(struct mpsse_ctx *ctx, uint8_t *in, unsigned int in_offset,
+ unsigned int bit_count, unsigned int offset)
{
LOG_DEBUG_IO("%d bits, offset %d", bit_count, offset);
assert(ctx->read_count + DIV_ROUND_UP(bit_count, 8) <= ctx->read_size);
return bit_count;
}
-void mpsse_clock_data_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
- unsigned length, uint8_t mode)
+void mpsse_clock_data_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset,
+ unsigned int length, uint8_t mode)
{
mpsse_clock_data(ctx, out, out_offset, NULL, 0, length, mode);
}
-void mpsse_clock_data_in(struct mpsse_ctx *ctx, uint8_t *in, unsigned in_offset, unsigned length,
+void mpsse_clock_data_in(struct mpsse_ctx *ctx, uint8_t *in, unsigned int in_offset, unsigned int length,
uint8_t mode)
{
mpsse_clock_data(ctx, NULL, 0, in, in_offset, length, mode);
}
-void mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in,
- unsigned in_offset, unsigned length, uint8_t mode)
+void mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset, uint8_t *in,
+ unsigned int in_offset, unsigned int length, uint8_t mode)
{
/* TODO: Fix MSB first modes */
LOG_DEBUG_IO("%s%s %d bits", in ? "in" : "", out ? "out" : "", length);
length = 0;
} else {
/* Byte transfer */
- unsigned this_bytes = length / 8;
+ unsigned int this_bytes = length / 8;
/* MPSSE command limit */
if (this_bytes > 65536)
this_bytes = 65536;
this_bytes * 8,
0);
if (!out && !in)
- for (unsigned n = 0; n < this_bytes; n++)
+ for (unsigned int n = 0; n < this_bytes; n++)
buffer_write_byte(ctx, 0x00);
length -= this_bytes * 8;
}
}
}
-void mpsse_clock_tms_cs_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
- unsigned length, bool tdi, uint8_t mode)
+void mpsse_clock_tms_cs_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset,
+ unsigned int length, bool tdi, uint8_t mode)
{
mpsse_clock_tms_cs(ctx, out, out_offset, NULL, 0, length, tdi, mode);
}
-void mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in,
- unsigned in_offset, unsigned length, bool tdi, uint8_t mode)
+void mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset, uint8_t *in,
+ unsigned int in_offset, unsigned int length, bool tdi, uint8_t mode)
{
LOG_DEBUG_IO("%sout %d bits, tdi=%d", in ? "in" : "", length, tdi);
assert(out);
ctx->retval = mpsse_flush(ctx);
/* Byte transfer */
- unsigned this_bits = length;
+ unsigned int this_bits = length;
/* MPSSE command limit */
/* NOTE: there's a report of an FT2232 bug in this area, where shifting
* exactly 7 bits can make problems with TMS signaling for the last
struct transfer_result {
struct mpsse_ctx *ctx;
bool done;
- unsigned transferred;
+ unsigned int transferred;
};
static LIBUSB_CALL void read_cb(struct libusb_transfer *transfer)
struct transfer_result *res = transfer->user_data;
struct mpsse_ctx *ctx = res->ctx;
- unsigned packet_size = ctx->max_packet_size;
+ unsigned int packet_size = ctx->max_packet_size;
DEBUG_PRINT_BUF(transfer->buffer, transfer->actual_length);
/* Strip the two status bytes sent at the beginning of each USB packet
* while copying the chunk buffer to the read buffer */
- unsigned num_packets = DIV_ROUND_UP(transfer->actual_length, packet_size);
- unsigned chunk_remains = transfer->actual_length;
- for (unsigned i = 0; i < num_packets && chunk_remains > 2; i++) {
- unsigned this_size = packet_size - 2;
+ unsigned int num_packets = DIV_ROUND_UP(transfer->actual_length, packet_size);
+ unsigned int chunk_remains = transfer->actual_length;
+ for (unsigned int i = 0; i < num_packets && chunk_remains > 2; i++) {
+ unsigned int this_size = packet_size - 2;
if (this_size > chunk_remains - 2)
this_size = chunk_remains - 2;
if (this_size > ctx->read_count - res->transferred)
/* Command queuing. These correspond to the MPSSE commands with the same names, but no need to care
* about bit/byte transfer or data length limitation. Read data is guaranteed to be available only
* after the following mpsse_flush(). */
-void mpsse_clock_data_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
- unsigned length, uint8_t mode);
-void mpsse_clock_data_in(struct mpsse_ctx *ctx, uint8_t *in, unsigned in_offset, unsigned length,
+void mpsse_clock_data_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset,
+ unsigned int length, uint8_t mode);
+void mpsse_clock_data_in(struct mpsse_ctx *ctx, uint8_t *in, unsigned int in_offset, unsigned int length,
uint8_t mode);
-void mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in,
- unsigned in_offset, unsigned length, uint8_t mode);
-void mpsse_clock_tms_cs_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
- unsigned length, bool tdi, uint8_t mode);
-void mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in,
- unsigned in_offset, unsigned length, bool tdi, uint8_t mode);
+void mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset, uint8_t *in,
+ unsigned int in_offset, unsigned int length, uint8_t mode);
+void mpsse_clock_tms_cs_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset,
+ unsigned int length, bool tdi, uint8_t mode);
+void mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, unsigned int out_offset, uint8_t *in,
+ unsigned int in_offset, unsigned int length, bool tdi, uint8_t mode);
void mpsse_set_data_bits_low_byte(struct mpsse_ctx *ctx, uint8_t data, uint8_t dir);
void mpsse_set_data_bits_high_byte(struct mpsse_ctx *ctx, uint8_t data, uint8_t dir);
void mpsse_read_data_bits_low_byte(struct mpsse_ctx *ctx, uint8_t *data);
h->st_mode = mode;
- for (unsigned i = 0; param->vid[i]; i++) {
+ for (unsigned int i = 0; param->vid[i]; i++) {
LOG_DEBUG("transport: %d vid: 0x%04x pid: 0x%04x serial: %s",
h->st_mode, param->vid[i], param->pid[i],
adapter_get_required_serial() ? adapter_get_required_serial() : "");
#define SECTION_BUFFERSIZE 16384
static int ublast2_libusb_read(struct ublast_lowlevel *low, uint8_t *buf,
- unsigned size, uint32_t *bytes_read)
+ unsigned int size, uint32_t *bytes_read)
{
int ret, tmp = 0;
int (*write)(struct ublast_lowlevel *low, uint8_t *buf, int size,
uint32_t *bytes_written);
- int (*read)(struct ublast_lowlevel *low, uint8_t *buf, unsigned size,
+ int (*read)(struct ublast_lowlevel *low, uint8_t *buf, unsigned int size,
uint32_t *bytes_read);
int (*open)(struct ublast_lowlevel *low);
int (*close)(struct ublast_lowlevel *low);
}
static int ublast_ftdi_read(struct ublast_lowlevel *low, uint8_t *buf,
- unsigned size, uint32_t *bytes_read)
+ unsigned int size, uint32_t *bytes_read)
{
int retval;
int timeout = 100;
return str;
}
-static int ublast_buf_read(uint8_t *buf, unsigned size, uint32_t *bytes_read)
+static int ublast_buf_read(uint8_t *buf, unsigned int size, uint32_t *bytes_read)
{
int ret = info.drv->read(info.drv, buf, size, bytes_read);
char *str = hexdump(buf, *bytes_read);
struct xlnx_pcie_xvc {
int fd;
- unsigned offset;
+ unsigned int offset;
char *device;
};
const char *tap_state_name(tap_state_t state)
{
- unsigned i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(tap_name_mapping); i++) {
if (tap_name_mapping[i].symbol == state)
tap_state_t tap_state_by_name(const char *name)
{
- unsigned i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(tap_name_mapping); i++) {
/* be nice to the human */
{
const uint8_t *tms_buffer;
const uint8_t *tdi_buffer;
- unsigned tap_bytes;
- unsigned cur_byte;
- unsigned cur_bit;
+ unsigned int tap_bytes;
+ unsigned int cur_byte;
+ unsigned int cur_bit;
- unsigned tap_out_bits;
+ unsigned int tap_out_bits;
char tms_str[33];
char tdi_str[33];
for (cur_byte = 0; cur_byte < tap_bytes; cur_byte++) {
for (cur_bit = 0; cur_bit < 8; cur_bit++) {
/* make sure we do not run off the end of the buffers */
- unsigned tap_bit = cur_byte * 8 + cur_bit;
+ unsigned int tap_bit = cur_byte * 8 + cur_bit;
if (tap_bit == tap_bits)
break;
* @returns the final TAP state; pass as @a start_tap_state in following call.
*/
static inline tap_state_t jtag_debug_state_machine(const void *tms_buf,
- const void *tdi_buf, unsigned tap_len, tap_state_t start_tap_state)
+ const void *tdi_buf, unsigned int tap_len, tap_state_t start_tap_state)
{
if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO))
return jtag_debug_state_machine_(tms_buf, tdi_buf, tap_len, start_tap_state);
/**
* Bit vector listing capabilities exposed by this driver.
*/
- unsigned supported;
+ unsigned int supported;
#define DEBUG_CAP_TMS_SEQ (1 << 0)
/**
int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path);
int interface_jtag_add_runtest(unsigned int num_cycles, tap_state_t endstate);
-int interface_add_tms_seq(unsigned num_bits,
+int interface_add_tms_seq(unsigned int num_bits,
const uint8_t *bits, enum tap_state state);
/**
/* At least 2 idle (low) cycles */
0x00,
};
-static const unsigned swd_seq_line_reset_len = 64;
+static const unsigned int swd_seq_line_reset_len = 64;
/**
* JTAG-to-SWD sequence.
/* At least 2 idle (low) cycles */
0x00,
};
-static const unsigned swd_seq_jtag_to_swd_len = 136;
+static const unsigned int swd_seq_jtag_to_swd_len = 136;
/**
* SWD-to-JTAG sequence.
/* At least 5 TCK/SWCLK cycles with TMS/SWDIO high */
0xff,
};
-static const unsigned swd_seq_swd_to_jtag_len = 80;
+static const unsigned int swd_seq_swd_to_jtag_len = 80;
/**
* SWD-to-dormant sequence.
/* Switching sequence from SWD to dormant */
0xbc, 0xe3,
};
-static const unsigned swd_seq_swd_to_dormant_len = 72;
+static const unsigned int swd_seq_swd_to_dormant_len = 72;
/**
* Dormant-to-SWD sequence.
/* At least 2 idle (low) cycles */
0x00,
};
-static const unsigned swd_seq_dormant_to_swd_len = 224;
+static const unsigned int swd_seq_dormant_to_swd_len = 224;
/**
* JTAG-to-dormant sequence.
0x77, /* ((0xbb >> 7) & GENMASK(0, 0)) | ((0xbb << 1) & GENMASK(7, 1)) */
0x67, /* ((0xbb >> 7) & GENMASK(0, 0)) | ((0x33 << 1) & GENMASK(7, 1)) */
};
-static const unsigned swd_seq_jtag_to_dormant_len = 40;
+static const unsigned int swd_seq_jtag_to_dormant_len = 40;
/**
* Dormant-to-JTAG sequence.
/* put the TAP in Run/Test Idle */
0x00,
};
-static const unsigned swd_seq_dormant_to_jtag_len = 160;
+static const unsigned int swd_seq_dormant_to_jtag_len = 160;
struct swd_driver {
/**
if (CMD_ARGC > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (CMD_ARGC == 1) {
- unsigned delay;
+ unsigned int delay;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
jtag_set_ntrst_delay(delay);
if (CMD_ARGC > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (CMD_ARGC == 1) {
- unsigned delay;
+ unsigned int delay;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], delay);
jtag_set_ntrst_assert_width(delay);
int retval = ERROR_OK;
if (CMD_ARGC == 1) {
- unsigned khz = 0;
+ unsigned int khz = 0;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], khz);
retval = adapter_config_rclk(khz);
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
- unsigned num_clocks;
+ unsigned int num_clocks;
COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num_clocks);
jtag_add_runtest(num_clocks, TAP_IDLE);