OpenOCD
|
This file implements support for the ARM CoreSight components Trace Port Interface Unit (TPIU) and Serial Wire Output (SWO). More...
Go to the source code of this file.
Data Structures | |
struct | arm_tpiu_swo_connection |
struct | arm_tpiu_swo_event_action |
struct | arm_tpiu_swo_object |
struct | arm_tpiu_swo_priv_connection |
Macros | |
#define | ARM_TPIU_SWO_TRACE_BUF_SIZE 4096 |
#define | MSG "DEPRECATED \'tpiu config\' command: " |
#define | TCP_SERVICE_NAME "tpiu_swo_trace" |
#define | TPIU_ACPR_MAX_PRESCALER 0x1fff |
#define | TPIU_ACPR_OFFSET 0x010 |
#define | TPIU_CSPSR_OFFSET 0x004 |
#define | TPIU_DEVID_NOSUPPORT_SYNC BIT(9) |
#define | TPIU_DEVID_OFFSET 0xfc8 |
#define | TPIU_DEVID_SUPPORT_MANCHESTER BIT(10) |
#define | TPIU_DEVID_SUPPORT_UART BIT(11) |
#define | TPIU_FFCR_OFFSET 0x304 |
#define | TPIU_FFSR_OFFSET 0x300 |
#define | TPIU_FSCR_OFFSET 0x308 |
#define | TPIU_SPPR_OFFSET 0x0F0 |
#define | TPIU_SPPR_PROTOCOL_MANCHESTER (TPIU_PIN_PROTOCOL_ASYNC_MANCHESTER) |
#define | TPIU_SPPR_PROTOCOL_SYNC (TPIU_PIN_PROTOCOL_SYNC) |
#define | TPIU_SPPR_PROTOCOL_UART (TPIU_PIN_PROTOCOL_ASYNC_UART) |
#define | TPIU_SSPSR_OFFSET 0x000 |
#define | TPIU_SWO_DEFAULT_BASE 0xE0040000 |
Enumerations | |
enum | arm_tpiu_swo_cfg_param { CFG_PORT_WIDTH , CFG_PROTOCOL , CFG_FORMATTER , CFG_TRACECLKIN , CFG_BITRATE , CFG_OUTFILE , CFG_EVENT } |
enum | arm_tpiu_swo_event { TPIU_SWO_EVENT_PRE_ENABLE , TPIU_SWO_EVENT_POST_ENABLE , TPIU_SWO_EVENT_PRE_DISABLE , TPIU_SWO_EVENT_POST_DISABLE } |
Functions | |
int | arm_tpiu_swo_cleanup_all (void) |
static void | arm_tpiu_swo_close_output (struct arm_tpiu_swo_object *obj) |
static int | arm_tpiu_swo_configure (struct jim_getopt_info *goi, struct arm_tpiu_swo_object *obj) |
static int | arm_tpiu_swo_create (Jim_Interp *interp, struct arm_tpiu_swo_object *obj) |
static int | arm_tpiu_swo_handle_event (struct arm_tpiu_swo_object *obj, enum arm_tpiu_swo_event event) |
static int | arm_tpiu_swo_poll_trace (void *priv) |
int | arm_tpiu_swo_register_commands (struct command_context *cmd_ctx) |
static int | arm_tpiu_swo_service_connection_closed (struct connection *connection) |
static int | arm_tpiu_swo_service_input (struct connection *connection) |
static int | arm_tpiu_swo_service_new_connection (struct connection *connection) |
COMMAND_HANDLER (handle_arm_tpiu_swo_disable) | |
COMMAND_HANDLER (handle_arm_tpiu_swo_enable) | |
COMMAND_HANDLER (handle_arm_tpiu_swo_event_list) | |
COMMAND_HANDLER (handle_arm_tpiu_swo_init) | |
COMMAND_HANDLER (handle_arm_tpiu_swo_names) | |
COMMAND_HANDLER (handle_tpiu_deprecated_config_command) | |
static int | jim_arm_tpiu_swo_configure (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
static int | jim_arm_tpiu_swo_create (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
static | LIST_HEAD (all_tpiu_swo) |
static int | wrap_read_u32 (struct target *target, struct adiv5_ap *tpiu_ap, target_addr_t address, uint32_t *value) |
static int | wrap_write_u32 (struct target *target, struct adiv5_ap *tpiu_ap, target_addr_t address, uint32_t value) |
Variables | |
const struct command_registration | arm_tpiu_deprecated_command_handlers [] |
static const struct command_registration | arm_tpiu_deprecated_subcommand_handlers [] |
static const struct command_registration | arm_tpiu_swo_command_handlers [] |
static const struct command_registration | arm_tpiu_swo_instance_command_handlers [] |
static const struct service_driver | arm_tpiu_swo_service_driver |
static const struct command_registration | arm_tpiu_swo_subcommand_handlers [] |
static const struct jim_nvp | nvp_arm_tpiu_swo_bool_opts [] |
static const struct jim_nvp | nvp_arm_tpiu_swo_config_opts [] |
static const struct jim_nvp | nvp_arm_tpiu_swo_event [] |
static const struct jim_nvp | nvp_arm_tpiu_swo_protocol_opts [] |
This file implements support for the ARM CoreSight components Trace Port Interface Unit (TPIU) and Serial Wire Output (SWO).
It also supports the CoreSight TPIU-Lite and the special TPIU version present with Cortex-M3 and Cortex-M4 (that includes SWO).
Definition in file arm_tpiu_swo.c.
#define ARM_TPIU_SWO_TRACE_BUF_SIZE 4096 |
Definition at line 131 of file arm_tpiu_swo.c.
#define MSG "DEPRECATED \'tpiu config\' command: " |
Definition at line 43 of file arm_tpiu_swo.c.
#define TCP_SERVICE_NAME "tpiu_swo_trace" |
Definition at line 46 of file arm_tpiu_swo.c.
#define TPIU_ACPR_MAX_PRESCALER 0x1fff |
Definition at line 60 of file arm_tpiu_swo.c.
#define TPIU_ACPR_OFFSET 0x010 |
Definition at line 53 of file arm_tpiu_swo.c.
#define TPIU_CSPSR_OFFSET 0x004 |
Definition at line 52 of file arm_tpiu_swo.c.
#define TPIU_DEVID_NOSUPPORT_SYNC BIT(9) |
Definition at line 64 of file arm_tpiu_swo.c.
#define TPIU_DEVID_OFFSET 0xfc8 |
Definition at line 58 of file arm_tpiu_swo.c.
#define TPIU_DEVID_SUPPORT_MANCHESTER BIT(10) |
Definition at line 65 of file arm_tpiu_swo.c.
#define TPIU_DEVID_SUPPORT_UART BIT(11) |
Definition at line 66 of file arm_tpiu_swo.c.
#define TPIU_FFCR_OFFSET 0x304 |
Definition at line 56 of file arm_tpiu_swo.c.
#define TPIU_FFSR_OFFSET 0x300 |
Definition at line 55 of file arm_tpiu_swo.c.
#define TPIU_FSCR_OFFSET 0x308 |
Definition at line 57 of file arm_tpiu_swo.c.
#define TPIU_SPPR_OFFSET 0x0F0 |
Definition at line 54 of file arm_tpiu_swo.c.
#define TPIU_SPPR_PROTOCOL_MANCHESTER (TPIU_PIN_PROTOCOL_ASYNC_MANCHESTER) |
Definition at line 62 of file arm_tpiu_swo.c.
#define TPIU_SPPR_PROTOCOL_SYNC (TPIU_PIN_PROTOCOL_SYNC) |
Definition at line 61 of file arm_tpiu_swo.c.
#define TPIU_SPPR_PROTOCOL_UART (TPIU_PIN_PROTOCOL_ASYNC_UART) |
Definition at line 63 of file arm_tpiu_swo.c.
#define TPIU_SSPSR_OFFSET 0x000 |
Definition at line 51 of file arm_tpiu_swo.c.
#define TPIU_SWO_DEFAULT_BASE 0xE0040000 |
Definition at line 49 of file arm_tpiu_swo.c.
Enumerator | |
---|---|
CFG_PORT_WIDTH | |
CFG_PROTOCOL | |
CFG_FORMATTER | |
CFG_TRACECLKIN | |
CFG_BITRATE | |
CFG_OUTFILE | |
CFG_EVENT |
Definition at line 313 of file arm_tpiu_swo.c.
enum arm_tpiu_swo_event |
Enumerator | |
---|---|
TPIU_SWO_EVENT_PRE_ENABLE | |
TPIU_SWO_EVENT_POST_ENABLE | |
TPIU_SWO_EVENT_PRE_DISABLE | |
TPIU_SWO_EVENT_POST_DISABLE |
Definition at line 68 of file arm_tpiu_swo.c.
int arm_tpiu_swo_cleanup_all | ( | void | ) |
Definition at line 209 of file arm_tpiu_swo.c.
References adapter_config_trace(), arm_tpiu_swo_object::ap, arm_tpiu_swo_close_output(), arm_tpiu_swo_handle_event(), arm_tpiu_swo_poll_trace(), arm_tpiu_swo_event_action::body, dap_put_ap(), arm_tpiu_swo_object::en_capture, arm_tpiu_swo_object::enabled, ERROR_OK, arm_tpiu_swo_object::event_action, arm_tpiu_swo_event_action::interp, lh(), list_for_each_entry_safe, LOG_ERROR, arm_tpiu_swo_object::name, arm_tpiu_swo_event_action::next, NULL, arm_tpiu_swo_object::out_filename, target_unregister_timer_callback(), TPIU_SWO_EVENT_POST_DISABLE, and TPIU_SWO_EVENT_PRE_DISABLE.
Referenced by openocd_main().
|
static |
Definition at line 199 of file arm_tpiu_swo.c.
References arm_tpiu_swo_object::file, NULL, arm_tpiu_swo_object::out_filename, remove_service(), and TCP_SERVICE_NAME.
Referenced by arm_tpiu_swo_cleanup_all(), and COMMAND_HANDLER().
|
static |
Definition at line 357 of file arm_tpiu_swo.c.
References adiv5_jim_mem_ap_spot_configure(), jim_getopt_info::argc, jim_getopt_info::argv, arm_tpiu_swo_event_action::body, CFG_BITRATE, CFG_EVENT, CFG_FORMATTER, CFG_OUTFILE, CFG_PORT_WIDTH, CFG_PROTOCOL, CFG_TRACECLKIN, arm_tpiu_swo_object::en_formatter, arm_tpiu_swo_object::enabled, arm_tpiu_swo_event_action::event, arm_tpiu_swo_object::event_action, jim_getopt_info::interp, arm_tpiu_swo_event_action::interp, jim_getopt_info::isconfigure, jim_getopt_nvp(), jim_getopt_nvp_unknown(), jim_getopt_obj(), jim_getopt_string(), jim_getopt_wide(), jim_nvp_value2name(), LOG_ERROR, jim_nvp::name, arm_tpiu_swo_object::name, arm_tpiu_swo_event_action::next, NULL, nvp_arm_tpiu_swo_bool_opts, nvp_arm_tpiu_swo_config_opts, nvp_arm_tpiu_swo_event, nvp_arm_tpiu_swo_protocol_opts, arm_tpiu_swo_object::out_filename, arm_tpiu_swo_object::pin_protocol, arm_tpiu_swo_object::port_width, arm_tpiu_swo_object::spot, arm_tpiu_swo_object::swo_pin_freq, arm_tpiu_swo_object::traceclkin_freq, and jim_nvp::value.
Referenced by jim_arm_tpiu_swo_configure(), and jim_arm_tpiu_swo_create().
|
static |
Definition at line 910 of file arm_tpiu_swo.c.
References arm_tpiu_swo_instance_command_handlers, cmd, COMMAND_ANY, COMMAND_REGISTRATION_DONE, current_command_context(), ERROR_OK, command_context::interp, arm_tpiu_swo_object::lh, list_add_tail(), command_registration::name, arm_tpiu_swo_object::name, NULL, and register_commands_with_data().
Referenced by jim_arm_tpiu_swo_create().
|
static |
Definition at line 163 of file arm_tpiu_swo.c.
References current_command_context(), command_context::current_target, ERROR_COMMAND_CLOSE_CONNECTION, ERROR_FAIL, ERROR_OK, arm_tpiu_swo_object::event_action, jim_nvp_value2name_simple(), LOG_DEBUG, LOG_USER, arm_tpiu_swo_object::name, name, arm_tpiu_swo_event_action::next, NULL, and nvp_arm_tpiu_swo_event.
Referenced by arm_tpiu_swo_cleanup_all(), and COMMAND_HANDLER().
|
static |
Definition at line 133 of file arm_tpiu_swo.c.
References adapter_poll_trace(), ARM_TPIU_SWO_TRACE_BUF_SIZE, arm_tpiu_swo_connection::connection, connection_write(), arm_tpiu_swo_object::connections, ERROR_FAIL, ERROR_OK, arm_tpiu_swo_object::file, lh(), list_for_each_entry, LOG_ERROR, NULL, arm_tpiu_swo_object::out_filename, priv, size, and target_call_trace_callbacks().
Referenced by arm_tpiu_swo_cleanup_all(), and COMMAND_HANDLER().
int arm_tpiu_swo_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 1232 of file arm_tpiu_swo.c.
Referenced by setup_command_handler().
|
static |
Definition at line 279 of file arm_tpiu_swo.c.
References arm_tpiu_swo_connection::connection, arm_tpiu_swo_object::connections, ERROR_FAIL, ERROR_OK, arm_tpiu_swo_connection::lh, lh(), list_del(), list_for_each_entry_safe, LOG_ERROR, priv, service::priv, and connection::service.
|
static |
Definition at line 263 of file arm_tpiu_swo.c.
References connection_read(), dummy, ERROR_OK, ERROR_SERVER_REMOTE_CLOSED, and LOG_ERROR.
|
static |
Definition at line 249 of file arm_tpiu_swo.c.
References arm_tpiu_swo_connection::connection, arm_tpiu_swo_object::connections, ERROR_FAIL, ERROR_OK, arm_tpiu_swo_connection::lh, list_add(), LOG_ERROR, priv, service::priv, and connection::service.
COMMAND_HANDLER | ( | handle_arm_tpiu_swo_disable | ) |
Definition at line 834 of file arm_tpiu_swo.c.
COMMAND_HANDLER | ( | handle_arm_tpiu_swo_enable | ) |
Definition at line 600 of file arm_tpiu_swo.c.
References adapter_config_trace(), add_service(), adiv5_dap_name(), arm_tpiu_swo_object::ap, adiv5_ap::ap_num, adiv5_mem_ap_spot::ap_num, arm_tpiu_swo_close_output(), arm_tpiu_swo_handle_event(), arm_tpiu_swo_poll_trace(), arm_tpiu_swo_service_driver, cortex_m_common::armv7m, adiv5_mem_ap_spot::base, BIT, CMD, CMD_ARGC, CMD_CTX, CMD_DATA, COMMAND_CONFIG, command_print(), CONNECTION_LIMIT_UNLIMITED, adiv5_mem_ap_spot::dap, dap_get_ap(), armv7m_common::debug_ap, arm_tpiu_swo_object::deferred_enable, arm_tpiu_swo_object::en_capture, arm_tpiu_swo_object::en_formatter, arm_tpiu_swo_object::enabled, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, arm_tpiu_swo_object::file, get_current_target(), jim_nvp_value2name_simple(), LOG_DEBUG, LOG_ERROR, LOG_INFO, MSG, jim_nvp::name, arm_tpiu_swo_object::name, NULL, nvp_arm_tpiu_swo_protocol_opts, arm_tpiu_swo_priv_connection::obj, arm_tpiu_swo_object::out_filename, arm_tpiu_swo_object::pin_protocol, arm_tpiu_swo_object::port_width, priv, arm_tpiu_swo_object::recheck_ap_cur_target, arm_tpiu_swo_object::spot, arm_tpiu_swo_object::swo_pin_freq, TARGET_EVENT_TRACE_CONFIG, target_handle_event(), target_name(), target_register_timer_callback(), TARGET_TIMER_TYPE_PERIODIC, target_to_cm(), target_type_name(), target_unregister_timer_callback(), target_was_examined(), TPIU_ACPR_MAX_PRESCALER, TPIU_ACPR_OFFSET, TPIU_CSPSR_OFFSET, TPIU_DEVID_NOSUPPORT_SYNC, TPIU_DEVID_OFFSET, TPIU_DEVID_SUPPORT_MANCHESTER, TPIU_DEVID_SUPPORT_UART, TPIU_FFCR_OFFSET, TPIU_SPPR_OFFSET, TPIU_SPPR_PROTOCOL_MANCHESTER, TPIU_SPPR_PROTOCOL_SYNC, TPIU_SPPR_PROTOCOL_UART, TPIU_SSPSR_OFFSET, TPIU_SWO_EVENT_POST_ENABLE, TPIU_SWO_EVENT_PRE_ENABLE, arm_tpiu_swo_object::traceclkin_freq, transport_is_hla(), jim_nvp::value, wrap_read_u32(), and wrap_write_u32().
COMMAND_HANDLER | ( | handle_arm_tpiu_swo_event_list | ) |
Definition at line 295 of file arm_tpiu_swo.c.
References CMD, CMD_DATA, command_print(), ERROR_OK, arm_tpiu_swo_object::event_action, jim_nvp_value2name_simple(), jim_nvp::name, arm_tpiu_swo_object::name, arm_tpiu_swo_event_action::next, NULL, and nvp_arm_tpiu_swo_event.
COMMAND_HANDLER | ( | handle_arm_tpiu_swo_init | ) |
Definition at line 1016 of file arm_tpiu_swo.c.
References CMD_ARGC, CMD_CTX, command_run_linef(), arm_tpiu_swo_object::deferred_enable, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, lh(), list_for_each_entry, LOG_DEBUG, and arm_tpiu_swo_object::name.
COMMAND_HANDLER | ( | handle_arm_tpiu_swo_names | ) |
Definition at line 1003 of file arm_tpiu_swo.c.
References CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, lh(), list_for_each_entry, and arm_tpiu_swo_object::name.
COMMAND_HANDLER | ( | handle_tpiu_deprecated_config_command | ) |
Definition at line 1037 of file arm_tpiu_swo.c.
|
static |
Definition at line 557 of file arm_tpiu_swo.c.
References jim_getopt_info::argc, jim_getopt_info::argv, arm_tpiu_swo_configure(), jim_getopt_info::interp, jim_getopt_info::isconfigure, jim_getopt_setup(), command::jim_handler_data, jim_to_command(), and command::name.
|
static |
Definition at line 947 of file arm_tpiu_swo.c.
References adiv5_mem_ap_spot_init(), adiv5_mem_ap_spot::ap_num, jim_getopt_info::argc, jim_getopt_info::argv, arm_tpiu_swo_configure(), arm_tpiu_swo_create(), adiv5_mem_ap_spot::base, arm_tpiu_swo_object::connections, adiv5_mem_ap_spot::dap, DP_APSEL_INVALID, INIT_LIST_HEAD(), jim_getopt_info::interp, jim_getopt_info::isconfigure, jim_getopt_obj(), jim_getopt_setup(), LOG_ERROR, arm_tpiu_swo_object::name, NULL, arm_tpiu_swo_object::out_filename, arm_tpiu_swo_object::port_width, arm_tpiu_swo_object::spot, and TPIU_SWO_DEFAULT_BASE.
|
static |
|
static |
Definition at line 582 of file arm_tpiu_swo.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 573 of file arm_tpiu_swo.c.
References mem_ap_write_atomic_u32(), target_write_u32(), and transport_is_hla().
Referenced by COMMAND_HANDLER().
const struct command_registration arm_tpiu_deprecated_command_handlers[] |
Definition at line 1037 of file arm_tpiu_swo.c.
|
static |
Definition at line 1037 of file arm_tpiu_swo.c.
|
static |
Definition at line 1037 of file arm_tpiu_swo.c.
|
static |
Definition at line 834 of file arm_tpiu_swo.c.
Referenced by arm_tpiu_swo_create().
|
static |
Definition at line 582 of file arm_tpiu_swo.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1037 of file arm_tpiu_swo.c.
|
static |
Definition at line 295 of file arm_tpiu_swo.c.
Referenced by arm_tpiu_swo_configure().
|
static |
Definition at line 295 of file arm_tpiu_swo.c.
Referenced by arm_tpiu_swo_configure().
|
static |
Definition at line 1 of file arm_tpiu_swo.c.
Referenced by arm_tpiu_swo_configure(), arm_tpiu_swo_handle_event(), and COMMAND_HANDLER().
|
static |
Definition at line 295 of file arm_tpiu_swo.c.
Referenced by arm_tpiu_swo_configure(), and COMMAND_HANDLER().