1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2005 by Dominic Rath *
5 * Dominic.Rath@gmx.de *
7 * Copyright (C) 2007,2008 Øyvind Harboe *
8 * oyvind.harboe@zylin.com *
10 * Copyright (C) 2009 Zachary T Welch *
11 * zw@superlucidity.net *
12 ***************************************************************************/
14 #ifndef OPENOCD_JTAG_MINIDRIVER_H
15 #define OPENOCD_JTAG_MINIDRIVER_H
18 * @page jtagminidriver JTAG Mini-Driver
20 * The JTAG minidriver interface allows the definition of alternate
21 * interface functions, instead of the built-in asynchronous driver
22 * module that is used by the standard JTAG interface drivers.
24 * In addition to the functions defined in the @c minidriver.h file, the
25 * @c jtag_minidriver.h file must declare the following functions (or
26 * define static inline versions of them):
28 * - jtag_add_callback4
30 * The following core functions are declared in this file for use by
31 * the minidriver and do @b not need to be defined by an implementation:
32 * - default_interface_jtag_execute_queue()
35 /* this header will be provided by the minidriver implementation, */
36 /* and it may provide additional declarations that must be defined. */
37 #include <jtag/drivers/minidriver_imp.h>
39 int interface_jtag_add_ir_scan(struct jtag_tap *active,
40 const struct scan_field *fields,
41 tap_state_t endstate);
42 int interface_jtag_add_plain_ir_scan(
43 int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
44 tap_state_t endstate);
46 int interface_jtag_add_dr_scan(struct jtag_tap *active,
47 int num_fields, const struct scan_field *fields,
48 tap_state_t endstate);
49 int interface_jtag_add_plain_dr_scan(
50 int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
51 tap_state_t endstate);
53 int interface_jtag_add_tlr(void);
54 int interface_jtag_add_pathmove(int num_states, const tap_state_t *path);
55 int interface_jtag_add_runtest(int num_cycles, tap_state_t endstate);
57 int interface_add_tms_seq(unsigned num_bits,
58 const uint8_t *bits, enum tap_state state);
61 * This drives the actual srst and trst pins. srst will always be 0
62 * if jtag_reset_config & RESET_SRST_PULLS_TRST != 0 and ditto for
65 * the higher level jtag_add_reset will invoke jtag_add_tlr() if
68 int interface_jtag_add_reset(int trst, int srst);
69 int interface_jtag_add_sleep(uint32_t us);
70 int interface_jtag_add_clocks(int num_cycles);
71 int interface_jtag_execute_queue(void);
74 * Calls the interface callback to execute the queue. This routine
75 * is used by the JTAG driver layer and should not be called directly.
77 int default_interface_jtag_execute_queue(void);
79 #endif /* OPENOCD_JTAG_MINIDRIVER_H */