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_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_irscan_command) | |
COMMAND_HANDLER (handle_jtag_flush_queue_sleep) | |
COMMAND_HANDLER (handle_jtag_init_command) | |
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 int | is_bad_irval (int ir_length, jim_wide w) |
static int | jim_command_drscan (Jim_Interp *interp, int argc, Jim_Obj *const *args) |
static int | jim_command_flush_count (Jim_Interp *interp, int argc, Jim_Obj *const *args) |
static int | jim_command_pathmove (Jim_Interp *interp, int argc, Jim_Obj *const *args) |
static int | jim_jtag_arp_init (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
static int | jim_jtag_arp_init_reset (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
int | jim_jtag_configure (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
static int | jim_jtag_names (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
int | jim_jtag_newtap (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
int | jim_jtag_tap_enabler (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
static int | jim_newtap_cmd (struct jim_getopt_info *goi) |
static int | jim_newtap_expected_id (struct jim_nvp *n, struct jim_getopt_info *goi, struct jtag_tap *tap) |
static int | jim_newtap_ir_param (struct jim_nvp *n, struct jim_getopt_info *goi, 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 int | jtag_tap_configure_cmd (struct jim_getopt_info *goi, struct jtag_tap *tap) |
static int | jtag_tap_configure_event (struct jim_getopt_info *goi, struct jtag_tap *tap) |
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 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 command_registration | jtag_subcommand_handlers [] |
static struct jim_nvp | nvp_config_opts [] |
static const struct jim_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 462 of file jtag/tcl.c.
#define NTAP_OPT_DISABLED 4 |
Definition at line 459 of file jtag/tcl.c.
#define NTAP_OPT_ENABLED 3 |
Definition at line 458 of file jtag/tcl.c.
#define NTAP_OPT_EXPECTED_ID 5 |
Definition at line 460 of file jtag/tcl.c.
#define NTAP_OPT_IRCAPTURE 2 |
Definition at line 457 of file jtag/tcl.c.
#define NTAP_OPT_IRLEN 0 |
Definition at line 455 of file jtag/tcl.c.
#define NTAP_OPT_IRMASK 1 |
Definition at line 456 of file jtag/tcl.c.
#define NTAP_OPT_VERSION 6 |
Definition at line 461 of file jtag/tcl.c.
enum jtag_tap_cfg_param |
Enumerator | |
---|---|
JCFG_EVENT | |
JCFG_IDCODE |
Definition at line 298 of file jtag/tcl.c.
COMMAND_HANDLER | ( | handle_irscan_command | ) |
Definition at line 1077 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_flush_queue_sleep | ) |
Definition at line 1216 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 835 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_ntrst_assert_width_command | ) |
Definition at line 1015 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 1001 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 1029 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 1057 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 949 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 1193 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 1159 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 1176 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 1229 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 422 of file jtag/tcl.c.
Referenced by jim_newtap_ir_param().
|
static |
Definition at line 75 of file jtag/tcl.c.
References bits, buf_to_hex_str(), DIV_ROUND_UP, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), jtag_tap_by_jim_obj(), LOG_WARNING, NULL, scan_field::num_bits, scan_field::out_value, scan_is_safe(), str_to_buf(), TAP_IDLE, and tap_state_by_name().
|
static |
Definition at line 253 of file jtag/tcl.c.
References jtag_get_flush_queue_count().
|
static |
Definition at line 216 of file jtag/tcl.c.
References ARRAY_SIZE, ERROR_OK, jtag_add_pathmove(), jtag_add_statemove(), jtag_execute_queue(), NULL, and tap_state_by_name().
|
static |
Definition at line 674 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, current_command_context(), ERROR_OK, command_context::interp, jim_getopt_info::interp, jim_getopt_setup(), and jtag_init_inner().
|
static |
Definition at line 692 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, current_command_context(), ERROR_OK, command_context::interp, jim_getopt_info::interp, jim_getopt_setup(), jtag_init_reset(), swd_init_reset(), transport_is_jtag(), and transport_is_swd().
int jim_jtag_configure | ( | Jim_Interp * | interp, |
int | argc, | ||
Jim_Obj *const * | argv | ||
) |
Definition at line 791 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, jim_getopt_info::interp, jim_getopt_info::isconfigure, jim_getopt_obj(), jim_getopt_setup(), jim_to_command(), jtag_tap_by_jim_obj(), jtag_tap_configure_cmd(), command::name, and NULL.
|
static |
Definition at line 815 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, jtag_tap::dotted_name, jim_getopt_info::interp, jim_getopt_setup(), jtag_all_taps(), jtag_tap::next_tap, and NULL.
int jim_jtag_newtap | ( | Jim_Interp * | interp, |
int | argc, | ||
Jim_Obj *const * | argv | ||
) |
Definition at line 715 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, jim_getopt_info::interp, jim_getopt_setup(), and jim_newtap_cmd().
int jim_jtag_tap_enabler | ( | Jim_Interp * | interp, |
int | argc, | ||
Jim_Obj *const * | argv | ||
) |
Definition at line 753 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, jtag_tap::dotted_name, jtag_tap::enabled, jim_getopt_info::interp, jim_getopt_setup(), jim_to_command(), jtag_tap_by_jim_obj(), jtag_tap_disable(), jtag_tap_enable(), LOG_ERROR, LOG_WARNING, and command::name.
|
static |
Definition at line 510 of file jtag/tcl.c.
References jim_getopt_info::argc, jtag_tap::chip, jtag_tap::disabled_after_reset, jtag_tap::dotted_name, jtag_tap::enabled, jtag_tap::ignore_bypass, jtag_tap::ignore_version, jim_getopt_info::interp, jtag_tap::ir_capture_mask, jtag_tap::ir_capture_value, jtag_tap::ir_length, jim_getopt_nvp(), jim_getopt_nvp_unknown(), jim_getopt_string(), jim_newtap_expected_id(), jim_newtap_ir_param(), jtag_tap_free(), jtag_tap_init(), LOG_DEBUG, jim_nvp::name, NTAP_OPT_BYPASS, NTAP_OPT_DISABLED, NTAP_OPT_ENABLED, NTAP_OPT_EXPECTED_ID, NTAP_OPT_IRCAPTURE, NTAP_OPT_IRLEN, NTAP_OPT_IRMASK, NTAP_OPT_VERSION, NULL, jtag_tap::tapname, transport_is_jtag(), and jim_nvp::value.
Referenced by jim_jtag_newtap().
|
static |
Definition at line 432 of file jtag/tcl.c.
References jtag_tap::expected_ids, jtag_tap::expected_ids_cnt, jim_getopt_info::interp, jim_getopt_wide(), and jim_nvp::name.
Referenced by jim_newtap_cmd().
|
static |
Definition at line 464 of file jtag/tcl.c.
References jtag_tap::dotted_name, jim_getopt_info::interp, jtag_tap::ir_capture_mask, jtag_tap::ir_capture_value, jtag_tap::ir_length, is_bad_irval(), jim_getopt_wide(), LOG_ERROR, LOG_WARNING, jim_nvp::name, NTAP_OPT_IRCAPTURE, NTAP_OPT_IRLEN, NTAP_OPT_IRMASK, and jim_nvp::value.
Referenced by jim_newtap_cmd().
void jtag_notify_event | ( | enum jtag_event | event | ) |
Report Tcl event to all TAPs.
Definition at line 940 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 1369 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 51 of file jtag/tcl.c.
References jtag_tap_by_string(), and NULL.
Referenced by dap_configure(), jim_command_drscan(), jim_jtag_configure(), jim_jtag_tap_enabler(), and target_configure().
|
static |
Definition at line 379 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, jtag_tap::idcode, jim_getopt_info::interp, jim_getopt_info::isconfigure, JCFG_EVENT, JCFG_IDCODE, jim_getopt_nvp(), jim_getopt_nvp_unknown(), jtag_tap_configure_event(), jim_nvp::name, nvp_config_opts, and jim_nvp::value.
Referenced by jim_jtag_configure().
|
static |
Definition at line 310 of file jtag/tcl.c.
References jim_getopt_info::argc, jim_getopt_info::argv, jtag_tap_event_action::body, jtag_tap_event_action::event, jtag_tap::event_action, jim_getopt_info::interp, jtag_tap_event_action::interp, jim_getopt_info::isconfigure, jim_getopt_nvp(), jim_getopt_nvp_unknown(), jim_getopt_obj(), jtag_tap_event_action::next, nvp_jtag_tap_event, and jim_nvp::value.
Referenced by jtag_tap_configure_cmd().
|
static |
Definition at line 737 of file jtag/tcl.c.
References jtag_tap::enabled, jtag_call_event_callbacks(), JTAG_TAP_EVENT_DISABLE, and jtag_tap_handle_event().
Referenced by jim_jtag_tap_enabler().
|
static |
Definition at line 722 of file jtag/tcl.c.
References jtag_tap::enabled, jtag_call_event_callbacks(), JTAG_TAP_EVENT_ENABLE, and jtag_tap_handle_event().
Referenced by jim_jtag_tap_enabler().
|
static |
Definition at line 633 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, jim_nvp_value2name_simple(), JTAG_TAP_EVENT_DISABLE, JTAG_TAP_EVENT_ENABLE, LOG_DEBUG, LOG_INFO, LOG_USER, jim_nvp::name, jtag_tap_event_action::next, NULL, and nvp_jtag_tap_event.
Referenced by jtag_notify_event(), jtag_tap_disable(), and jtag_tap_enable().
|
static |
Definition at line 62 of file jtag/tcl.c.
References state, TAP_DRPAUSE, TAP_IDLE, TAP_IRPAUSE, and TAP_RESET.
Referenced by COMMAND_HANDLER(), and jim_command_drscan().
|
static |
Definition at line 1229 of file jtag/tcl.c.
Referenced by jtag_register_commands().
|
static |
Definition at line 253 of file jtag/tcl.c.
|
static |
Definition at line 835 of file jtag/tcl.c.
|
static |
Definition at line 253 of file jtag/tcl.c.
Referenced by jtag_tap_configure_cmd().
|
static |
Definition at line 1 of file jtag/tcl.c.
Referenced by jtag_tap_configure_event(), and jtag_tap_handle_event().