2022-06-26 23:06:45 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
2009-06-02 23:15:12 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2005 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2007,2008 Øyvind Harboe *
|
|
|
|
* oyvind.harboe@zylin.com *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2009 Zachary T Welch *
|
|
|
|
* zw@superlucidity.net *
|
|
|
|
***************************************************************************/
|
2012-02-02 15:13:13 +00:00
|
|
|
|
2015-09-21 19:07:46 +00:00
|
|
|
#ifndef OPENOCD_JTAG_MINIDRIVER_H
|
|
|
|
#define OPENOCD_JTAG_MINIDRIVER_H
|
2009-06-02 23:15:12 +00:00
|
|
|
|
2009-12-03 01:30:33 +00:00
|
|
|
/**
|
|
|
|
* @page jtagminidriver JTAG Mini-Driver
|
2009-06-02 23:15:12 +00:00
|
|
|
*
|
|
|
|
* The JTAG minidriver interface allows the definition of alternate
|
|
|
|
* interface functions, instead of the built-in asynchronous driver
|
|
|
|
* module that is used by the standard JTAG interface drivers.
|
|
|
|
*
|
2021-01-28 12:05:53 +00:00
|
|
|
* In addition to the functions defined in the @c minidriver.h file, the
|
2009-06-02 23:15:12 +00:00
|
|
|
* @c jtag_minidriver.h file must declare the following functions (or
|
|
|
|
* define static inline versions of them):
|
|
|
|
* - jtag_add_callback
|
|
|
|
* - jtag_add_callback4
|
2009-06-23 22:50:08 +00:00
|
|
|
*
|
2009-06-02 23:15:12 +00:00
|
|
|
* The following core functions are declared in this file for use by
|
|
|
|
* the minidriver and do @b not need to be defined by an implementation:
|
|
|
|
* - default_interface_jtag_execute_queue()
|
|
|
|
*/
|
|
|
|
|
2012-02-02 15:13:13 +00:00
|
|
|
/* this header will be provided by the minidriver implementation, */
|
|
|
|
/* and it may provide additional declarations that must be defined. */
|
2020-11-03 15:50:49 +00:00
|
|
|
#include <jtag/drivers/minidriver_imp.h>
|
2009-06-02 23:15:12 +00:00
|
|
|
|
2012-02-02 15:13:13 +00:00
|
|
|
int interface_jtag_add_ir_scan(struct jtag_tap *active,
|
|
|
|
const struct scan_field *fields,
|
2009-06-02 23:15:12 +00:00
|
|
|
tap_state_t endstate);
|
2009-11-09 10:53:22 +00:00
|
|
|
int interface_jtag_add_plain_ir_scan(
|
2010-03-06 10:29:59 +00:00
|
|
|
int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
|
2009-06-02 23:15:12 +00:00
|
|
|
tap_state_t endstate);
|
|
|
|
|
2012-02-02 15:13:13 +00:00
|
|
|
int interface_jtag_add_dr_scan(struct jtag_tap *active,
|
|
|
|
int num_fields, const struct scan_field *fields,
|
2009-06-02 23:15:12 +00:00
|
|
|
tap_state_t endstate);
|
2009-11-09 10:53:22 +00:00
|
|
|
int interface_jtag_add_plain_dr_scan(
|
2010-03-06 10:29:59 +00:00
|
|
|
int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
|
2009-06-02 23:15:12 +00:00
|
|
|
tap_state_t endstate);
|
|
|
|
|
2009-11-09 10:53:22 +00:00
|
|
|
int interface_jtag_add_tlr(void);
|
2012-02-02 15:13:13 +00:00
|
|
|
int interface_jtag_add_pathmove(int num_states, const tap_state_t *path);
|
2009-11-09 10:53:22 +00:00
|
|
|
int interface_jtag_add_runtest(int num_cycles, tap_state_t endstate);
|
2009-06-02 23:15:12 +00:00
|
|
|
|
2010-03-01 07:22:12 +00:00
|
|
|
int interface_add_tms_seq(unsigned num_bits,
|
|
|
|
const uint8_t *bits, enum tap_state state);
|
2010-02-27 08:12:38 +00:00
|
|
|
|
2009-06-02 23:15:12 +00:00
|
|
|
/**
|
|
|
|
* This drives the actual srst and trst pins. srst will always be 0
|
|
|
|
* if jtag_reset_config & RESET_SRST_PULLS_TRST != 0 and ditto for
|
|
|
|
* trst.
|
|
|
|
*
|
|
|
|
* the higher level jtag_add_reset will invoke jtag_add_tlr() if
|
2020-07-12 21:40:41 +00:00
|
|
|
* appropriate
|
2009-06-02 23:15:12 +00:00
|
|
|
*/
|
2009-11-09 10:53:22 +00:00
|
|
|
int interface_jtag_add_reset(int trst, int srst);
|
|
|
|
int interface_jtag_add_sleep(uint32_t us);
|
|
|
|
int interface_jtag_add_clocks(int num_cycles);
|
|
|
|
int interface_jtag_execute_queue(void);
|
2009-06-02 23:15:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Calls the interface callback to execute the queue. This routine
|
|
|
|
* is used by the JTAG driver layer and should not be called directly.
|
|
|
|
*/
|
2009-11-09 10:53:22 +00:00
|
|
|
int default_interface_jtag_execute_queue(void);
|
2009-06-02 23:15:12 +00:00
|
|
|
|
2015-09-21 19:07:46 +00:00
|
|
|
#endif /* OPENOCD_JTAG_MINIDRIVER_H */
|