OpenOCD
amt_jtagaccel.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2005 by Dominic Rath *
5  * Dominic.Rath@gmx.de *
6  ***************************************************************************/
7 
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11 
12 #include <jtag/adapter.h>
13 #include <jtag/interface.h>
14 
15 #if PARPORT_USE_PPDEV == 1
16 #include <linux/parport.h>
17 #include <linux/ppdev.h>
18 #include <sys/ioctl.h>
19 #else /* not PARPORT_USE_PPDEV */
20 #ifndef _WIN32
21 #include <sys/io.h>
22 #endif
23 #endif
24 
25 #if PARPORT_USE_GIVEIO == 1
26 #if IS_CYGWIN == 1
27 #include <windows.h>
28 #endif
29 #endif
30 
40 /* configuration */
41 static uint16_t amt_jtagaccel_port;
42 
43 /* interface variables
44  */
45 static uint8_t aw_control_rst;
46 static uint8_t aw_control_fsm = 0x10;
47 static uint8_t aw_control_baudrate = 0x20;
48 
49 static int rtck_enabled;
50 
51 #if PARPORT_USE_PPDEV == 1
52 static int device_handle;
53 
54 static const int addr_mode = IEEE1284_MODE_EPP | IEEE1284_ADDR;
55 
56 /* FIXME do something sane when these ioctl/read/write calls fail. */
57 
58 #define AMT_AW(val) \
59  do { \
60  int __retval; \
61  \
62  __retval = ioctl(device_handle, PPSETMODE, &addr_mode); \
63  assert(__retval >= 0); \
64  __retval = write(device_handle, &val, 1); \
65  assert(__retval >= 0); \
66  } while (0)
67 #define AMT_AR(val) \
68  do { \
69  int __retval; \
70  \
71  __retval = ioctl(device_handle, PPSETMODE, &addr_mode); \
72  assert(__retval >= 0); \
73  __retval = read(device_handle, &val, 1); \
74  assert(__retval >= 0); \
75  } while (0)
76 
77 static const int data_mode = IEEE1284_MODE_EPP | IEEE1284_DATA;
78 
79 #define AMT_DW(val) \
80  do { \
81  int __retval; \
82  \
83  __retval = ioctl(device_handle, PPSETMODE, &data_mode); \
84  assert(__retval >= 0); \
85  __retval = write(device_handle, &val, 1); \
86  assert(__retval >= 0); \
87  } while (0)
88 #define AMT_DR(val) \
89  do { \
90  int __retval; \
91  \
92  __retval = ioctl(device_handle, PPSETMODE, &data_mode); \
93  assert(__retval >= 0); \
94  __retval = read(device_handle, &val, 1); \
95  assert(__retval >= 0); \
96  } while (0)
97 
98 #else
99 
100 #define AMT_AW(val) do { outb(val, amt_jtagaccel_port + 3); } while (0)
101 #define AMT_AR(val) do { val = inb(amt_jtagaccel_port + 3); } while (0)
102 #define AMT_DW(val) do { outb(val, amt_jtagaccel_port + 4); } while (0)
103 #define AMT_DR(val) do { val = inb(amt_jtagaccel_port + 4); } while (0)
104 
105 #endif /* PARPORT_USE_PPDEV */
106 
107 /* tap_move[i][j]: tap movement command to go from state i to state j
108  * 0: Test-Logic-Reset
109  * 1: Run-Test/Idle
110  * 2: Shift-DR
111  * 3: Pause-DR
112  * 4: Shift-IR
113  * 5: Pause-IR
114  */
115 static const uint8_t amt_jtagaccel_tap_move[6][6][2] = {
116  /* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */
117  { {0x1f, 0x00}, {0x0f, 0x00}, {0x05, 0x00}, {0x0a, 0x00}, {0x06, 0x00}, {0x96, 0x00} }, /* RESET */
118  { {0x1f, 0x00}, {0x00, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x0b, 0x00} }, /* IDLE */
119  { {0x1f, 0x00}, {0x0d, 0x00}, {0x00, 0x00}, {0x01, 0x00}, {0x8f, 0x09}, {0x8f, 0x01} }, /* DRSHIFT */
120  { {0x1f, 0x00}, {0x0c, 0x00}, {0x08, 0x00}, {0x00, 0x00}, {0x8f, 0x09}, {0x8f, 0x01} }, /* DRPAUSE */
121  { {0x1f, 0x00}, {0x0d, 0x00}, {0x07, 0x00}, {0x97, 0x00}, {0x00, 0x00}, {0x01, 0x00} }, /* IRSHIFT */
122  { {0x1f, 0x00}, {0x0c, 0x00}, {0x07, 0x00}, {0x97, 0x00}, {0x08, 0x00}, {0x00, 0x00} }, /* IRPAUSE */
123 };
124 
125 static void amt_jtagaccel_reset(int trst, int srst)
126 {
127  if (trst == 1)
128  aw_control_rst |= 0x4;
129  else if (trst == 0)
130  aw_control_rst &= ~0x4;
131 
132  if (srst == 1)
133  aw_control_rst |= 0x1;
134  else if (srst == 0)
135  aw_control_rst &= ~0x1;
136 
138 }
139 
140 static int amt_jtagaccel_speed(int speed)
141 {
142  aw_control_baudrate &= 0xf0;
143  aw_control_baudrate |= speed & 0x0f;
145 
146  return ERROR_OK;
147 }
148 
150 {
153  else {
154  LOG_ERROR("BUG: %i is not a valid end state", state);
155  exit(-1);
156  }
157 }
158 
159 static void amt_wait_scan_busy(void)
160 {
161  int timeout = 4096;
162  uint8_t ar_status;
163 
164  AMT_AR(ar_status);
165  while (((ar_status) & 0x80) && (timeout-- > 0))
166  AMT_AR(ar_status);
167 
168  if (ar_status & 0x80) {
169  LOG_ERROR(
170  "amt_jtagaccel timed out while waiting for end of scan, rtck was %s, last AR_STATUS: 0x%2.2x",
171  (rtck_enabled) ? "enabled" : "disabled",
172  ar_status);
173  exit(-1);
174  }
175 }
176 
177 static void amt_jtagaccel_state_move(void)
178 {
179  uint8_t aw_scan_tms_5;
180  uint8_t tms_scan[2];
181 
182  enum tap_state cur_state = tap_get_state();
183  enum tap_state end_state = tap_get_end_state();
184 
185  tms_scan[0] = amt_jtagaccel_tap_move[tap_move_ndx(cur_state)][tap_move_ndx(end_state)][0];
186  tms_scan[1] = amt_jtagaccel_tap_move[tap_move_ndx(cur_state)][tap_move_ndx(end_state)][1];
187 
188  aw_scan_tms_5 = 0x40 | (tms_scan[0] & 0x1f);
189  AMT_AW(aw_scan_tms_5);
190  int jtag_speed = 0;
191  int retval = adapter_get_speed(&jtag_speed);
192  assert(retval == ERROR_OK);
193  if (jtag_speed > 3 || rtck_enabled)
195 
196  if (tms_scan[0] & 0x80) {
197  aw_scan_tms_5 = 0x40 | (tms_scan[1] & 0x1f);
198  AMT_AW(aw_scan_tms_5);
199  if (jtag_speed > 3 || rtck_enabled)
201  }
202 
203  tap_set_state(end_state);
204 }
205 
206 static void amt_jtagaccel_runtest(unsigned int num_cycles)
207 {
208  int i = 0;
209  uint8_t aw_scan_tms_5;
210  uint8_t aw_scan_tms_1to4;
211 
212  enum tap_state saved_end_state = tap_get_end_state();
213 
214  /* only do a state_move when we're not already in IDLE */
215  if (tap_get_state() != TAP_IDLE) {
218  }
219 
220  while (num_cycles - i >= 5) {
221  aw_scan_tms_5 = 0x40;
222  AMT_AW(aw_scan_tms_5);
223  i += 5;
224  }
225 
226  if (num_cycles - i > 0) {
227  aw_scan_tms_1to4 = 0x80 | ((num_cycles - i - 1) & 0x3) << 4;
228  AMT_AW(aw_scan_tms_1to4);
229  }
230 
231  amt_jtagaccel_end_state(saved_end_state);
232  if (tap_get_state() != tap_get_end_state())
234 }
235 
236 static void amt_jtagaccel_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
237 {
238  int bits_left = scan_size;
239  int bit_count = 0;
240  enum tap_state saved_end_state = tap_get_end_state();
241  uint8_t aw_tdi_option;
242  uint8_t dw_tdi_scan;
243  uint8_t dr_tdo;
244  uint8_t aw_tms_scan;
245  uint8_t tms_scan[2];
246  int jtag_speed_var;
247  int retval = adapter_get_speed(&jtag_speed_var);
248  assert(retval == ERROR_OK);
249 
250  if (ir_scan)
252  else
254 
255  /* Only move if we're not already there */
256  if (tap_get_state() != tap_get_end_state())
258 
259  amt_jtagaccel_end_state(saved_end_state);
260 
261  /* handle unaligned bits at the beginning */
262  if ((scan_size - 1) % 8) {
263  aw_tdi_option = 0x30 | (((scan_size - 1) % 8) - 1);
264  AMT_AW(aw_tdi_option);
265 
266  dw_tdi_scan = buf_get_u32(buffer, bit_count, (scan_size - 1) % 8) & 0xff;
267  AMT_DW(dw_tdi_scan);
268  if (jtag_speed_var > 3 || rtck_enabled)
270 
271  if ((type == SCAN_IN) || (type == SCAN_IO)) {
272  AMT_DR(dr_tdo);
273  dr_tdo = dr_tdo >> (8 - ((scan_size - 1) % 8));
274  buf_set_u32(buffer, bit_count, (scan_size - 1) % 8, dr_tdo);
275  }
276 
277  bit_count += (scan_size - 1) % 8;
278  bits_left -= (scan_size - 1) % 8;
279  }
280 
281  while (bits_left - 1 >= 8) {
282  dw_tdi_scan = buf_get_u32(buffer, bit_count, 8) & 0xff;
283  AMT_DW(dw_tdi_scan);
284  if (jtag_speed_var > 3 || rtck_enabled)
286 
287  if ((type == SCAN_IN) || (type == SCAN_IO)) {
288  AMT_DR(dr_tdo);
289  buf_set_u32(buffer, bit_count, 8, dr_tdo);
290  }
291 
292  bit_count += 8;
293  bits_left -= 8;
294  }
295 
296  tms_scan[0] =
298  tms_scan[1] =
300  aw_tms_scan = 0x40 | (tms_scan[0] & 0x1f) | (buf_get_u32(buffer, bit_count, 1) << 5);
301  AMT_AW(aw_tms_scan);
302  if (jtag_speed_var > 3 || rtck_enabled)
304 
305  if ((type == SCAN_IN) || (type == SCAN_IO)) {
306  AMT_DR(dr_tdo);
307  dr_tdo = dr_tdo >> 7;
308  buf_set_u32(buffer, bit_count, 1, dr_tdo);
309  }
310 
311  if (tms_scan[0] & 0x80) {
312  aw_tms_scan = 0x40 | (tms_scan[1] & 0x1f);
313  AMT_AW(aw_tms_scan);
314  if (jtag_speed_var > 3 || rtck_enabled)
316  }
318 }
319 
320 static int amt_jtagaccel_execute_queue(struct jtag_command *cmd_queue)
321 {
322  struct jtag_command *cmd = cmd_queue; /* currently processed command */
323  int scan_size;
324  enum scan_type type;
325  uint8_t *buffer;
326  int retval;
327 
328  /* return ERROR_OK, unless a jtag_read_buffer returns a failed check
329  * that wasn't handled by a caller-provided error handler
330  */
331  retval = ERROR_OK;
332 
333  while (cmd) {
334  switch (cmd->type) {
335  case JTAG_RESET:
336  LOG_DEBUG_IO("reset trst: %i srst %i",
337  cmd->cmd.reset->trst,
338  cmd->cmd.reset->srst);
339  if (cmd->cmd.reset->trst == 1)
341  amt_jtagaccel_reset(cmd->cmd.reset->trst, cmd->cmd.reset->srst);
342  break;
343  case JTAG_RUNTEST:
344  LOG_DEBUG_IO("runtest %i cycles, end in %i",
345  cmd->cmd.runtest->num_cycles,
346  cmd->cmd.runtest->end_state);
347  amt_jtagaccel_end_state(cmd->cmd.runtest->end_state);
348  amt_jtagaccel_runtest(cmd->cmd.runtest->num_cycles);
349  break;
350  case JTAG_TLR_RESET:
351  LOG_DEBUG_IO("statemove end in %i", cmd->cmd.statemove->end_state);
352  amt_jtagaccel_end_state(cmd->cmd.statemove->end_state);
354  break;
355  case JTAG_SCAN:
356  LOG_DEBUG_IO("scan end in %i", cmd->cmd.scan->end_state);
357  amt_jtagaccel_end_state(cmd->cmd.scan->end_state);
358  scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
359  type = jtag_scan_type(cmd->cmd.scan);
360  amt_jtagaccel_scan(cmd->cmd.scan->ir_scan, type, buffer, scan_size);
361  if (jtag_read_buffer(buffer, cmd->cmd.scan) != ERROR_OK)
362  retval = ERROR_JTAG_QUEUE_FAILED;
363  free(buffer);
364  break;
365  case JTAG_SLEEP:
366  LOG_DEBUG_IO("sleep %" PRIu32, cmd->cmd.sleep->us);
367  jtag_sleep(cmd->cmd.sleep->us);
368  break;
369  default:
370  LOG_ERROR("BUG: unknown JTAG command type encountered");
371  exit(-1);
372  }
373  cmd = cmd->next;
374  }
375 
376  return retval;
377 }
378 
379 #if PARPORT_USE_GIVEIO == 1
380 int amt_jtagaccel_get_giveio_access(void)
381 {
382  HANDLE h;
383  OSVERSIONINFO version;
384 
385  version.dwOSVersionInfoSize = sizeof(version);
386  if (!GetVersionEx(&version)) {
387  errno = EINVAL;
388  return -1;
389  }
390  if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
391  return 0;
392 
393  h = CreateFile("\\\\.\\giveio",
394  GENERIC_READ,
395  0,
396  NULL,
397  OPEN_EXISTING,
398  FILE_ATTRIBUTE_NORMAL,
399  NULL);
400  if (h == INVALID_HANDLE_VALUE) {
401  errno = ENODEV;
402  return -1;
403  }
404 
405  CloseHandle(h);
406 
407  return 0;
408 }
409 #endif
410 
411 static int amt_jtagaccel_init(void)
412 {
413 #if PARPORT_USE_PPDEV == 1
414  char buffer[256];
415  int i = 0;
416  uint8_t control_port;
417 #else
418  uint8_t status_port;
419 #endif
420  uint8_t ar_status;
421 
422  LOG_WARNING("This adapter is deprecated and support will be removed in the next release!");
423 
424 #if PARPORT_USE_PPDEV == 1
425  if (device_handle > 0) {
426  LOG_ERROR("device is already opened");
427  return ERROR_JTAG_INIT_FAILED;
428  }
429 
430  snprintf(buffer, 256, "/dev/parport%d", amt_jtagaccel_port);
431  device_handle = open(buffer, O_RDWR);
432 
433  if (device_handle < 0) {
434  LOG_ERROR(
435  "cannot open device. check it exists and that user read and write rights are set");
436  return ERROR_JTAG_INIT_FAILED;
437  }
438 
439  i = ioctl(device_handle, PPCLAIM);
440  if (i < 0) {
441  LOG_ERROR("cannot claim device");
442  return ERROR_JTAG_INIT_FAILED;
443  }
444 
445  i = IEEE1284_MODE_EPP;
446  i = ioctl(device_handle, PPSETMODE, &i);
447  if (i < 0) {
448  LOG_ERROR(" cannot set compatible mode to device");
449  return ERROR_JTAG_INIT_FAILED;
450  }
451 
452  control_port = 0x00;
453  i = ioctl(device_handle, PPWCONTROL, &control_port);
454 
455  control_port = 0x04;
456  i = ioctl(device_handle, PPWCONTROL, &control_port);
457 
458 #else
459  if (amt_jtagaccel_port == 0) {
460  amt_jtagaccel_port = 0x378;
461  LOG_WARNING("No parport port specified, using default '0x378' (LPT1)");
462  }
463 
464 #if PARPORT_USE_GIVEIO == 1
465  if (amt_jtagaccel_get_giveio_access() != 0) {
466 #else /* PARPORT_USE_GIVEIO */
467  if (ioperm(amt_jtagaccel_port, 5, 1) != 0) {
468 #endif /* PARPORT_USE_GIVEIO */
469  LOG_ERROR("missing privileges for direct i/o");
470  return ERROR_JTAG_INIT_FAILED;
471  }
472 
473  /* prepare epp port
474  * clear timeout */
475  status_port = inb(amt_jtagaccel_port + 1);
476  outb(status_port | 0x1, amt_jtagaccel_port + 1);
477 
478  /* reset epp port */
479  outb(0x00, amt_jtagaccel_port + 2);
480  outb(0x04, amt_jtagaccel_port + 2);
481 #endif
482 
483  if (rtck_enabled) {
484  /* set RTCK enable bit */
485  aw_control_fsm |= 0x02;
486  }
487 
488  /* enable JTAG port */
489  aw_control_fsm |= 0x04;
491 
494  aw_control_rst &= ~0x8;
495  else
496  aw_control_rst |= 0x8;
497 
499  aw_control_rst &= ~0x2;
500  else
501  aw_control_rst |= 0x2;
502 
503  amt_jtagaccel_reset(0, 0);
504 
505  /* read status register */
506  AMT_AR(ar_status);
507  LOG_DEBUG("AR_STATUS: 0x%2.2x", ar_status);
508 
509  return ERROR_OK;
510 }
511 
512 static int amt_jtagaccel_quit(void)
513 {
514 
515  return ERROR_OK;
516 }
517 
518 COMMAND_HANDLER(amt_jtagaccel_handle_parport_port_command)
519 {
520  if (CMD_ARGC == 1) {
521  /* only if the port wasn't overwritten by cmdline */
522  if (amt_jtagaccel_port == 0) {
523  uint16_t port;
524  COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], port);
525  amt_jtagaccel_port = port;
526  } else {
527  LOG_ERROR("The parport port was already configured!");
528  return ERROR_FAIL;
529  }
530  }
531 
532  command_print(CMD, "parport port = %u", amt_jtagaccel_port);
533 
534  return ERROR_OK;
535 }
536 
537 COMMAND_HANDLER(amt_jtagaccel_handle_rtck_command)
538 {
539  if (CMD_ARGC == 0) {
541  "amt_jtagaccel RTCK feature %s",
542  (rtck_enabled) ? "enabled" : "disabled");
543  return ERROR_OK;
544  } else {
545  if (strcmp(CMD_ARGV[0], "enabled") == 0)
546  rtck_enabled = 1;
547  else
548  rtck_enabled = 0;
549  }
550 
551  return ERROR_OK;
552 }
553 
554 static const struct command_registration amtjtagaccel_command_handlers[] = {
555  {
556  .name = "parport_port",
557  .handler = &amt_jtagaccel_handle_parport_port_command,
558  .mode = COMMAND_CONFIG,
559  .help = "configure or display the parallel port to use",
560  .usage = "[port_num]",
561  },
562  {
569  .name = "rtck",
570  .handler = &amt_jtagaccel_handle_rtck_command,
571  .mode = COMMAND_CONFIG,
572  .help = "configure or display RTCK support",
573  .usage = "[enable|disable]",
574  },
576 };
577 
578 static struct jtag_interface amt_jtagaccel_interface = {
580 };
581 
583  .name = "amt_jtagaccel",
584  .transport_ids = TRANSPORT_JTAG,
585  .transport_preferred_id = TRANSPORT_JTAG,
586  .commands = amtjtagaccel_command_handlers,
587 
588  .init = amt_jtagaccel_init,
589  .quit = amt_jtagaccel_quit,
590  .speed = amt_jtagaccel_speed,
591 
592  .jtag_ops = &amt_jtagaccel_interface,
593 };
int adapter_get_speed(int *speed)
Definition: adapter.c:269
static const struct command_registration amtjtagaccel_command_handlers[]
COMMAND_HANDLER(amt_jtagaccel_handle_parport_port_command)
static int amt_jtagaccel_execute_queue(struct jtag_command *cmd_queue)
#define AMT_AR(val)
static int amt_jtagaccel_init(void)
static int amt_jtagaccel_quit(void)
struct adapter_driver amt_jtagaccel_adapter_driver
static int rtck_enabled
Definition: amt_jtagaccel.c:49
static void amt_jtagaccel_runtest(unsigned int num_cycles)
static void amt_jtagaccel_end_state(enum tap_state state)
#define AMT_DW(val)
static uint16_t amt_jtagaccel_port
Definition: amt_jtagaccel.c:41
static void amt_wait_scan_busy(void)
static uint8_t aw_control_fsm
Definition: amt_jtagaccel.c:46
static uint8_t aw_control_baudrate
Definition: amt_jtagaccel.c:47
static const uint8_t amt_jtagaccel_tap_move[6][6][2]
static void amt_jtagaccel_state_move(void)
#define AMT_DR(val)
static int amt_jtagaccel_speed(int speed)
static struct jtag_interface amt_jtagaccel_interface
static uint8_t aw_control_rst
Definition: amt_jtagaccel.c:45
static void amt_jtagaccel_reset(int trst, int srst)
static void amt_jtagaccel_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
#define AMT_AW(val)
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned int first, unsigned int num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
Definition: binarybuffer.h:104
static void buf_set_u32(uint8_t *_buffer, unsigned int first, unsigned int num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
Definition: binarybuffer.h:34
void command_print(struct command_invocation *cmd, const char *format,...)
Definition: command.c:375
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
Definition: command.h:141
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
Definition: command.h:156
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
Definition: command.h:151
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
Definition: command.h:440
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:251
@ COMMAND_CONFIG
Definition: command.h:41
int jtag_build_buffer(const struct scan_command *cmd, uint8_t **buffer)
Definition: commands.c:192
enum scan_type jtag_scan_type(const struct scan_command *cmd)
Definition: commands.c:167
int jtag_read_buffer(uint8_t *buffer, const struct scan_command *cmd)
Definition: commands.c:230
scan_type
The inferred type of a scan_command structure, indicating whether the command has the host scan in fr...
Definition: commands.h:22
@ SCAN_IN
From device to host,.
Definition: commands.h:24
@ SCAN_IO
Full-duplex scan.
Definition: commands.h:28
@ JTAG_TLR_RESET
Definition: commands.h:137
@ JTAG_SCAN
Definition: commands.h:129
@ JTAG_RUNTEST
Definition: commands.h:138
@ JTAG_SLEEP
Definition: commands.h:141
@ JTAG_RESET
Definition: commands.h:139
uint64_t buffer
Pointer to data buffer to send over SPI.
Definition: dw-spi-helper.h:0
uint8_t type
Definition: esp_usb_jtag.c:0
enum tap_state tap_get_end_state(void)
For more information,.
Definition: interface.c:56
void tap_set_end_state(enum tap_state new_end_state)
This function sets the state of an "end state follower" which tracks the state that any cable driver ...
Definition: interface.c:48
int tap_move_ndx(enum tap_state astate)
Function tap_move_ndx when given a stable state, returns an index from 0-5.
Definition: interface.c:61
enum tap_state tap_get_state(void)
This function gets the state of the "state follower" which tracks the state of the TAPs connected to ...
Definition: interface.c:37
bool tap_is_state_stable(enum tap_state astate)
Function tap_is_state_stable returns true if the astate is stable.
Definition: interface.c:200
#define tap_set_state(new_state)
This function sets the state of a "state follower" which tracks the state of the TAPs connected to th...
Definition: interface.h:50
static enum reset_types jtag_reset_config
Definition: jtag/core.c:89
void jtag_sleep(uint32_t us)
Definition: jtag/core.c:1075
enum reset_types jtag_get_reset_config(void)
Definition: jtag/core.c:1747
tap_state
Defines JTAG Test Access Port states.
Definition: jtag.h:37
@ TAP_RESET
Definition: jtag.h:56
@ TAP_IRSHIFT
Definition: jtag.h:51
@ TAP_IDLE
Definition: jtag.h:53
@ TAP_DRSHIFT
Definition: jtag.h:43
#define ERROR_JTAG_QUEUE_FAILED
Definition: jtag.h:556
#define ERROR_JTAG_INIT_FAILED
Definition: jtag.h:552
reset_types
Definition: jtag.h:215
@ RESET_TRST_OPEN_DRAIN
Definition: jtag.h:222
@ RESET_SRST_PUSH_PULL
Definition: jtag.h:223
#define LOG_DEBUG_IO(expr ...)
Definition: log.h:102
#define LOG_WARNING(expr ...)
Definition: log.h:130
#define ERROR_FAIL
Definition: log.h:174
#define LOG_ERROR(expr ...)
Definition: log.h:133
#define LOG_DEBUG(expr ...)
Definition: log.h:110
#define ERROR_OK
Definition: log.h:168
Represents a driver for a debugging interface.
Definition: interface.h:208
const char *const name
The name of the interface driver.
Definition: interface.h:210
const char * name
Definition: command.h:234
Represents a driver for a debugging interface.
Definition: interface.h:183
int(* execute_queue)(struct jtag_command *cmd_queue)
Execute commands in the supplied queue.
Definition: interface.h:196
Definition: psoc6.c:83
#define TRANSPORT_JTAG
Definition: transport.h:19
#define NULL
Definition: usb.h:16
uint8_t cmd
Definition: vdebug.c:1
uint8_t state[4]
Definition: vdebug.c:21