Allow transports to override the selected target (hla configs unification)
This should allow to share common configs for both regular access and high-level adapters. Use the newly-added functionality in stlink and icdi drivers, amend the configs accordingly. Runtime-tested with a TI tm4c123g board. Change-Id: Ibb88266a4ca25f06f6c073e916c963f017447bad Signed-off-by: Paul Fertser <fercerpav@gmail.com> [gus@projectgus.com: context-specific deprecation warnings] Signed-off-by: Angus Gratton <gus@projectgus.com> [andrew.smirnov@gmail.com: additional nrf51.cfg mods] Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Tested-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Reviewed-on: http://openocd.zylin.com/1664 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
committed by
Andreas Fritiofson
parent
f701c0cbeb
commit
c7384117c6
@@ -1570,6 +1570,12 @@ static int stlink_usb_write_mem(void *handle, uint32_t addr, uint32_t size,
|
||||
return retval;
|
||||
}
|
||||
|
||||
/** */
|
||||
static int stlink_usb_override_target(const char *targetname)
|
||||
{
|
||||
return !strcmp(targetname, "cortex_m");
|
||||
}
|
||||
|
||||
/** */
|
||||
static int stlink_usb_close(void *fd)
|
||||
{
|
||||
@@ -1798,5 +1804,7 @@ struct hl_layout_api_s stlink_usb_layout_api = {
|
||||
/** */
|
||||
.write_mem = stlink_usb_write_mem,
|
||||
/** */
|
||||
.write_debug_reg = stlink_usb_write_debug_reg
|
||||
.write_debug_reg = stlink_usb_write_debug_reg,
|
||||
/** */
|
||||
.override_target = stlink_usb_override_target,
|
||||
};
|
||||
|
||||
@@ -645,6 +645,11 @@ static int icdi_usb_write_mem(void *handle, uint32_t addr, uint32_t size,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int icdi_usb_override_target(const char *targetname)
|
||||
{
|
||||
return !strcmp(targetname, "cortex_m");
|
||||
}
|
||||
|
||||
static int icdi_usb_close(void *handle)
|
||||
{
|
||||
struct icdi_usb_handle_s *h = handle;
|
||||
@@ -770,5 +775,6 @@ struct hl_layout_api_s icdi_usb_layout_api = {
|
||||
.write_reg = icdi_usb_write_reg,
|
||||
.read_mem = icdi_usb_read_mem,
|
||||
.write_mem = icdi_usb_write_mem,
|
||||
.write_debug_reg = icdi_usb_write_debug_reg
|
||||
.write_debug_reg = icdi_usb_write_debug_reg,
|
||||
.override_target = icdi_usb_override_target,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user