32 .connect_under_reset =
false,
33 .initial_interface_speed = -1,
34 .use_stlink_tcp =
false,
35 .stlink_tcp_port = 7184,
51 LOG_WARNING(
"\'srst_nogate\' reset_config option is required");
82 for (ii = 0; ii < limit; ii++) {
95 for (ii = 0; ii < limit; ii++)
96 LOG_ERROR(
"expected %u of %u: 0x%08" PRIx32, ii + 1, limit,
183 *targetname =
"hla_target";
192 uint32_t port_size,
unsigned int *trace_freq,
193 unsigned int traceclkin_freq, uint16_t *prescaler)
197 pin_protocol, port_size, trace_freq, traceclkin_freq, prescaler);
199 LOG_ERROR(
"The selected interface does not support tracing");
216 LOG_DEBUG(
"hl_interface_handle_device_desc_command");
221 LOG_ERROR(
"expected exactly one argument to hl_device_desc <description>");
229 LOG_DEBUG(
"hl_interface_handle_layout_command");
232 LOG_ERROR(
"Need exactly one argument to stlink_layout");
237 LOG_ERROR(
"already specified hl_layout %s",
245 if (strcmp(l->name,
CMD_ARGV[0]) == 0) {
263 LOG_WARNING(
"incomplete hla_vid_pid configuration directive");
285 bool use_stlink_tcp =
false;
286 uint16_t stlink_tcp_port = 7184;
290 else if (strcmp(
CMD_ARGV[0],
"usb") == 0) {
294 }
else if (strcmp(
CMD_ARGV[0],
"tcp") == 0) {
295 use_stlink_tcp =
true;
313 LOG_ERROR(
"The selected adapter doesn't support custom commands");
324 .
name =
"device_desc",
325 .handler = &hl_interface_handle_device_desc_command,
327 .help =
"set the device description of the adapter",
328 .usage =
"description_string",
332 .handler = &hl_interface_handle_layout_command,
334 .help =
"set the layout of the adapter",
335 .usage =
"layout_name",
339 .handler = &hl_interface_handle_vid_pid_command,
341 .help =
"the vendor and product ID of the adapter",
342 .usage =
"(vid pid)*",
345 .name =
"stlink_backend",
346 .handler = &hl_interface_handle_stlink_backend_command,
348 .help =
"select which ST-Link backend to use",
349 .usage =
"usb | tcp [port]",
353 .handler = &interface_handle_hla_command,
355 .help =
"execute a custom adapter-specific command",
356 .usage =
"<command>",
365 .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)
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 ...)
size_t size
Size of the control block search area.
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.
int initial_interface_speed
Initial interface clock clock speed.
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