OpenOCD
|
The JTAG interface can be implemented with a software or hardware fifo. More...
Go to the source code of this file.
Data Structures | |
struct | jtag_tap |
struct | jtag_tap_event_action |
struct | scan_field |
This structure defines a single scan field in the scan. More... | |
Macros | |
#define | DEBUG_JTAG_IOZ 64 |
#define | ERROR_JTAG_DEVICE_ERROR (-107) |
#define | ERROR_JTAG_INIT_FAILED (-100) |
#define | ERROR_JTAG_INIT_SOFT_FAIL (-110) |
#define | ERROR_JTAG_INVALID_INTERFACE (-101) |
#define | ERROR_JTAG_NOT_IMPLEMENTED (-102) |
#define | ERROR_JTAG_NOT_STABLE_STATE (-105) |
#define | ERROR_JTAG_QUEUE_FAILED (-104) |
#define | ERROR_JTAG_STATE_INVALID (-108) |
#define | ERROR_JTAG_TRANSITION_INVALID (-109) |
#define | ERROR_JTAG_TRST_ASSERTED (-103) |
#define | SRST_ASSERT 1 |
#define | SRST_DEASSERT 0 |
Defines arguments for reset functions. More... | |
#define | TRST_ASSERT 1 |
#define | TRST_DEASSERT 0 |
Typedefs | |
typedef void(* | jtag_callback1_t) (jtag_callback_data_t data0) |
Defines a simple JTAG callback that can allow conversions on data scanned in from an interface. More... | |
typedef intptr_t | jtag_callback_data_t |
Defines the type of data passed to the jtag_callback_t interface. More... | |
typedef int(* | jtag_callback_t) (jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3) |
Defines the interface of the JTAG callback mechanism. More... | |
typedef int(* | jtag_event_handler_t) (enum jtag_event event, void *priv) |
Defines the function signature required for JTAG event callback functions, which are added with jtag_register_event_callback() and removed jtag_unregister_event_callback(). More... | |
typedef enum tap_state | tap_state_t |
Defines JTAG Test Access Port states. More... | |
Enumerations | |
enum | jtag_event { JTAG_TRST_ASSERTED , JTAG_TAP_EVENT_SETUP , JTAG_TAP_EVENT_ENABLE , JTAG_TAP_EVENT_DISABLE } |
enum | reset_types { RESET_NONE = 0x0 , RESET_HAS_TRST = 0x1 , RESET_HAS_SRST = 0x2 , RESET_TRST_AND_SRST = 0x3 , RESET_SRST_PULLS_TRST = 0x4 , RESET_TRST_PULLS_SRST = 0x8 , RESET_TRST_OPEN_DRAIN = 0x10 , RESET_SRST_PUSH_PULL = 0x20 , RESET_SRST_NO_GATING = 0x40 , RESET_CNCT_UNDER_SRST = 0x80 } |
enum | tap_state { TAP_INVALID = -1 , TAP_DREXIT2 = 0x0 , TAP_DREXIT1 = 0x1 , TAP_DRSHIFT = 0x2 , TAP_DRPAUSE = 0x3 , TAP_IRSELECT = 0x4 , TAP_DRUPDATE = 0x5 , TAP_DRCAPTURE = 0x6 , TAP_DRSELECT = 0x7 , TAP_IREXIT2 = 0x8 , TAP_IREXIT1 = 0x9 , TAP_IRSHIFT = 0xa , TAP_IRPAUSE = 0xb , TAP_IDLE = 0xc , TAP_IRUPDATE = 0xd , TAP_IRCAPTURE = 0xe , TAP_RESET = 0x0f } |
Defines JTAG Test Access Port states. More... | |
Functions | |
__COMMAND_HANDLER (handle_jtag_newtap) | |
bool | is_jtag_poll_safe (void) |
Return true if it's safe for a background polling task to access the JTAG scan chain. More... | |
void | jtag_add_callback (jtag_callback1_t f, jtag_callback_data_t data0) |
A simpler version of jtag_add_callback4(). More... | |
void | jtag_add_clocks (unsigned int num_cycles) |
Function jtag_add_clocks first checks that the state in which the clocks are to be issued is stable, then queues up num_cycles clocks for transmission. More... | |
void | jtag_add_dr_scan (struct jtag_tap *tap, int num_fields, const struct scan_field *fields, tap_state_t endstate) |
Generate a DR SCAN using the fields passed to the function. More... | |
void | jtag_add_dr_scan_check (struct jtag_tap *tap, int num_fields, struct scan_field *fields, tap_state_t endstate) |
A version of jtag_add_dr_scan() that uses the check_value/mask fields. More... | |
void | jtag_add_ir_scan (struct jtag_tap *tap, struct scan_field *fields, tap_state_t endstate) |
Generate an IR SCAN with a list of scan fields with one entry for each enabled TAP. More... | |
void | jtag_add_ir_scan_noverify (struct jtag_tap *tap, const struct scan_field *fields, tap_state_t state) |
The same as jtag_add_ir_scan except no verification is performed out the output values. More... | |
void | jtag_add_pathmove (unsigned int num_states, const tap_state_t *path) |
Application code must assume that interfaces will implement transitions between states with different paths and path lengths through the state diagram. More... | |
void | jtag_add_plain_dr_scan (int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t endstate) |
Scan out the bits in ir scan mode. More... | |
void | jtag_add_plain_ir_scan (int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t endstate) |
Scan out the bits in ir scan mode. More... | |
void | jtag_add_reset (int req_tlr_or_trst, int srst) |
A reset of the TAP state machine can be requested. More... | |
void | jtag_add_runtest (unsigned int num_cycles, tap_state_t endstate) |
Goes to TAP_IDLE (if we're not already there), cycle precisely num_cycles in the TAP_IDLE state, after which move to endstate (unless it is also TAP_IDLE). More... | |
void | jtag_add_sleep (uint32_t us) |
int | jtag_add_statemove (tap_state_t goal_state) |
jtag_add_statemove() moves from the current state to goal_state. More... | |
void | jtag_add_tlr (void) |
Run a TAP_RESET reset where the end state is TAP_RESET, regardless of the start state. More... | |
int | jtag_add_tms_seq (unsigned int nbits, const uint8_t *seq, enum tap_state t) |
If supported by the underlying adapter, this clocks a raw bit sequence onto TMS for switching between JTAG and SWD modes. More... | |
struct jtag_tap * | jtag_all_taps (void) |
int | jtag_call_event_callbacks (enum jtag_event event) |
void | jtag_check_value_mask (struct scan_field *field, uint8_t *value, uint8_t *mask) |
Execute jtag queue and check value with an optional mask. More... | |
int | jtag_error_clear (void) |
Resets jtag_error to ERROR_OK, returning its previous value. More... | |
int | jtag_execute_queue (void) |
For software FIFO implementations, the queued commands can be executed during this call or earlier. More... | |
void | jtag_execute_queue_noclear (void) |
same as jtag_execute_queue() but does not clear the error flag More... | |
unsigned int | jtag_get_flush_queue_count (void) |
unsigned int | jtag_get_nsrst_assert_width (void) |
unsigned int | jtag_get_nsrst_delay (void) |
unsigned int | jtag_get_ntrst_assert_width (void) |
unsigned int | jtag_get_ntrst_delay (void) |
enum reset_types | jtag_get_reset_config (void) |
int | jtag_get_srst (void) |
int | jtag_get_trst (void) |
int | jtag_init (struct command_context *cmd_ctx) |
Initialize JTAG chain using only a RESET reset. More... | |
int | jtag_init_inner (struct command_context *cmd_ctx) |
int | jtag_init_reset (struct command_context *cmd_ctx) |
reset, then initialize JTAG chain More... | |
void | jtag_notify_event (enum jtag_event) |
Report Tcl event to all TAPs. More... | |
bool | jtag_poll_get_enabled (void) |
Return flag reporting whether JTAG polling is disallowed. More... | |
bool | jtag_poll_mask (void) |
Mask (disable) polling and return the current mask status that should be feed to jtag_poll_unmask() to restore it. More... | |
void | jtag_poll_set_enabled (bool value) |
Assign flag reporting whether JTAG polling is disallowed. More... | |
void | jtag_poll_unmask (bool saved) |
Restore saved mask for polling. More... | |
int | jtag_power_dropout (int *dropout) |
int | jtag_register_commands (struct command_context *cmd_ctx) |
int | jtag_register_event_callback (jtag_event_handler_t f, void *x) |
void | jtag_set_error (int error) |
Set the current JTAG core execution error, unless one was set by a previous call previously. More... | |
void | jtag_set_flush_queue_sleep (int ms) |
Set ms to sleep after jtag_execute_queue() flushes queue. More... | |
void | jtag_set_nsrst_assert_width (unsigned int delay) |
void | jtag_set_nsrst_delay (unsigned int delay) |
void | jtag_set_ntrst_assert_width (unsigned int delay) |
void | jtag_set_ntrst_delay (unsigned int delay) |
void | jtag_set_reset_config (enum reset_types type) |
void | jtag_set_verify (bool enable) |
Enable or disable data scan verification checking. More... | |
void | jtag_set_verify_capture_ir (bool enable) |
Enable or disable verification of IR scan checking. More... | |
void | jtag_sleep (uint32_t us) |
int | jtag_srst_asserted (int *srst_asserted) |
struct jtag_tap * | jtag_tap_by_jim_obj (Jim_Interp *interp, Jim_Obj *obj) |
struct jtag_tap * | jtag_tap_by_position (unsigned int abs_position) |
struct jtag_tap * | jtag_tap_by_string (const char *dotted_name) |
unsigned int | jtag_tap_count (void) |
unsigned int | jtag_tap_count_enabled (void) |
void | jtag_tap_free (struct jtag_tap *tap) |
void | jtag_tap_init (struct jtag_tap *tap) |
const char * | jtag_tap_name (const struct jtag_tap *tap) |
struct jtag_tap * | jtag_tap_next_enabled (struct jtag_tap *p) |
int | jtag_unregister_event_callback (jtag_event_handler_t f, void *x) |
bool | jtag_will_verify (void) |
bool | jtag_will_verify_capture_ir (void) |
tap_state_t | tap_state_by_name (const char *name) |
Provides user-friendly name lookup of TAP states. More... | |
const char * | tap_state_name (tap_state_t state) |
Function tap_state_name Returns a string suitable for display representing the JTAG tap_state. More... | |
Variables | |
tap_state_t | cmd_queue_cur_state |
The current TAP state of the pending JTAG command queue. More... | |
The JTAG interface can be implemented with a software or hardware fifo.
TAP_DRSHIFT and TAP_IRSHIFT are illegal end states; however, TAP_DRSHIFT/IRSHIFT can be emulated as end states, by using longer scans.
Code that is relatively insensitive to the path taken through state machine (as long as it is JTAG compliant) can use endstate for jtag_add_xxx_scan(). Otherwise, the pause state must be specified as end state and a subsequent jtag_add_pathmove() must be issued.
Definition in file jtag.h.
#define SRST_DEASSERT 0 |
typedef void(* jtag_callback1_t) (jtag_callback_data_t data0) |
typedef intptr_t jtag_callback_data_t |
typedef int(* jtag_callback_t) (jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3) |
Defines the interface of the JTAG callback mechanism.
Such callbacks can be executed once the queue has been flushed.
The JTAG queue can be executed synchronously or asynchronously. Typically for USB, the queue is executed asynchronously. For low-latency interfaces, the queue may be executed synchronously.
The callback mechanism is very general and does not make many assumptions about what the callback does or what its arguments are. These callbacks are typically executed after the entire JTAG queue has been executed for e.g. USB interfaces, and they are guaranteed to be invoked in the order that they were queued.
If the execution of the queue fails before the callbacks, then – depending on driver implementation – the callbacks may or may not be invoked.
data0 | Typically used to point to the data to operate on. Frequently this will be the data clocked in during a shift operation. |
data1 | An integer big enough to use as an int or a pointer. |
data2 | An integer big enough to use as an int or a pointer. |
data3 | An integer big enough to use as an int or a pointer. |
typedef int(* jtag_event_handler_t) (enum jtag_event event, void *priv) |
Defines the function signature required for JTAG event callback functions, which are added with jtag_register_event_callback() and removed jtag_unregister_event_callback().
event | The event to handle. |
priv | A pointer to data that was passed to jtag_register_event_callback(). |
typedef enum tap_state tap_state_t |
Defines JTAG Test Access Port states.
These definitions were gleaned from the ARM7TDMI-S Technical Reference Manual and validated against several other ARM core technical manuals.
FIXME some interfaces require specific numbers be used, as they are handed-off directly to their hardware implementations. Fix those drivers to map as appropriate ... then pick some sane set of numbers here (where 0/uninitialized == INVALID).
enum jtag_event |
enum reset_types |
enum tap_state |
Defines JTAG Test Access Port states.
These definitions were gleaned from the ARM7TDMI-S Technical Reference Manual and validated against several other ARM core technical manuals.
FIXME some interfaces require specific numbers be used, as they are handed-off directly to their hardware implementations. Fix those drivers to map as appropriate ... then pick some sane set of numbers here (where 0/uninitialized == INVALID).
__COMMAND_HANDLER | ( | handle_jtag_newtap | ) |
Definition at line 514 of file jtag/tcl.c.
References CALL_COMMAND_HANDLER, jtag_tap::chip, jtag_tap::dotted_name, ERROR_FAIL, ERROR_OK, jtag_tap::expected_ids, jtag_tap_init(), LOG_ERROR, and jtag_tap::tapname.
bool is_jtag_poll_safe | ( | void | ) |
Return true if it's safe for a background polling task to access the JTAG scan chain.
Polling may be explicitly disallowed, and is also unsafe while nTRST is active or the JTAG clock is gated off.
Definition at line 142 of file jtag/core.c.
References jtag_poll, jtag_poll_en, jtag_reset_config, jtag_srst, jtag_trst, RESET_SRST_NO_GATING, and transport_is_jtag().
Referenced by handle_target().
void jtag_add_callback | ( | jtag_callback1_t | f, |
jtag_callback_data_t | data0 | ||
) |
A simpler version of jtag_add_callback4().
Definition at line 403 of file jtag/drivers/driver.c.
References jtag_callback_entry::data0, and interface_jtag_add_callback().
Referenced by adi_jtag_dp_scan_u32(), arm720t_scan_cp15(), arm7tdmi_clock_data_in(), arm920t_read_cp15_physical(), arm926ejs_cp15_read(), arm946e_read_cp15(), arm966e_read_cp15(), arm9tdmi_clock_data_in(), arm9tdmi_clock_out(), embeddedice_receive(), etb_read_ram(), mips64_ejtag_fastdata_scan(), mips_ejtag_fastdata_scan(), virtex2_receive_32(), and xscale_receive().
void jtag_add_clocks | ( | unsigned int | num_cycles | ) |
Function jtag_add_clocks first checks that the state in which the clocks are to be issued is stable, then queues up num_cycles clocks for transmission.
Definition at line 599 of file jtag/core.c.
References cmd_queue_cur_state, ERROR_JTAG_NOT_STABLE_STATE, interface_jtag_add_clocks(), jtag_checks(), jtag_set_error(), LOG_ERROR, tap_is_state_stable(), and tap_state_name().
Referenced by COMMAND_HANDLER(), mips32_pracc_fastdata_xfer(), mips32_pracc_queue_exec(), mips64_pracc_exec_read(), mips64_pracc_exec_write(), and mips64_pracc_fastdata_xfer().
void jtag_add_dr_scan | ( | struct jtag_tap * | tap, |
int | num_fields, | ||
const struct scan_field * | fields, | ||
tap_state_t | endstate | ||
) |
Generate a DR SCAN using the fields passed to the function.
For connected TAPs, the function checks in_fields and uses fields specified there. For bypassed TAPs, the function generates a dummy 1-bit field. The bypass status of TAPs is set by jtag_add_ir_scan().
Definition at line 451 of file jtag/core.c.
References interface_jtag_add_dr_scan(), jtag_prelude(), jtag_set_error(), state, and TAP_RESET.
Referenced by adbg_burst_command(), adbg_ctrl_read(), adbg_ctrl_write(), adbg_select_ctrl_reg(), adbg_select_module(), adbg_wb_burst_read(), adbg_wb_burst_write(), add_dbus_scan(), adi_jtag_dp_scan_cmd(), arc_jtag_enque_read_dr(), arc_jtag_enque_set_transaction(), arc_jtag_enque_write_dr(), arm11_add_dr_scan_vc(), arm11_run_instr_data_to_core_noack_inner(), arm720t_scan_cp15(), arm7tdmi_clock_data_in(), arm7tdmi_clock_data_in_endianness(), arm7tdmi_clock_out_inner(), arm7tdmi_examine_debug_reason(), arm920t_execute_cp15(), arm920t_read_cp15_physical(), arm920t_write_cp15_physical(), arm926ejs_cp15_read(), arm926ejs_cp15_write(), arm946e_read_cp15(), arm946e_write_cp15(), arm966e_read_cp15(), arm966e_write_cp15(), arm9tdmi_clock_data_in(), arm9tdmi_clock_data_in_endianness(), arm9tdmi_clock_out(), arm9tdmi_examine_debug_reason(), arm_jtag_scann_inner(), avr32_jtag_mwa_read_data(), avr32_jtag_mwa_set_address(), avr32_jtag_mwa_write_data(), avr32_jtag_nexus_read_data(), avr32_jtag_nexus_set_address(), avr32_jtag_nexus_write_data(), COMMAND_HANDLER(), dbus_scan(), dmi_scan(), drscan(), dtmcontrol_scan(), dtmcontrol_scan_via_bscan(), efinix_load(), embeddedice_handshake(), embeddedice_read_reg_w_check(), embeddedice_receive(), embeddedice_send(), embeddedice_write_reg_inner(), esirisc_jtag_recv(), esirisc_jtag_send(), etb_read_ram(), etb_read_reg_w_check(), etb_scann(), etb_write_reg(), etm_read_reg_w_check(), etm_write_reg(), feroceon_dummy_clock_out(), gatemate_load(), gowin_load_to_sram(), gowin_read_register(), idcode_scan(), intel_load(), ipdbg_jtag_transfer_bytes(), ipdbg_shift_data(), ipdbg_shift_empty_data(), ipdbg_shift_vir(), isc_data_read_out(), isc_program_register(), isc_read_register(), isc_set_register(), jtag_add_dr_scan_check(), jtagspi_cmd(), lakemont_reset_break(), lattice_certus_connect_spi_to_jtag(), lattice_certus_enable_programming(), lattice_certus_enable_transparent_mode(), lattice_certus_erase_device(), lattice_certus_program_config_map(), lattice_ecp2_3_erase_device(), lattice_ecp2_3_program_config_map(), lattice_ecp2_3_write_usercode(), lattice_ecp5_connect_spi_to_jtag(), lattice_ecp5_enable_sram_programming(), lattice_ecp5_erase_sram(), lattice_ecp5_init_address(), lattice_ecp5_program_config_map(), lattice_ecp5_write_usercode(), lattice_preload(), lattice_read_u32_register(), lattice_read_u64_register(), ls1_sap_memory_cmd(), ls1_sap_memory_read(), ls1_sap_memory_write(), ls1_sap_set_addr_high(), mips64_ejtag_fastdata_scan(), mips_ejtag_add_scan_96(), mips_ejtag_drscan_32_queued(), mips_ejtag_drscan_64(), mips_ejtag_drscan_8(), mips_ejtag_drscan_8_out(), mips_ejtag_fastdata_scan(), or1k_adv_jtag_jsp_xfer(), or1k_tap_vjtag_init(), riscv_add_bscan_tunneled_scan(), riscv_batch_run(), select_dmi_via_bscan(), str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_isc_status(), str9xpec_lock_device(), str9xpec_read_config(), str9xpec_set_address(), str9xpec_write(), str9xpec_write_options(), virtex2_load(), virtex2_receive_32(), virtex2_send_32(), xcf_erase_check(), xscale_invalidate_ic_line(), xscale_load_ic(), xscale_read_dcsr(), xscale_read_tx(), xscale_send(), xscale_write_dcsr(), xscale_write_rx(), and xtensa_dm_add_dr_scan().
void jtag_add_dr_scan_check | ( | struct jtag_tap * | tap, |
int | num_fields, | ||
struct scan_field * | fields, | ||
tap_state_t | endstate | ||
) |
A version of jtag_add_dr_scan() that uses the check_value/mask fields.
Definition at line 439 of file jtag/core.c.
References jtag_add_dr_scan(), jtag_add_scan_check(), jtag_verify, and state.
Referenced by embeddedice_read_reg_w_check(), etb_read_reg_w_check(), etm_read_reg_w_check(), and xscale_receive().
void jtag_add_ir_scan | ( | struct jtag_tap * | tap, |
struct scan_field * | fields, | ||
tap_state_t | endstate | ||
) |
Generate an IR SCAN with a list of scan fields with one entry for each enabled TAP.
If the input field list contains an instruction value for a TAP then that is used otherwise the TAP is set to bypass.
TAPs for which no fields are passed are marked as bypassed for subsequent DR SCANs.
Definition at line 374 of file jtag/core.c.
References scan_field::check_mask, scan_field::check_value, jtag_tap::expected, jtag_tap::expected_mask, jtag_add_ir_scan_noverify(), jtag_add_ir_scan_noverify_callback(), jtag_add_scan_check(), jtag_verify, jtag_verify_capture_ir, state, and TAP_RESET.
Referenced by arc_jtag_enque_write_ir(), arm11_add_ir_scan_vc(), arm_jtag_set_instr_inner(), assert_reset(), avr32_jtag_set_instr(), COMMAND_HANDLER(), deassert_reset(), dtmcontrol_scan(), dtmcontrol_scan_via_bscan(), efinix_set_instr(), esirisc_jtag_set_instr(), etb_set_instr(), fpga_configure(), gatemate_set_instr(), gowin_set_instr(), halt(), idcode_scan(), intel_set_instr(), ipdbg_shift_instr(), irscan(), isc_data_read_out(), isc_enter(), isc_leave(), isc_program_register(), isc_read_register(), isc_set_register(), jtagspi_set_user_ir(), lakemont_reset_break(), lattice_set_instr(), ls1_sap_set_instr(), mips_ejtag_set_instr(), or1k_tap_vjtag_init(), or1k_tap_xilinx_bscan_init(), poll_target(), read_memory(), riscv011_resume(), riscv_add_bscan_tunneled_scan(), select_dmi(), select_dmi_via_bscan(), step(), str9xpec_set_instr(), virtex2_set_instr(), write_memory(), xcf_erase_check(), xscale_jtag_set_instr(), and xtensa_dm_add_set_ir().
void jtag_add_ir_scan_noverify | ( | struct jtag_tap * | tap, |
const struct scan_field * | fields, | ||
tap_state_t | state | ||
) |
The same as jtag_add_ir_scan except no verification is performed out the output values.
Definition at line 356 of file jtag/core.c.
References interface_jtag_add_ir_scan(), jtag_prelude(), jtag_set_error(), and state.
Referenced by arm_jtag_set_instr_inner(), jtag_add_ir_scan(), and jtag_add_ir_scan_noverify_callback().
void jtag_add_pathmove | ( | unsigned int | num_states, |
const tap_state_t * | path | ||
) |
Application code must assume that interfaces will implement transitions between states with different paths and path lengths through the state diagram.
The path will vary across interface and also across versions of the same interface over time. Even if the OpenOCD code is unchanged, the actual path taken may vary over time and versions of interface firmware or PCB revisions.
Use jtag_add_pathmove() when specific transition sequences are required.
Do not use jtag_add_pathmove() unless you need to, but do use it if you have to.
DANGER! If the target is dependent upon a particular sequence of transitions for things to work correctly(e.g. as a workaround for an errata that contradicts the JTAG standard), then pathmove must be used, even if some jtag interfaces happen to use the desired path. Worse, the jtag interface used for testing a particular implementation, could happen to use the "desired" path when transitioning to/from end state.
A list of unambiguous single clock state transitions, not all drivers can support this, but it is required for e.g. XScale and Xilinx support
Note! TAP_RESET must not be used in the path!
Note that the first on the list must be reachable via a single transition from the current state.
All drivers are required to implement jtag_add_pathmove(). However, if the pathmove sequence can not be precisely executed, an interface_jtag_add_pathmove() or jtag_execute_queue() must return an error. It is legal, but not recommended, that a driver returns an error in all cases for a pathmove if it can only implement a few transitions and therefore a partial implementation of pathmove would have little practical application.
If an error occurs, jtag_error will contain one of these error codes:
Definition at line 517 of file jtag/core.c.
References cmd_queue_cur_state, ERROR_JTAG_NOT_STABLE_STATE, ERROR_JTAG_STATE_INVALID, ERROR_JTAG_TRANSITION_INVALID, interface_jtag_add_pathmove(), jtag_checks(), jtag_set_error(), LOG_ERROR, tap_is_state_stable(), TAP_RESET, tap_state_name(), and tap_state_transition().
Referenced by arm11_add_dr_scan_vc(), arm11_add_ir_scan_vc(), arm11_run_instr_data_to_core_noack_inner(), COMMAND_HANDLER(), jtag_add_statemove(), reset_jtag(), svf_add_statemove(), xscale_read_tx(), and xscale_receive().
void jtag_add_plain_dr_scan | ( | int | num_bits, |
const uint8_t * | out_bits, | ||
uint8_t * | in_bits, | ||
tap_state_t | endstate | ||
) |
Scan out the bits in ir scan mode.
If in_bits == NULL, discard incoming bits.
Definition at line 465 of file jtag/core.c.
References interface_jtag_add_plain_dr_scan(), jtag_prelude(), jtag_set_error(), state, and TAP_RESET.
Referenced by COMMAND_HANDLER(), dsp563xx_write_dr(), dsp5680xx_drscan(), jtag_examine_chain_execute(), and mcu_write_dr().
void jtag_add_plain_ir_scan | ( | int | num_bits, |
const uint8_t * | out_bits, | ||
uint8_t * | in_bits, | ||
tap_state_t | endstate | ||
) |
Scan out the bits in ir scan mode.
If in_bits == NULL, discard incoming bits.
Definition at line 392 of file jtag/core.c.
References interface_jtag_add_plain_ir_scan(), jtag_prelude(), jtag_set_error(), state, and TAP_RESET.
Referenced by COMMAND_HANDLER(), dsp563xx_write_ir(), dsp5680xx_irscan(), esp32_queue_tdi_idle(), jtag_validate_ircapture(), and mcu_write_ir().
void jtag_add_reset | ( | int | req_tlr_or_trst, |
int | srst | ||
) |
A reset of the TAP state machine can be requested.
Whether tms or trst reset is used depends on the capabilities of the target and jtag interface(reset_config command configures this).
srst can driver a reset of the TAP state machine and vice versa
Application code may need to examine value of jtag_reset_config to determine the proper codepath
DANGER! Even though srst drives trst, trst might not be connected to the interface, and it might actually be harmful to assert trst in this case.
This is why combinations such as "reset_config srst_only srst_pulls_trst" are supported.
only req_tlr_or_trst and srst can have a transition for a call as the effects of transitioning both at the "same time" are undefined, but when srst_pulls_trst or vice versa, then trst & srst must be asserted together.
Definition at line 758 of file jtag/core.c.
References adapter_nsrst_assert_width, adapter_nsrst_delay, ERROR_FAIL, ERROR_OK, jtag_add_sleep(), jtag_add_tlr(), jtag_call_event_callbacks(), jtag_execute_queue(), jtag_notify_event(), jtag_ntrst_assert_width, jtag_ntrst_delay, jtag_reset_config, jtag_set_error(), jtag_srst, jtag_trst, JTAG_TRST_ASSERTED, legacy_jtag_add_reset(), LOG_DEBUG, LOG_ERROR, adapter_driver::reset, RESET_HAS_SRST, RESET_HAS_TRST, RESET_SRST_PULLS_TRST, RESET_TRST_PULLS_SRST, TAP_RESET, and tap_set_state.
Referenced by adapter_assert_reset(), adapter_deassert_reset(), adapter_resets(), arc_assert_reset(), arc_deassert_reset(), arm11_assert_reset(), arm11_deassert_reset(), arm7_9_assert_reset(), arm7_9_deassert_reset(), COMMAND_HANDLER(), dsp563xx_assert_reset(), dsp563xx_deassert_reset(), dsp5680xx_f_lock(), dsp5680xx_f_unlock(), dsp5680xx_resume(), eonce_enter_debug_mode(), esirisc_assert_reset(), esirisc_deassert_reset(), jtag_init(), jtag_init_reset(), mips_m4k_assert_reset(), mips_m4k_deassert_reset(), mips_mips64_assert_reset(), mips_mips64_deassert_reset(), xscale_assert_reset(), and xscale_deassert_reset().
void jtag_add_runtest | ( | unsigned int | num_cycles, |
tap_state_t | endstate | ||
) |
Goes to TAP_IDLE (if we're not already there), cycle precisely num_cycles in the TAP_IDLE state, after which move to endstate (unless it is also TAP_IDLE).
num_cycles | Number of cycles in TAP_IDLE state. This argument may be 0, in which case this routine will navigate to endstate via TAP_IDLE. |
endstate | The final state. |
Definition at line 592 of file jtag/core.c.
References interface_jtag_add_runtest(), jtag_prelude(), jtag_set_error(), and state.
Referenced by add_dbus_scan(), adi_jtag_dp_scan_cmd(), arm720t_scan_cp15(), arm7_9_assert_reset(), arm7_9_restart_core(), arm7tdmi_clock_data_in(), arm7tdmi_clock_data_in_endianness(), arm7tdmi_clock_out_inner(), arm9tdmi_clock_data_in(), arm9tdmi_clock_data_in_endianness(), arm9tdmi_clock_out(), COMMAND_HANDLER(), dbus_scan(), dmi_scan(), efinix_load(), gatemate_set_instr(), gowin_load_to_sram(), gowin_runtest_idle(), gowin_set_instr(), intel_load(), lattice_certus_disconnect_spi_from_jtag(), lattice_certus_enable_programming(), lattice_certus_enable_transparent_mode(), lattice_certus_erase_device(), lattice_certus_exit_programming_mode(), lattice_certus_init_address(), lattice_certus_refresh(), lattice_ecp2_3_erase_device(), lattice_ecp2_3_exit_programming_mode(), lattice_ecp2_3_program_config_map(), lattice_ecp2_3_write_usercode(), lattice_ecp2_load(), lattice_ecp3_load(), lattice_ecp5_disconnect_spi_from_jtag(), lattice_ecp5_enable_sram_programming(), lattice_ecp5_erase_sram(), lattice_ecp5_exit_programming_mode(), lattice_ecp5_init_address(), lattice_ecp5_program_config_map(), lattice_ecp5_refresh(), lattice_ecp5_write_usercode(), lattice_read_u32_register(), read_memory_bus_v1(), riscv_batch_run(), virtex2_load_cleanup(), virtex2_program(), xscale_deassert_reset(), and xscale_receive().
void jtag_add_sleep | ( | uint32_t | us | ) |
Definition at line 870 of file jtag/core.c.
References interface_jtag_add_sleep(), jtag_set_error(), and keep_alive().
Referenced by arc_assert_reset(), arm7_9_assert_reset(), COMMAND_HANDLER(), dsp563xx_assert_reset(), dsp5680xx_f_lock(), dsp5680xx_f_unlock(), dsp5680xx_resume(), eonce_enter_debug_mode(), gowin_erase_sram(), jtag_add_reset(), lattice_certus_erase_device(), lattice_certus_refresh(), lattice_ecp2_3_erase_device(), lattice_ecp2_3_exit_programming_mode(), lattice_ecp2_3_program_config_map(), lattice_ecp2_3_write_usercode(), lattice_ecp2_load(), lattice_ecp3_load(), lattice_ecp5_enable_sram_programming(), lattice_ecp5_erase_sram(), lattice_ecp5_exit_programming_mode(), lattice_ecp5_init_address(), lattice_ecp5_program_config_map(), lattice_ecp5_refresh(), lattice_ecp5_write_usercode(), lattice_read_u32_register(), legacy_jtag_add_reset(), mips_ejtag_exit_debug(), mips_m4k_assert_reset(), mips_mips64_assert_reset(), read_hw_reg(), str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_isc_disable(), str9xpec_write(), str9xpec_write_options(), submit_pir(), virtex2_load_prepare(), xscale_assert_reset(), and xscale_deassert_reset().
int jtag_add_statemove | ( | tap_state_t | goal_state | ) |
jtag_add_statemove() moves from the current state to goal_state.
goal_state | The final TAP state. |
Moves from the current state to the goal state. Both states must be stable.
Definition at line 551 of file jtag/core.c.
References ARRAY_SIZE, bit(), cmd_queue_cur_state, ERROR_FAIL, ERROR_OK, jtag_add_pathmove(), jtag_add_tlr(), LOG_DEBUG, tap_get_tms_path(), tap_get_tms_path_len(), tap_is_state_stable(), TAP_RESET, tap_state_name(), and tap_state_transition().
Referenced by arm11_add_debug_scan_n(), COMMAND_HANDLER(), and reset_jtag().
void jtag_add_tlr | ( | void | ) |
Run a TAP_RESET reset where the end state is TAP_RESET, regardless of the start state.
Definition at line 478 of file jtag/core.c.
References interface_jtag_add_tlr(), jtag_call_event_callbacks(), jtag_notify_event(), jtag_prelude(), jtag_set_error(), JTAG_TRST_ASSERTED, and TAP_RESET.
Referenced by arm11_deassert_reset(), COMMAND_HANDLER(), efinix_load(), jtag_add_reset(), jtag_add_statemove(), jtag_examine_chain_execute(), jtag_init_inner(), jtag_validate_ircapture(), legacy_jtag_add_reset(), or1k_tap_vjtag_init(), or1k_tap_xilinx_bscan_init(), svf_add_statemove(), virtex2_load_cleanup(), and virtex2_read_stat().
int jtag_add_tms_seq | ( | unsigned int | nbits, |
const uint8_t * | seq, | ||
enum tap_state | state | ||
) |
If supported by the underlying adapter, this clocks a raw bit sequence onto TMS for switching between JTAG and SWD modes.
DO NOT use this to bypass the integrity checks and logging provided by the jtag_add_pathmove() and jtag_add_statemove() calls.
nbits | How many bits to clock out. |
seq | The bit sequence. The LSB is bit 0 of seq[0]. |
state | The JTAG tap state to record on completion. Use TAP_INVALID to represent being in in SWD mode. |
Definition at line 502 of file jtag/core.c.
References cmd_queue_cur_state, DEBUG_CAP_TMS_SEQ, ERROR_JTAG_NOT_IMPLEMENTED, interface_add_tms_seq(), jtag_checks(), adapter_driver::jtag_ops, jtag_set_error(), state, and jtag_interface::supported.
Referenced by jtag_send_sequence().
struct jtag_tap* jtag_all_taps | ( | void | ) |
Definition at line 184 of file jtag/core.c.
References __jtag_all_taps.
Referenced by adapter_quit(), COMMAND_HANDLER(), jtag_notify_event(), jtag_tap_by_position(), jtag_tap_by_string(), jtag_tap_count(), jtag_tap_count_enabled(), and jtag_tap_next_enabled().
int jtag_call_event_callbacks | ( | enum jtag_event | event | ) |
Definition at line 324 of file jtag/core.c.
References jtag_event_callback::callback, ERROR_OK, jtag_event_callbacks, jtag_event_strings, LOG_DEBUG, and jtag_event_callback::next.
Referenced by jtag_add_reset(), jtag_add_tlr(), jtag_tap_disable(), jtag_tap_enable(), and legacy_jtag_add_reset().
void jtag_check_value_mask | ( | struct scan_field * | field, |
uint8_t * | value, | ||
uint8_t * | mask | ||
) |
Execute jtag queue and check value with an optional mask.
field | Pointer to scan field. |
value | Pointer to scan value. |
mask | Pointer to scan mask; may be NULL. |
returns Nothing, but calls jtag_set_error() on any error.
Definition at line 917 of file jtag/core.c.
References scan_field::in_value, jtag_check_value_inner(), jtag_execute_queue_noclear(), jtag_set_error(), mask, and scan_field::num_bits.
Referenced by COMMAND_HANDLER(), xscale_read_dcsr(), xscale_read_tx(), xscale_write_dcsr(), and xscale_write_rx().
int jtag_error_clear | ( | void | ) |
Resets jtag_error to ERROR_OK, returning its previous value.
jtag_error
. Definition at line 130 of file jtag/core.c.
References ERROR_OK, and jtag_error.
Referenced by jtag_execute_queue().
int jtag_execute_queue | ( | void | ) |
For software FIFO implementations, the queued commands can be executed during this call or earlier.
A sw queue might decide to push out some of the jtag_add_xxx() operations once the queue is "big enough".
This fn will return an error code if any of the prior jtag_add_xxx() calls caused a failure, e.g. check failure. Note that it does not matter if the operation was executed before jtag_execute_queue(), jtag_execute_queue() will still return an error code.
All jtag_add_xxx() calls that have in_handler != NULL will have been executed when this fn returns, but if what has been queued only clocks data out, without reading anything back, then JTAG could be running after jtag_execute_queue() returns. The API does not define a way to flush a hw FIFO that runs after jtag_execute_queue() returns.
jtag_add_xxx() commands can either be executed immediately or at some time between the jtag_add_xxx() fn call and jtag_execute_queue().
Definition at line 1037 of file jtag/core.c.
References jtag_error_clear(), and jtag_execute_queue_noclear().
Referenced by adapter_resets(), adbg_burst_command(), adbg_ctrl_read(), adbg_ctrl_write(), adbg_select_ctrl_reg(), adbg_select_module(), adbg_wb_burst_read(), adbg_wb_burst_write(), adi_jtag_dp_scan_cmd_sync(), adi_jtag_scan_inout_check_u32(), arc_jtag_read_memory(), arc_jtag_read_registers(), arc_jtag_startup(), arc_jtag_status(), arc_jtag_write_memory(), arc_jtag_write_registers(), arm11_add_debug_scan_n(), arm11_examine(), arm11_halt(), arm11_read_dscr(), arm11_resume(), arm11_run_instr_data_from_core(), arm11_run_instr_data_to_core(), arm11_run_instr_data_to_core_noack(), arm11_run_instr_data_to_core_noack_inner(), arm11_run_instr_no_data(), arm11_sc7_run(), arm11_step(), arm11_write_dscr(), arm720t_disable_mmu_caches(), arm720t_enable_mmu_caches(), arm720t_get_ttb(), arm720t_post_debug_entry(), arm720t_scan_cp15(), arm720t_soft_reset_halt(), arm7_9_clear_watchpoints(), arm7_9_debug_entry(), arm7_9_execute_sys_speed(), arm7_9_full_context(), arm7_9_handle_target_request(), arm7_9_poll(), arm7_9_read_core_reg(), arm7_9_read_memory(), arm7_9_restart_core(), arm7_9_set_breakpoint(), arm7_9_set_software_breakpoints(), arm7_9_set_watchpoint(), arm7_9_soft_reset_halt(), arm7_9_unset_breakpoint(), arm7_9_unset_watchpoint(), arm7_9_write_core_reg(), arm7_9_write_memory(), arm7tdmi_change_to_arm(), arm7tdmi_clock_data_in(), arm7tdmi_clock_data_in_endianness(), arm7tdmi_examine_debug_reason(), arm920t_disable_mmu_caches(), arm920t_enable_mmu_caches(), arm920t_execute_cp15(), arm920t_post_debug_entry(), arm920t_pre_restore_context(), arm920t_read_cp15_interpreted(), arm920t_read_cp15_physical(), arm920t_soft_reset_halt(), arm920t_write_cp15_interpreted(), arm926ejs_cp15_read(), arm926ejs_cp15_write(), arm926ejs_disable_mmu_caches(), arm926ejs_enable_mmu_caches(), arm926ejs_examine_debug_reason(), arm926ejs_post_debug_entry(), arm926ejs_soft_reset_halt(), arm946e_read_cp15(), arm946e_write_cp15(), arm966e_read_cp15(), arm9tdmi_change_to_arm(), arm9tdmi_clock_data_in(), arm9tdmi_clock_data_in_endianness(), arm9tdmi_clock_out(), arm9tdmi_examine_debug_reason(), avr32_jtag_mwa_read_data(), avr32_jtag_mwa_set_address(), avr32_jtag_mwa_write_data(), avr32_jtag_nexus_read_data(), avr32_jtag_nexus_set_address(), avr32_jtag_nexus_write_data(), avr32_jtag_set_instr(), COMMAND_HANDLER(), dbus_scan(), dmi_scan(), drscan(), dsp563xx_once_execute_dw_ir(), dsp563xx_once_execute_sw_ir(), dsp563xx_once_ir_exec(), dsp563xx_once_read_register(), dsp563xx_once_reg_read(), dsp563xx_once_reg_read_ex(), dsp563xx_once_reg_write(), dsp563xx_once_request_debug(), dsp563xx_once_target_status(), dsp563xx_read_memory_core(), dsp563xx_write_memory_core(), dsp5680xx_execute_queue(), dtmcontrol_scan(), dtmcontrol_scan_via_bscan(), efinix_load(), embeddedice_build_reg_cache(), embeddedice_handshake(), embeddedice_receive(), embeddedice_set_reg_w_exec(), embeddedice_setup(), esirisc_jtag_recv(), esirisc_jtag_send(), etb_get_reg(), etb_init(), etb_read_ram(), etb_read_trace(), etb_set_reg_w_exec(), etb_start_capture(), etb_status(), etm_get_reg(), etm_set_reg_w_exec(), etm_setup(), feroceon_change_to_arm(), feroceon_read_cp15(), fpga_configure(), gatemate_connect_spi_to_jtag(), gatemate_disconnect_spi_from_jtag(), gatemate_load(), gowin_disable_config(), gowin_enable_config(), gowin_erase_sram(), gowin_load_to_sram(), gowin_read_register(), gowin_reload(), gowin_runtest_idle(), idcode_scan(), intel_load(), ipdbg_jtag_transfer_bytes(), ipdbg_shift_data(), ipdbg_shift_empty_data(), ipdbg_shift_instr(), ipdbg_shift_vir(), irscan(), isc_data_read_out(), isc_enter(), isc_leave(), isc_program_register(), isc_read_register(), isc_set_register(), jtag_add_reset(), jtag_ap_q_abort(), jtag_examine_chain_execute(), jtag_init(), jtag_init_inner(), jtag_init_reset(), jtag_send_sequence(), jtag_validate_ircapture(), jtagdp_overrun_check(), jtagspi_cmd(), lakemont_reset_break(), lattice_certus_connect_spi_to_jtag(), lattice_certus_disconnect_spi_from_jtag(), lattice_certus_enable_programming(), lattice_certus_enable_transparent_mode(), lattice_certus_erase_device(), lattice_certus_exit_programming_mode(), lattice_certus_init_address(), lattice_certus_program_config_map(), lattice_certus_refresh(), lattice_ecp2_3_connect_spi_to_jtag(), lattice_ecp2_3_disconnect_spi_from_jtag(), lattice_ecp2_3_exit_programming_mode(), lattice_ecp2_3_program_config_map(), lattice_ecp2_3_refresh(), lattice_ecp2_3_write_usercode(), lattice_ecp5_connect_spi_to_jtag(), lattice_ecp5_disconnect_spi_from_jtag(), lattice_ecp5_enable_sram_programming(), lattice_ecp5_erase_sram(), lattice_ecp5_exit_programming_mode(), lattice_ecp5_init_address(), lattice_ecp5_program_config_map(), lattice_ecp5_refresh(), lattice_ecp5_write_usercode(), lattice_preload(), lattice_read_u32_register(), lattice_read_u64_register(), legacy_jtag_add_reset(), ls1_sap_read_memory(), mcu_execute_queue(), mips32_pracc_exec(), mips32_pracc_fastdata_xfer(), mips32_pracc_queue_exec(), mips64_pracc_exec_read(), mips64_pracc_exec_write(), mips64_pracc_fastdata_xfer(), mips_ejtag_drscan_32(), mips_ejtag_drscan_64(), mips_ejtag_drscan_8(), or1k_adv_jtag_jsp_xfer(), or1k_tap_vjtag_init(), or1k_tap_xilinx_bscan_init(), read_memory_bus_v1(), reset_jtag(), riscv_batch_run(), scans_execute(), str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_isc_status(), str9xpec_lock_device(), str9xpec_read_config(), str9xpec_write(), str9xpec_write_options(), svf_execute_tap(), virtex2_load(), virtex2_load_cleanup(), virtex2_load_prepare(), virtex2_program(), virtex2_read_stat(), xcf_erase_check(), xscale_assert_reset(), xscale_deassert_reset(), xscale_load_ic(), xscale_read_dcsr(), xscale_read_tx(), xscale_receive(), xscale_send(), xscale_write_dcsr(), and xscale_write_rx().
void jtag_execute_queue_noclear | ( | void | ) |
same as jtag_execute_queue() but does not clear the error flag
Definition at line 1018 of file jtag/core.c.
References interface_jtag_execute_queue(), jtag_flush_queue_count, jtag_flush_queue_sleep, and jtag_set_error().
Referenced by arm11_add_debug_scan_n(), jtag_check_value_mask(), and jtag_execute_queue().
unsigned int jtag_get_flush_queue_count | ( | void | ) |
Definition at line 1032 of file jtag/core.c.
References jtag_flush_queue_count.
Referenced by COMMAND_HANDLER().
unsigned int jtag_get_nsrst_assert_width | ( | void | ) |
Definition at line 1773 of file jtag/core.c.
References adapter_nsrst_assert_width.
Referenced by COMMAND_HANDLER().
unsigned int jtag_get_nsrst_delay | ( | void | ) |
Definition at line 1756 of file jtag/core.c.
References adapter_nsrst_delay.
Referenced by COMMAND_HANDLER().
unsigned int jtag_get_ntrst_assert_width | ( | void | ) |
Definition at line 1781 of file jtag/core.c.
References jtag_ntrst_assert_width.
Referenced by COMMAND_HANDLER().
unsigned int jtag_get_ntrst_delay | ( | void | ) |
Definition at line 1764 of file jtag/core.c.
References jtag_ntrst_delay.
Referenced by COMMAND_HANDLER().
enum reset_types jtag_get_reset_config | ( | void | ) |
Definition at line 1725 of file jtag/core.c.
References ERROR_OK, adapter_driver::srst_asserted, and srst_asserted.
Referenced by aarch64_assert_reset(), amt_jtagaccel_init(), arc_assert_reset(), arc_halt(), arm11_assert_reset(), arm7_9_assert_reset(), arm7_9_deassert_reset(), avr32_ap7k_halt(), bitq_execute_queue(), cmsis_dap_init(), COMMAND_HANDLER(), cortex_a_assert_reset(), cortex_m_assert_reset(), cortex_m_deassert_reset(), dapdirect_init(), dsp563xx_assert_reset(), dummy_reset(), esirisc_assert_reset(), esirisc_deassert_reset(), ftdi_reset(), hl_assert_reset(), hl_deassert_reset(), hl_interface_open(), mips_m4k_assert_reset(), mips_m4k_halt(), mips_mips64_assert_reset(), mips_mips64_halt(), or1k_halt(), rlink_execute_queue(), stlink_dap_init(), stlink_dap_op_connect(), stm8_examine(), stm8_reset_assert(), stm8_reset_deassert(), swd_connect(), and sync_adapter_reset_with_gpios().
int jtag_get_srst | ( | void | ) |
Definition at line 1747 of file jtag/core.c.
References jtag_srst.
Referenced by arc_halt(), avr32_ap7k_halt(), COMMAND_HANDLER(), mips_m4k_halt(), mips_mips64_halt(), and or1k_halt().
int jtag_get_trst | ( | void | ) |
Definition at line 1743 of file jtag/core.c.
References jtag_trst.
Referenced by COMMAND_HANDLER().
int jtag_init | ( | struct command_context * | cmd_ctx | ) |
Initialize JTAG chain using only a RESET reset.
If init fails, try reset + init.
Definition at line 1664 of file jtag/core.c.
References adapter_init(), ERROR_FAIL, ERROR_OK, command_context::interp, jtag_add_reset(), jtag_execute_queue(), jtag_reset_config, LOG_WARNING, RESET_CNCT_UNDER_SRST, and RESET_SRST_NO_GATING.
Referenced by COMMAND_HANDLER().
int jtag_init_inner | ( | struct command_context * | cmd_ctx | ) |
Definition at line 1503 of file jtag/core.c.
References ERROR_OK, jtag_add_tlr(), jtag_examine_chain(), jtag_execute_queue(), jtag_notify_event(), JTAG_TAP_EVENT_SETUP, jtag_tap_next_enabled(), jtag_validate_ircapture(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, and NULL.
Referenced by COMMAND_HANDLER(), and jtag_init_reset().
int jtag_init_reset | ( | struct command_context * | cmd_ctx | ) |
reset, then initialize JTAG chain
Definition at line 1600 of file jtag/core.c.
References adapter_init(), ERROR_OK, jtag_add_reset(), jtag_execute_queue(), jtag_init_inner(), jtag_reset_config, LOG_DEBUG, LOG_WARNING, RESET_CNCT_UNDER_SRST, RESET_HAS_SRST, RESET_SRST_NO_GATING, and RESET_SRST_PULLS_TRST.
Referenced by COMMAND_HANDLER().
void jtag_notify_event | ( | enum | jtag_event | ) |
Report Tcl event to all TAPs.
Definition at line 783 of file jtag/tcl.c.
References jtag_all_taps(), jtag_tap_handle_event(), and jtag_tap::next_tap.
Referenced by jtag_add_reset(), jtag_add_tlr(), jtag_init_inner(), and legacy_jtag_add_reset().
bool jtag_poll_get_enabled | ( | void | ) |
Return flag reporting whether JTAG polling is disallowed.
Definition at line 160 of file jtag/core.c.
References jtag_poll.
Referenced by COMMAND_HANDLER().
bool jtag_poll_mask | ( | void | ) |
Mask (disable) polling and return the current mask status that should be feed to jtag_poll_unmask() to restore it.
Multiple nested calls to jtag_poll_mask() are allowed, each balanced with its call to jtag_poll_unmask().
Definition at line 170 of file jtag/core.c.
References jtag_poll_en.
Referenced by COMMAND_HANDLER(), jim_capture(), target_process_reset(), and target_resume().
void jtag_poll_set_enabled | ( | bool | value | ) |
Assign flag reporting whether JTAG polling is disallowed.
Definition at line 165 of file jtag/core.c.
References jtag_poll.
Referenced by COMMAND_HANDLER().
void jtag_poll_unmask | ( | bool | saved | ) |
Restore saved mask for polling.
Definition at line 177 of file jtag/core.c.
References jtag_poll_en.
Referenced by COMMAND_HANDLER(), jim_capture(), target_process_reset(), and target_resume().
int jtag_power_dropout | ( | int * | dropout | ) |
Definition at line 1710 of file jtag/core.c.
References ERROR_OK, is_adapter_initialized(), LOG_ERROR, and adapter_driver::power_dropout.
Referenced by sense_handler().
int jtag_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 1209 of file jtag/tcl.c.
References jtag_command_handlers, NULL, and register_commands().
Referenced by jtag_select().
int jtag_register_event_callback | ( | jtag_event_handler_t | f, |
void * | x | ||
) |
Definition at line 282 of file jtag/core.c.
References jtag_event_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_event_callbacks, NULL, and priv.
Referenced by arm_jtag_setup_connection(), jtag_tap_init(), and target_examine().
void jtag_set_error | ( | int | error | ) |
Set the current JTAG core execution error, unless one was set by a previous call previously.
Driver or application code must use jtag_error_clear to reset jtag_error once this routine has been called with a non-zero error code.
Definition at line 123 of file jtag/core.c.
References ERROR_OK, and jtag_error.
Referenced by arm11_in_handler_scan_n(), jtag_add_clocks(), jtag_add_dr_scan(), jtag_add_ir_scan_noverify(), jtag_add_pathmove(), jtag_add_plain_dr_scan(), jtag_add_plain_ir_scan(), jtag_add_reset(), jtag_add_runtest(), jtag_add_sleep(), jtag_add_tlr(), jtag_add_tms_seq(), jtag_check_value_mask(), jtag_execute_queue_noclear(), and legacy_jtag_add_reset().
void jtag_set_flush_queue_sleep | ( | int | ms | ) |
Set ms to sleep after jtag_execute_queue() flushes queue.
Debug purposes.
Definition at line 118 of file jtag/core.c.
References jtag_flush_queue_sleep.
Referenced by COMMAND_HANDLER().
void jtag_set_nsrst_assert_width | ( | unsigned int | delay | ) |
Definition at line 1769 of file jtag/core.c.
References adapter_nsrst_assert_width.
Referenced by COMMAND_HANDLER().
void jtag_set_nsrst_delay | ( | unsigned int | delay | ) |
Definition at line 1752 of file jtag/core.c.
References adapter_nsrst_delay.
Referenced by COMMAND_HANDLER().
void jtag_set_ntrst_assert_width | ( | unsigned int | delay | ) |
Definition at line 1777 of file jtag/core.c.
References jtag_ntrst_assert_width.
Referenced by COMMAND_HANDLER().
void jtag_set_ntrst_delay | ( | unsigned int | delay | ) |
Definition at line 1760 of file jtag/core.c.
References jtag_ntrst_delay.
Referenced by COMMAND_HANDLER().
void jtag_set_reset_config | ( | enum reset_types | type | ) |
Definition at line 1738 of file jtag/core.c.
References jtag_reset_config, and type.
Referenced by COMMAND_HANDLER().
void jtag_set_verify | ( | bool | enable | ) |
Enable or disable data scan verification checking.
Definition at line 1690 of file jtag/core.c.
References jtag_verify.
Referenced by COMMAND_HANDLER().
void jtag_set_verify_capture_ir | ( | bool | enable | ) |
Enable or disable verification of IR scan checking.
Definition at line 1700 of file jtag/core.c.
References jtag_verify_capture_ir.
Referenced by COMMAND_HANDLER().
void jtag_sleep | ( | uint32_t | us | ) |
Definition at line 1062 of file jtag/core.c.
References alive_sleep().
Referenced by adapter_system_reset(), amt_jtagaccel_execute_queue(), armjtagew_execute_queue(), bitbang_sleep(), buspirate_execute_queue(), cmsis_dap_execute_sleep(), cortex_m_assert_reset(), esp_usb_jtag_sleep(), ftdi_execute_sleep(), gw16012_execute_queue(), jlink_execute_sleep(), jlink_init(), jtag_dpi_execute_queue(), jtag_vpi_execute_queue(), kitprog_generic_acquire(), kitprog_get_status(), opendous_execute_queue(), openjtag_execute_sleep(), osbdm_execute_command(), presto_bitq_sleep(), remote_bitbang_sleep(), rlink_execute_queue(), setup_sysfs_gpio(), ublast_usleep(), usbprog_execute_queue(), vsllink_execute_queue(), and xds110_execute_sleep().
int jtag_srst_asserted | ( | int * | srst_asserted | ) |
Definition at line 1725 of file jtag/core.c.
Referenced by COMMAND_HANDLER(), and sense_handler().
struct jtag_tap* jtag_tap_by_jim_obj | ( | Jim_Interp * | interp, |
Jim_Obj * | obj | ||
) |
Definition at line 53 of file jtag/tcl.c.
References jtag_tap_by_string(), and NULL.
Referenced by __COMMAND_HANDLER(), dap_configure(), and target_configure().
struct jtag_tap* jtag_tap_by_position | ( | unsigned int | abs_position | ) |
Definition at line 227 of file jtag/core.c.
References jtag_all_taps(), and jtag_tap::next_tap.
Referenced by FLASH_BANK_COMMAND_HANDLER(), jtag_tap_by_string(), and lakemont_reset_break().
struct jtag_tap* jtag_tap_by_string | ( | const char * | dotted_name | ) |
Definition at line 237 of file jtag/core.c.
References jtag_tap::dotted_name, ERROR_OK, jtag_all_taps(), jtag_tap_by_position(), LOG_WARNING, jtag_tap::next_tap, and NULL.
Referenced by __COMMAND_HANDLER(), COMMAND_HANDLER(), dsp5680xx_f_lock(), dsp5680xx_f_unlock(), dsp5680xx_irscan(), eonce_enter_debug_mode(), jtag_tap_by_jim_obj(), PLD_CREATE_COMMAND_HANDLER(), and switch_tap().
unsigned int jtag_tap_count | ( | void | ) |
Definition at line 189 of file jtag/core.c.
References jtag_all_taps(), and jtag_tap::next_tap.
Referenced by jtag_examine_chain().
unsigned int jtag_tap_count_enabled | ( | void | ) |
Definition at line 200 of file jtag/core.c.
References jtag_tap::enabled, jtag_all_taps(), and jtag_tap::next_tap.
Referenced by interface_jtag_add_ir_scan(), and jtagspi_cmd().
void jtag_tap_free | ( | struct jtag_tap * | tap | ) |
Definition at line 1481 of file jtag/core.c.
References jtag_tap_event_action::body, jtag_tap::chip, jtag_tap::cur_instr, jtag_tap::dotted_name, jtag_tap::event_action, jtag_tap::expected, jtag_tap::expected_ids, jtag_tap::expected_mask, jtag_tap_event_action::interp, jtag_reset_callback(), jtag_unregister_event_callback(), jtag_tap_event_action::next, and jtag_tap::tapname.
Referenced by adapter_quit().
void jtag_tap_init | ( | struct jtag_tap * | tap | ) |
Definition at line 1447 of file jtag/core.c.
References jtag_tap::abs_chain_position, buf_set_ones(), buf_set_u32(), jtag_tap::bypass, jtag_tap::cur_instr, DIV_ROUND_UP, jtag_tap::dotted_name, jtag_tap::expected, jtag_tap::expected_mask, jtag_tap::ir_capture_mask, jtag_tap::ir_capture_value, jtag_tap::ir_length, JTAG_IRLEN_MAX, jtag_register_event_callback(), jtag_reset_callback(), jtag_tap_add(), and LOG_DEBUG.
Referenced by __COMMAND_HANDLER(), COMMAND_HANDLER(), and jtag_examine_chain().
const char* jtag_tap_name | ( | const struct jtag_tap * | tap | ) |
Definition at line 276 of file jtag/core.c.
References jtag_tap::dotted_name.
Referenced by dap_init_all(), and jtag_validate_ircapture().
Definition at line 265 of file jtag/core.c.
References jtag_tap::enabled, jtag_all_taps(), jtag_tap::next_tap, and NULL.
Referenced by esirisc_jtag_get_padding(), interface_jtag_add_dr_scan(), interface_jtag_add_ir_scan(), jtag_examine_chain(), jtag_init_inner(), and jtag_validate_ircapture().
int jtag_unregister_event_callback | ( | jtag_event_handler_t | f, |
void * | x | ||
) |
Definition at line 303 of file jtag/core.c.
References jtag_event_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_event_callbacks, jtag_event_callback::next, and priv.
Referenced by arm_jtag_close_connection(), jtag_enable_callback(), jtag_tap_free(), and target_destroy().
bool jtag_will_verify | ( | void | ) |
Definition at line 1695 of file jtag/core.c.
References jtag_verify.
Referenced by COMMAND_HANDLER().
bool jtag_will_verify_capture_ir | ( | void | ) |
Definition at line 1705 of file jtag/core.c.
References jtag_verify_capture_ir.
Referenced by COMMAND_HANDLER().
tap_state_t tap_state_by_name | ( | const char * | name | ) |
Provides user-friendly name lookup of TAP states.
Definition at line 355 of file interface.c.
References ARRAY_SIZE, name, TAP_INVALID, and tap_name_mapping.
Referenced by COMMAND_HANDLER(), and reset_jtag().
const char* tap_state_name | ( | tap_state_t | state | ) |
Function tap_state_name Returns a string suitable for display representing the JTAG tap_state.
Definition at line 344 of file interface.c.
References ARRAY_SIZE, name_mapping::name, state, and tap_name_mapping.
Referenced by angie_queue_pathmove(), angie_set_end_state(), armjtagew_path_move(), bitbang_execute_queue(), bitbang_path_move(), bitq_path_move(), buspirate_execute_queue(), buspirate_path_move(), buspirate_runtest(), cmsis_dap_execute_scan(), cmsis_dap_pathmove(), cmsis_dap_state_move(), COMMAND_HANDLER(), default_interface_jtag_execute_queue(), dummy_reset(), dummy_write(), ftdi_end_state(), ftdi_execute_pathmove(), ftdi_execute_runtest(), ftdi_execute_scan(), ftdi_execute_sleep(), ftdi_execute_stableclocks(), ftdi_execute_statemove(), gw16012_path_move(), jlink_execute_scan(), jlink_path_move(), jtag_add_clocks(), jtag_add_pathmove(), jtag_add_statemove(), jtag_debug_state_machine_(), move_to_state(), opendous_path_move(), openjtag_execute_scan(), osbdm_add_pathmove(), osbdm_add_stableclocks(), rlink_path_move(), svf_add_statemove(), syncbb_path_move(), ublast_state_move(), ulink_queue_pathmove(), ulink_set_end_state(), usbprog_path_move(), usbprog_runtest(), vsllink_execute_queue(), vsllink_path_move(), xlnx_pcie_xvc_execute_pathmove(), xlnx_pcie_xvc_execute_scan(), and xlnx_pcie_xvc_execute_statemove().
|
extern |
The current TAP state of the pending JTAG command queue.
Definition at line 88 of file jtag/core.c.
Referenced by arm11_add_dr_scan_vc(), arm11_add_ir_scan_vc(), COMMAND_HANDLER(), jtag_add_clocks(), jtag_add_pathmove(), jtag_add_statemove(), jtag_add_tms_seq(), jtag_prelude(), and svf_add_statemove().