33 .connect_under_reset =
false,
34 .initial_interface_speed = -1,
35 .use_stlink_tcp =
false,
36 .stlink_tcp_port = 7184,
52 LOG_WARNING(
"\'srst_nogate\' reset_config option is required");
83 for (ii = 0; ii < limit; ii++) {
96 for (ii = 0; ii < limit; ii++)
97 LOG_ERROR(
"expected %u of %u: 0x%08" PRIx32, ii + 1, limit,
184 *targetname =
"hla_target";
193 uint32_t port_size,
unsigned int *trace_freq,
194 unsigned int traceclkin_freq, uint16_t *prescaler)
198 pin_protocol, port_size, trace_freq, traceclkin_freq, prescaler);
200 LOG_ERROR(
"The selected interface does not support tracing");
217 LOG_DEBUG(
"hl_interface_handle_device_desc_command");
222 LOG_ERROR(
"expected exactly one argument to hl_device_desc <description>");
230 LOG_DEBUG(
"hl_interface_handle_layout_command");
233 LOG_ERROR(
"Need exactly one argument to stlink_layout");
238 LOG_ERROR(
"already specified hl_layout %s",
246 if (strcmp(l->name,
CMD_ARGV[0]) == 0) {
264 LOG_WARNING(
"incomplete hla_vid_pid configuration directive");
286 bool use_stlink_tcp =
false;
287 uint16_t stlink_tcp_port = 7184;
291 else if (strcmp(
CMD_ARGV[0],
"usb") == 0) {
295 }
else if (strcmp(
CMD_ARGV[0],
"tcp") == 0) {
296 use_stlink_tcp =
true;
314 LOG_ERROR(
"The selected adapter doesn't support custom commands");
325 .
name =
"hla_device_desc",
326 .handler = &hl_interface_handle_device_desc_command,
328 .help =
"set the device description of the adapter",
329 .usage =
"description_string",
332 .name =
"hla_layout",
333 .handler = &hl_interface_handle_layout_command,
335 .help =
"set the layout of the adapter",
336 .usage =
"layout_name",
339 .name =
"hla_vid_pid",
340 .handler = &hl_interface_handle_vid_pid_command,
342 .help =
"the vendor and product ID of the adapter",
343 .usage =
"(vid pid)*",
346 .name =
"hla_stlink_backend",
347 .handler = &hl_interface_handle_stlink_backend_command,
349 .help =
"select which ST-Link backend to use",
350 .usage =
"usb | tcp [port]",
353 .name =
"hla_command",
354 .handler = &interface_handle_hla_command,
356 .help =
"execute a custom adapter-specific command",
357 .usage =
"<command>",
#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)
int hl_interface_open(enum hl_transports tr)
int hl_interface_override_target(const char **targetname)
static int hl_interface_speed(int speed)
static struct hl_interface_s hl_if
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)
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)
const struct hl_layout * hl_layout_get_list(void)
int hl_layout_init(struct hl_interface_s *adapter)
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.
uint16_t pid[HLA_MAX_USB_IDS+1]
List of recognised PIDs.
enum hl_transports transport
int initial_interface_speed
Initial interface clock clock speed.
uint16_t vid[HLA_MAX_USB_IDS+1]
List of recognised VIDs.
struct hl_interface_param_s param
const struct hl_layout * layout
int(* poll_trace)(void *handle, uint8_t *buf, size_t *size)
Poll for new trace data.
int(* speed)(void *handle, int khz, bool query)
int(* override_target)(const char *targetname)
int(* custom_command)(void *handle, const char *command)
int(* idcode)(void *handle, uint32_t *idcode)
Read the idcode of the target connected to the adapter.
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(* close)(void *handle)
int(* assert_srst)(void *handle, int srst)
struct hl_layout_api_s * api
int(* open)(struct hl_interface_s *adapter)
uint8_t expected_ids_cnt
Number of expected identification codes.
bool hasidcode
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