OpenOCD
|
Holds support for accessing JTAG-specific mechanisms from TCl scripts. More...
Go to the source code of this file.
Macros | |
#define | NTAP_OPT_BYPASS 7 |
#define | NTAP_OPT_DISABLED 4 |
#define | NTAP_OPT_ENABLED 3 |
#define | NTAP_OPT_EXPECTED_ID 5 |
#define | NTAP_OPT_IRBYPASS 8 |
#define | NTAP_OPT_IRCAPTURE 2 |
#define | NTAP_OPT_IRLEN 0 |
#define | NTAP_OPT_IRMASK 1 |
#define | NTAP_OPT_VERSION 6 |
Enumerations | |
enum | jtag_tap_cfg_param { JCFG_EVENT , JCFG_IDCODE } |
Functions | |
__COMMAND_HANDLER (handle_jtag_configure) | |
__COMMAND_HANDLER (handle_jtag_newtap) | |
__COMMAND_HANDLER (handle_jtag_tap_enabler) | |
COMMAND_HANDLER (handle_irscan_command) | |
COMMAND_HANDLER (handle_jtag_arp_init) | |
COMMAND_HANDLER (handle_jtag_arp_init_reset) | |
COMMAND_HANDLER (handle_jtag_command_drscan) | |
COMMAND_HANDLER (handle_jtag_command_pathmove) | |
COMMAND_HANDLER (handle_jtag_flush_count) | |
COMMAND_HANDLER (handle_jtag_flush_queue_sleep) | |
COMMAND_HANDLER (handle_jtag_init_command) | |
COMMAND_HANDLER (handle_jtag_names) | |
COMMAND_HANDLER (handle_jtag_ntrst_assert_width_command) | |
COMMAND_HANDLER (handle_jtag_ntrst_delay_command) | |
COMMAND_HANDLER (handle_jtag_rclk_command) | |
COMMAND_HANDLER (handle_runtest_command) | |
COMMAND_HANDLER (handle_scan_chain_command) | |
COMMAND_HANDLER (handle_tms_sequence_command) | |
COMMAND_HANDLER (handle_verify_ircapture_command) | |
COMMAND_HANDLER (handle_verify_jtag_command) | |
COMMAND_HANDLER (handle_wait_srst_deassert) | |
static | COMMAND_HELPER (handle_jtag_command_drscan_fields, struct scan_field *fields) |
static | COMMAND_HELPER (handle_jtag_newtap_args, struct jtag_tap *tap) |
void | jtag_notify_event (enum jtag_event event) |
Report Tcl event to all TAPs. More... | |
int | jtag_register_commands (struct command_context *cmd_ctx) |
struct jtag_tap * | jtag_tap_by_jim_obj (Jim_Interp *interp, Jim_Obj *o) |
static bool | jtag_tap_disable (struct jtag_tap *t) |
static bool | jtag_tap_enable (struct jtag_tap *t) |
static void | jtag_tap_handle_event (struct jtag_tap *tap, enum jtag_event e) |
static int | jtag_tap_set_event (struct command_context *cmd_ctx, struct jtag_tap *tap, const struct nvp *event, Jim_Obj *body) |
static bool | scan_is_safe (tap_state_t state) |
Variables | |
static const struct command_registration | jtag_command_handlers [] |
static const struct command_registration | jtag_command_handlers_to_move [] |
static const struct nvp | jtag_newtap_opts [] |
static const struct command_registration | jtag_subcommand_handlers [] |
static struct nvp | nvp_config_opts [] |
static const struct nvp | nvp_jtag_tap_event [] |
Holds support for accessing JTAG-specific mechanisms from TCl scripts.
Definition in file jtag/tcl.c.
#define NTAP_OPT_BYPASS 7 |
Definition at line 372 of file jtag/tcl.c.
#define NTAP_OPT_DISABLED 4 |
Definition at line 369 of file jtag/tcl.c.
#define NTAP_OPT_ENABLED 3 |
Definition at line 368 of file jtag/tcl.c.
#define NTAP_OPT_EXPECTED_ID 5 |
Definition at line 370 of file jtag/tcl.c.
#define NTAP_OPT_IRBYPASS 8 |
Definition at line 373 of file jtag/tcl.c.
#define NTAP_OPT_IRCAPTURE 2 |
Definition at line 367 of file jtag/tcl.c.
#define NTAP_OPT_IRLEN 0 |
Definition at line 365 of file jtag/tcl.c.
#define NTAP_OPT_IRMASK 1 |
Definition at line 366 of file jtag/tcl.c.
#define NTAP_OPT_VERSION 6 |
Definition at line 371 of file jtag/tcl.c.
enum jtag_tap_cfg_param |
Enumerator | |
---|---|
JCFG_EVENT | |
JCFG_IDCODE |
Definition at line 260 of file jtag/tcl.c.
__COMMAND_HANDLER | ( | handle_jtag_configure | ) |
Definition at line 305 of file jtag/tcl.c.
References jtag_tap_event_action::body, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_JIMTCL_ARGV, CMD_NAME, command_print(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, jtag_tap_event_action::event, jtag_tap::event_action, jtag_tap::idcode, JCFG_EVENT, JCFG_IDCODE, jtag_tap_by_jim_obj(), jtag_tap_set_event(), nvp::name, jtag_tap_event_action::next, NULL, nvp_config_opts, nvp_jtag_tap_event, nvp_name2value(), nvp_unknown_command_print(), and nvp::value.
__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.
__COMMAND_HANDLER | ( | handle_jtag_tap_enabler | ) |
Definition at line 630 of file jtag/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_NAME, command_print(), jtag_tap::dotted_name, jtag_tap::enabled, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, jtag_tap_by_string(), jtag_tap_disable(), and jtag_tap_enable().
COMMAND_HANDLER | ( | handle_irscan_command | ) |
Definition at line 917 of file jtag/tcl.c.
References buf_set_u64(), CMD, CMD_ARGC, CMD_ARGV, command_print(), DIV_ROUND_UP, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_tap::ir_length, jtag_add_ir_scan(), jtag_execute_queue(), jtag_tap_by_string(), LOG_ERROR, LOG_WARNING, NULL, scan_field::num_bits, scan_field::out_value, scan_is_safe(), TAP_IDLE, TAP_INVALID, and tap_state_by_name().
COMMAND_HANDLER | ( | handle_jtag_arp_init | ) |
Definition at line 577 of file jtag/tcl.c.
References CMD_ARGC, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, and jtag_init_inner().
COMMAND_HANDLER | ( | handle_jtag_arp_init_reset | ) |
Definition at line 585 of file jtag/tcl.c.
References CMD_ARGC, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_init_reset(), swd_init_reset(), transport_is_jtag(), and transport_is_swd().
COMMAND_HANDLER | ( | handle_jtag_command_drscan | ) |
Definition at line 102 of file jtag/tcl.c.
References buf_to_hex_str(), jtag_tap::bypass, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), jtag_tap_by_string(), LOG_ERROR, LOG_WARNING, scan_field::num_bits, scan_is_safe(), TAP_IDLE, and tap_state_by_name().
COMMAND_HANDLER | ( | handle_jtag_command_pathmove | ) |
Definition at line 177 of file jtag/tcl.c.
References ARRAY_SIZE, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_add_pathmove(), jtag_add_statemove(), jtag_execute_queue(), and tap_state_by_name().
COMMAND_HANDLER | ( | handle_jtag_flush_count | ) |
Definition at line 210 of file jtag/tcl.c.
References CMD, CMD_ARGC, command_print_sameline(), count, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and jtag_get_flush_queue_count().
COMMAND_HANDLER | ( | handle_jtag_flush_queue_sleep | ) |
Definition at line 1056 of file jtag/tcl.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_set_flush_queue_sleep(), and sleep_ms.
COMMAND_HANDLER | ( | handle_jtag_init_command | ) |
Definition at line 673 of file jtag/tcl.c.
References CMD_ARGC, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_init(), LOG_DEBUG, and LOG_INFO.
COMMAND_HANDLER | ( | handle_jtag_names | ) |
Definition at line 662 of file jtag/tcl.c.
References CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_all_taps(), and jtag_tap::next_tap.
COMMAND_HANDLER | ( | handle_jtag_ntrst_assert_width_command | ) |
Definition at line 855 of file jtag/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_get_ntrst_assert_width(), and jtag_set_ntrst_assert_width().
COMMAND_HANDLER | ( | handle_jtag_ntrst_delay_command | ) |
Definition at line 841 of file jtag/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_get_ntrst_delay(), and jtag_set_ntrst_delay().
COMMAND_HANDLER | ( | handle_jtag_rclk_command | ) |
Definition at line 869 of file jtag/tcl.c.
References adapter_config_rclk(), adapter_get_speed_khz(), adapter_get_speed_readable(), CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | handle_runtest_command | ) |
Definition at line 897 of file jtag/tcl.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, jtag_add_runtest(), jtag_execute_queue(), and TAP_IDLE.
COMMAND_HANDLER | ( | handle_scan_chain_command | ) |
Definition at line 792 of file jtag/tcl.c.
References jtag_tap::abs_chain_position, buf_get_u32(), CMD, command_print(), jtag_tap::dotted_name, jtag_tap::enabled, ERROR_OK, jtag_tap::expected, jtag_tap::expected_ids, jtag_tap::expected_ids_cnt, jtag_tap::expected_mask, jtag_tap::idcode, jtag_tap::ignore_version, jtag_tap::ir_length, jtag_all_taps(), and jtag_tap::next_tap.
COMMAND_HANDLER | ( | handle_tms_sequence_command | ) |
Definition at line 1033 of file jtag/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, tap_use_new_tms_table(), and tap_uses_new_tms_table().
COMMAND_HANDLER | ( | handle_verify_ircapture_command | ) |
Definition at line 999 of file jtag/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_set_verify_capture_ir(), jtag_will_verify_capture_ir(), and status.
COMMAND_HANDLER | ( | handle_verify_jtag_command | ) |
Definition at line 1016 of file jtag/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ENABLE, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_set_verify(), jtag_will_verify(), and status.
COMMAND_HANDLER | ( | handle_wait_srst_deassert | ) |
Definition at line 1069 of file jtag/tcl.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, jtag_srst_asserted(), LOG_ERROR, LOG_USER, and timeval_ms().
|
static |
Definition at line 77 of file jtag/tcl.c.
References bits, CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, scan_field::in_value, LOG_ERROR, scan_field::num_bits, and scan_field::out_value.
|
static |
Definition at line 388 of file jtag/tcl.c.
References alloc_printf(), jtag_tap::chip, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), jtag_tap::disabled_after_reset, jtag_tap::dotted_name, jtag_tap::enabled, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, jtag_tap::expected_ids, jtag_tap::expected_ids_cnt, id, jtag_tap::ignore_bypass, jtag_tap::ignore_version, jtag_tap::ir_bypass_value, jtag_tap::ir_capture_mask, jtag_tap::ir_capture_value, jtag_tap::ir_length, jtag_newtap_opts, LOG_DEBUG, LOG_ERROR, LOG_WARNING, NTAP_OPT_BYPASS, NTAP_OPT_DISABLED, NTAP_OPT_ENABLED, NTAP_OPT_EXPECTED_ID, NTAP_OPT_IRBYPASS, NTAP_OPT_IRCAPTURE, NTAP_OPT_IRLEN, NTAP_OPT_IRMASK, NTAP_OPT_VERSION, NULL, nvp_name2value(), nvp_unknown_command_print(), jtag_tap::tapname, transport_is_jtag(), and nvp::value.
void jtag_notify_event | ( | enum jtag_event | 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().
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().
struct jtag_tap* jtag_tap_by_jim_obj | ( | Jim_Interp * | interp, |
Jim_Obj * | o | ||
) |
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().
|
static |
Definition at line 614 of file jtag/tcl.c.
References jtag_tap::enabled, jtag_call_event_callbacks(), JTAG_TAP_EVENT_DISABLE, and jtag_tap_handle_event().
Referenced by __COMMAND_HANDLER().
|
static |
Definition at line 599 of file jtag/tcl.c.
References jtag_tap::enabled, jtag_call_event_callbacks(), JTAG_TAP_EVENT_ENABLE, and jtag_tap_handle_event().
Referenced by __COMMAND_HANDLER().
|
static |
Definition at line 536 of file jtag/tcl.c.
References jtag_tap_event_action::body, jtag_tap::dotted_name, jtag_tap::enabled, jtag_tap_event_action::event, jtag_tap::event_action, jtag_tap_event_action::interp, JTAG_TAP_EVENT_DISABLE, JTAG_TAP_EVENT_ENABLE, LOG_DEBUG, LOG_INFO, LOG_USER, nvp::name, jtag_tap_event_action::next, NULL, nvp_jtag_tap_event, and nvp_value2name().
Referenced by jtag_notify_event(), jtag_tap_disable(), and jtag_tap_enable().
|
static |
Definition at line 272 of file jtag/tcl.c.
References jtag_tap_event_action::body, ERROR_FAIL, ERROR_OK, jtag_tap_event_action::event, jtag_tap::event_action, command_context::interp, jtag_tap_event_action::interp, LOG_ERROR, and jtag_tap_event_action::next.
Referenced by __COMMAND_HANDLER().
|
static |
Definition at line 64 of file jtag/tcl.c.
References state, TAP_DRPAUSE, TAP_IDLE, TAP_IRPAUSE, and TAP_RESET.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1069 of file jtag/tcl.c.
Referenced by jtag_register_commands().
|
static |
Definition at line 210 of file jtag/tcl.c.
|
static |
Definition at line 305 of file jtag/tcl.c.
Referenced by COMMAND_HELPER().
|
static |
Definition at line 673 of file jtag/tcl.c.
|
static |
Definition at line 210 of file jtag/tcl.c.
Referenced by __COMMAND_HANDLER().
|
static |
Definition at line 1 of file jtag/tcl.c.
Referenced by __COMMAND_HANDLER(), and jtag_tap_handle_event().