32         .connect_under_reset = 
false,
 
   33         .use_stlink_tcp = 
false,
 
   34         .stlink_tcp_port = 7184,
 
   50             LOG_WARNING(
"\'srst_nogate\' reset_config option is required");
 
   81     for (ii = 0; ii < limit; ii++) {
 
   94         for (ii = 0; ii < limit; ii++)
 
   95             LOG_ERROR(
"expected %u of %u: 0x%08" PRIx32, ii + 1, limit,
 
  179             *targetname = 
"hla_target";
 
  188         uint32_t port_size, 
unsigned int *trace_freq,
 
  189         unsigned int traceclkin_freq, uint16_t *prescaler)
 
  193             pin_protocol, port_size, trace_freq, traceclkin_freq, prescaler);
 
  195         LOG_ERROR(
"The selected interface does not support tracing");
 
  212     LOG_DEBUG(
"hl_interface_handle_device_desc_command");
 
  217         LOG_ERROR(
"expected exactly one argument to hl_device_desc <description>");
 
  225     LOG_DEBUG(
"hl_interface_handle_layout_command");
 
  228         LOG_ERROR(
"Need exactly one argument to stlink_layout");
 
  233         LOG_ERROR(
"already specified hl_layout %s",
 
  241         if (strcmp(l->name, 
CMD_ARGV[0]) == 0) {
 
  259         LOG_WARNING(
"incomplete hla_vid_pid configuration directive");
 
  281     bool use_stlink_tcp = 
false;
 
  282     uint16_t stlink_tcp_port = 7184;
 
  286     else if (strcmp(
CMD_ARGV[0], 
"usb") == 0) {
 
  290     } 
else if (strcmp(
CMD_ARGV[0], 
"tcp") == 0) {
 
  291         use_stlink_tcp = 
true;
 
  309         LOG_ERROR(
"The selected adapter doesn't support custom commands");
 
  320      .
name = 
"device_desc",
 
  321      .handler = &hl_interface_handle_device_desc_command,
 
  323      .help = 
"set the device description of the adapter",
 
  324      .usage = 
"description_string",
 
  328      .handler = &hl_interface_handle_layout_command,
 
  330      .help = 
"set the layout of the adapter",
 
  331      .usage = 
"layout_name",
 
  335      .handler = &hl_interface_handle_vid_pid_command,
 
  337      .help = 
"the vendor and product ID of the adapter",
 
  338      .usage = 
"(vid pid)*",
 
  341      .name = 
"stlink_backend",
 
  342      .handler = &hl_interface_handle_stlink_backend_command,
 
  344      .help = 
"select which ST-Link backend to use",
 
  345      .usage = 
"usb | tcp [port]",
 
  349      .handler = &interface_handle_hla_command,
 
  351      .help = 
"execute a custom adapter-specific command",
 
  352      .usage = 
"<command>",
 
  361         .help = 
"perform hla management",
 
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
void jtag_command_queue_reset(void)
uint32_t size
Size of dw_spi_transaction::buffer.
int hl_interface_init_target(struct target *t)
COMMAND_HANDLER(hl_interface_handle_device_desc_command)
static int hl_interface_speed_div(int speed, int *khz)
static struct hl_interface hl_if
int hl_interface_open(enum hl_transports tr)
int hl_interface_override_target(const char **targetname)
static int hl_interface_speed(int speed)
static int hl_interface_init(void)
static int hl_interface_poll_trace(uint8_t *buf, size_t *size)
static const struct command_registration hl_interface_command_handlers[]
static int hl_interface_khz(int khz, int *jtag_speed)
static const struct command_registration hl_interface_subcommand_handlers[]
struct adapter_driver hl_adapter_driver
static int hl_interface_reset(int req_trst, int req_srst)
static int hl_interface_config_trace(bool enabled, enum tpiu_pin_protocol pin_protocol, uint32_t port_size, unsigned int *trace_freq, unsigned int traceclkin_freq, uint16_t *prescaler)
static int hl_interface_quit(void)
int hl_interface_init_reset(void)
int hl_layout_init(struct hl_interface *adapter)
const struct hl_layout * hl_layout_get_list(void)
static enum reset_types jtag_reset_config
int adapter_deassert_reset(void)
enum reset_types jtag_get_reset_config(void)
int adapter_assert_reset(void)
#define LOG_WARNING(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
Represents a driver for a debugging interface.
const char *const name
The name of the interface driver.
const char * usage
a string listing the options and arguments, required or optional
enum hl_transports transport
uint16_t pid[HLA_MAX_USB_IDS+1]
List of recognised PIDs.
uint16_t vid[HLA_MAX_USB_IDS+1]
List of recognised VIDs.
struct hl_interface_param param
const struct hl_layout * layout
int(* idcode)(void *handle, uint32_t *idcode)
Read the idcode of the target connected to the adapter.
int(* override_target)(const char *targetname)
int(* assert_srst)(void *handle, int srst)
int(* poll_trace)(void *handle, uint8_t *buf, size_t *size)
Poll for new trace data.
int(* close)(void *handle)
int(* custom_command)(void *handle, const char *command)
int(* config_trace)(void *handle, bool enabled, enum tpiu_pin_protocol pin_protocol, uint32_t port_size, unsigned int *trace_freq, unsigned int traceclkin_freq, uint16_t *prescaler)
Configure trace parameters for the adapter.
int(* speed)(void *handle, int khz, bool query)
int(* open)(struct hl_interface *adapter)
struct hl_layout_api * api
uint8_t expected_ids_cnt
Number of expected identification codes.
bool has_idcode
not all devices have idcode, we'll discover this during chain examination
uint32_t * expected_ids
Array of expected identification codes.
uint32_t idcode
device identification code
#define TRANSPORT_HLA_JTAG
#define TRANSPORT_HLA_SWD