+ *jtag_speed = hl_if.layout->api->speed(hl_if.handle, khz, true);
+ return ERROR_OK;
+}
+
+static int hl_interface_speed_div(int speed, int *khz)
+{
+ *khz = speed;
+ return ERROR_OK;
+}
+
+static int hl_interface_speed(int speed)
+{
+ if (!hl_if.layout->api->speed)
+ return ERROR_OK;
+
+ if (!hl_if.handle) {
+ /* pass speed as initial param as interface not open yet */
+ hl_if.param.initial_interface_speed = speed;
+ return ERROR_OK;
+ }
+
+ hl_if.layout->api->speed(hl_if.handle, speed, false);
+
+ return ERROR_OK;
+}
+
+int hl_interface_override_target(const char **targetname)
+{
+ if (hl_if.layout->api->override_target) {
+ if (hl_if.layout->api->override_target(*targetname)) {
+ *targetname = "hla_target";
+ return ERROR_OK;
+ } else
+ return ERROR_FAIL;
+ }
+ return ERROR_FAIL;
+}
+
+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)
+{
+ if (hl_if.layout->api->config_trace)
+ return hl_if.layout->api->config_trace(hl_if.handle, enabled,
+ pin_protocol, port_size, trace_freq, traceclkin_freq, prescaler);
+ else if (enabled) {
+ LOG_ERROR("The selected interface does not support tracing");
+ return ERROR_FAIL;