OpenOCD
etb.c File Reference
Include dependency graph for etb.c:

Go to the source code of this file.

Functions

 COMMAND_HANDLER (handle_etb_config_command)
 
 COMMAND_HANDLER (handle_etb_trigger_percent_command)
 
struct reg_cacheetb_build_reg_cache (struct etb *etb)
 
static int etb_get_reg (struct reg *reg)
 
static void etb_getbuf (jtag_callback_data_t arg)
 
static int etb_init (struct etm_context *etm_ctx)
 
static int etb_read_ram (struct etb *etb, uint32_t *data, int num_frames)
 
static int etb_read_reg (struct reg *reg)
 
static int etb_read_reg_w_check (struct reg *, uint8_t *, uint8_t *)
 
static int etb_read_trace (struct etm_context *etm_ctx)
 
static int etb_scann (struct etb *etb, uint32_t new_scan_chain)
 
static int etb_set_instr (struct etb *etb, uint32_t new_instr)
 
static int etb_set_reg (struct reg *reg, uint32_t value)
 
static int etb_set_reg_w_exec (struct reg *, uint8_t *)
 
static int etb_start_capture (struct etm_context *etm_ctx)
 
static trace_status_t etb_status (struct etm_context *etm_ctx)
 
static int etb_stop_capture (struct etm_context *etm_ctx)
 
static int etb_write_reg (struct reg *, uint32_t)
 

Variables

struct etm_capture_driver etb_capture_driver
 
static const struct command_registration etb_command_handlers []
 
static const struct command_registration etb_config_command_handlers []
 
static const char *const etb_reg_list []
 
static const struct reg_arch_type etb_reg_type
 

Function Documentation

◆ COMMAND_HANDLER() [1/2]

◆ COMMAND_HANDLER() [2/2]

◆ etb_build_reg_cache()

◆ etb_get_reg()

static int etb_get_reg ( struct reg reg)
static

Definition at line 89 of file etb.c.

References ERROR_OK, etb_read_reg(), jtag_execute_queue(), and LOG_ERROR.

Referenced by etb_status().

◆ etb_getbuf()

static void etb_getbuf ( jtag_callback_data_t  arg)
static

Definition at line 148 of file etb.c.

References buf_get_u32().

Referenced by etb_read_ram().

◆ etb_init()

◆ etb_read_ram()

static int etb_read_ram ( struct etb etb,
uint32_t *  data,
int  num_frames 
)
static

◆ etb_read_reg()

static int etb_read_reg ( struct reg reg)
static

Definition at line 84 of file etb.c.

References etb_read_reg_w_check(), and NULL.

Referenced by etb_get_reg(), etb_init(), etb_read_trace(), and etb_status().

◆ etb_read_reg_w_check()

static int etb_read_reg_w_check ( struct reg reg,
uint8_t *  check_value,
uint8_t *  check_mask 
)
static

◆ etb_read_trace()

◆ etb_scann()

static int etb_scann ( struct etb etb,
uint32_t  new_scan_chain 
)
static

◆ etb_set_instr()

◆ etb_set_reg()

static int etb_set_reg ( struct reg reg,
uint32_t  value 
)
static

Definition at line 253 of file etb.c.

References buf_set_u32(), reg::dirty, ERROR_OK, etb_write_reg(), LOG_ERROR, reg::size, reg::valid, and reg::value.

Referenced by etb_set_reg_w_exec().

◆ etb_set_reg_w_exec()

static int etb_set_reg_w_exec ( struct reg reg,
uint8_t *  buf 
)
static

Definition at line 270 of file etb.c.

References buf_get_u32(), ERROR_OK, etb_set_reg(), jtag_execute_queue(), LOG_ERROR, and reg::size.

◆ etb_start_capture()

◆ etb_status()

◆ etb_stop_capture()

static int etb_stop_capture ( struct etm_context etm_ctx)
static

Definition at line 671 of file etb.c.

◆ etb_write_reg()

static int etb_write_reg ( struct reg reg,
uint32_t  value 
)
static

Variable Documentation

◆ etb_capture_driver

struct etm_capture_driver etb_capture_driver
Initial value:
= {
.name = "etb",
.commands = etb_command_handlers,
.init = etb_init,
.status = etb_status,
.start_capture = etb_start_capture,
.stop_capture = etb_stop_capture,
.read_trace = etb_read_trace,
}
static int etb_stop_capture(struct etm_context *etm_ctx)
Definition: etb.c:671
static const struct command_registration etb_command_handlers[]
Definition: etb.c:427
static int etb_read_trace(struct etm_context *etm_ctx)
Definition: etb.c:509
static int etb_init(struct etm_context *etm_ctx)
Definition: etb.c:438
static trace_status_t etb_status(struct etm_context *etm_ctx)
Definition: etb.c:457
static int etb_start_capture(struct etm_context *etm_ctx)
Definition: etb.c:639

Definition at line 671 of file etb.c.

Referenced by COMMAND_HANDLER().

◆ etb_command_handlers

const struct command_registration etb_command_handlers[]
static
Initial value:
= {
{
.name = "etb",
.mode = COMMAND_ANY,
.help = "Embedded Trace Buffer command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration etb_config_command_handlers[]
Definition: etb.c:406
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235

Definition at line 364 of file etb.c.

◆ etb_config_command_handlers

const struct command_registration etb_config_command_handlers[]
static
Initial value:
= {
{
.name = "config",
.handler = handle_etb_config_command,
.mode = COMMAND_CONFIG,
.help = "Associate ETB with target and JTAG TAP.",
.usage = "target tap",
},
{
.name = "trigger_percent",
.handler = handle_etb_trigger_percent_command,
.mode = COMMAND_EXEC,
.help = "Set percent of trace buffer to be filled "
"after the trigger occurs (2..100).",
.usage = "[percent]",
},
}
@ COMMAND_CONFIG
Definition: command.h:41
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 364 of file etb.c.

◆ etb_reg_list

const char* const etb_reg_list[]
static
Initial value:
= {
"ETB_identification",
"ETB_ram_depth",
"ETB_ram_width",
"ETB_status",
"ETB_ram_data",
"ETB_ram_read_pointer",
"ETB_ram_write_pointer",
"ETB_trigger_counter",
"ETB_control",
}

Definition at line 17 of file etb.c.

Referenced by etb_build_reg_cache().

◆ etb_reg_type

const struct reg_arch_type etb_reg_type
static
Initial value:
= {
.get = etb_get_reg,
}
static int etb_set_reg_w_exec(struct reg *, uint8_t *)
Definition: etb.c:270
static int etb_get_reg(struct reg *reg)
Definition: etb.c:89

Definition at line 89 of file etb.c.

Referenced by etb_build_reg_cache().