mirror of
https://github.com/openocd-org/openocd.git
synced 2025-10-14 02:58:23 +08:00
Compare commits
17 Commits
f5dd564a7b
...
72ff2e2d9f
Author | SHA1 | Date | |
---|---|---|---|
![]() |
72ff2e2d9f | ||
![]() |
bb4c7e3233 | ||
![]() |
4275280698 | ||
![]() |
6beb6280af | ||
![]() |
e4a51b3235 | ||
![]() |
e12ceddd5e | ||
![]() |
a2d4b9b718 | ||
![]() |
fdd0c2b1d3 | ||
![]() |
16c6497a89 | ||
![]() |
d892a4d763 | ||
![]() |
80b1c9aff8 | ||
![]() |
da7e369266 | ||
![]() |
c00228468c | ||
![]() |
9e5ffed7d6 | ||
![]() |
a2c3c791ad | ||
![]() |
a8555b0b6d | ||
![]() |
5300242a3e |
35
configure.ac
35
configure.ac
@@ -178,6 +178,12 @@ m4_define([LINUXSPIDEV_ADAPTER],
|
||||
m4_define([VDEBUG_ADAPTER],
|
||||
[[[vdebug], [Cadence Virtual Debug Interface], [VDEBUG]]])
|
||||
|
||||
m4_define([JTAG_DPI_ADAPTER],
|
||||
[[[jtag_dpi], [JTAG DPI Adapter], [JTAG_DPI]]])
|
||||
|
||||
m4_define([JTAG_VPI_ADAPTER],
|
||||
[[[jtag_vpi], [JTAG VPI Adapter], [JTAG_VPI]]])
|
||||
|
||||
# The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter
|
||||
# because there is an M4 macro called 'adapter'.
|
||||
m4_define([DUMMY_ADAPTER],
|
||||
@@ -308,6 +314,8 @@ AC_ARG_ADAPTERS([
|
||||
SERIAL_PORT_ADAPTERS,
|
||||
DUMMY_ADAPTER,
|
||||
VDEBUG_ADAPTER,
|
||||
JTAG_DPI_ADAPTER,
|
||||
JTAG_VPI_ADAPTER,
|
||||
PCIE_ADAPTERS,
|
||||
LIBJAYLINK_ADAPTERS
|
||||
],[auto])
|
||||
@@ -326,14 +334,6 @@ AC_ARG_ENABLE([parport_giveio],
|
||||
[Enable use of giveio for parport (for CygWin only)]),
|
||||
[parport_use_giveio=$enableval], [parport_use_giveio=])
|
||||
|
||||
AC_ARG_ENABLE([jtag_vpi],
|
||||
AS_HELP_STRING([--enable-jtag_vpi], [Enable building support for JTAG VPI]),
|
||||
[build_jtag_vpi=$enableval], [build_jtag_vpi=no])
|
||||
|
||||
AC_ARG_ENABLE([jtag_dpi],
|
||||
AS_HELP_STRING([--enable-jtag_dpi], [Enable building support for JTAG DPI]),
|
||||
[build_jtag_dpi=$enableval], [build_jtag_dpi=no])
|
||||
|
||||
AC_ARG_ENABLE([amtjtagaccel],
|
||||
AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
|
||||
[build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
|
||||
@@ -577,19 +577,6 @@ AS_IF([test "x$parport_use_giveio" = "xyes"], [
|
||||
AC_DEFINE([PARPORT_USE_GIVEIO], [0], [0 if you don't want parport to use giveio.])
|
||||
])
|
||||
|
||||
AS_IF([test "x$build_jtag_vpi" = "xyes"], [
|
||||
AC_DEFINE([BUILD_JTAG_VPI], [1], [1 if you want JTAG VPI.])
|
||||
], [
|
||||
AC_DEFINE([BUILD_JTAG_VPI], [0], [0 if you don't want JTAG VPI.])
|
||||
])
|
||||
|
||||
AS_IF([test "x$build_jtag_dpi" = "xyes"], [
|
||||
AC_DEFINE([BUILD_JTAG_DPI], [1], [1 if you want JTAG DPI.])
|
||||
], [
|
||||
AC_DEFINE([BUILD_JTAG_DPI], [0], [0 if you don't want JTAG DPI.])
|
||||
])
|
||||
|
||||
|
||||
AS_IF([test "x$build_amtjtagaccel" = "xyes"], [
|
||||
AC_DEFINE([BUILD_AMTJTAGACCEL], [1], [1 if you want the Amontec JTAG-Accelerator driver.])
|
||||
], [
|
||||
@@ -735,6 +722,8 @@ PROCESS_ADAPTERS([SERIAL_PORT_ADAPTERS], ["x$can_build_buspirate" = "xyes"],
|
||||
[internal error: validation should happen beforehand])
|
||||
PROCESS_ADAPTERS([LINUXSPIDEV_ADAPTER], ["x$is_linux" = "xyes"], [Linux spidev])
|
||||
PROCESS_ADAPTERS([VDEBUG_ADAPTER], [true], [unused])
|
||||
PROCESS_ADAPTERS([JTAG_DPI_ADAPTER], [true], [unused])
|
||||
PROCESS_ADAPTERS([JTAG_VPI_ADAPTER], [true], [unused])
|
||||
PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused])
|
||||
|
||||
AS_IF([test "x$enable_linuxgpiod" != "xno"], [
|
||||
@@ -782,8 +771,6 @@ AM_CONDITIONAL([BCM2835GPIO], [test "x$build_bcm2835gpio" = "xyes"])
|
||||
AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"])
|
||||
AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"])
|
||||
AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"])
|
||||
AM_CONDITIONAL([JTAG_VPI], [test "x$build_jtag_vpi" = "xyes"])
|
||||
AM_CONDITIONAL([JTAG_DPI], [test "x$build_jtag_dpi" = "xyes"])
|
||||
AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"])
|
||||
AM_CONDITIONAL([AMTJTAGACCEL], [test "x$build_amtjtagaccel" = "xyes"])
|
||||
AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
|
||||
@@ -889,6 +876,8 @@ m4_foreach([adapter], [USB1_ADAPTERS,
|
||||
LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS,
|
||||
LINUXSPIDEV_ADAPTER,
|
||||
VDEBUG_ADAPTER,
|
||||
JTAG_DPI_ADAPTER,
|
||||
JTAG_VPI_ADAPTER,
|
||||
DUMMY_ADAPTER,
|
||||
OPTIONAL_LIBRARIES,
|
||||
COVERAGE],
|
||||
|
@@ -2415,12 +2415,6 @@ target.
|
||||
List the debug adapter drivers that have been built into
|
||||
the running copy of OpenOCD.
|
||||
@end deffn
|
||||
@deffn {Config Command} {adapter transports} transport_name+
|
||||
Specifies the transports supported by this debug adapter.
|
||||
The adapter driver builds-in similar knowledge; use this only
|
||||
when external configuration (such as jumpering) changes what
|
||||
the hardware can support.
|
||||
@end deffn
|
||||
|
||||
@anchor{adapter gpio}
|
||||
@deffn {Config Command} {adapter gpio [ @
|
||||
@@ -3816,13 +3810,6 @@ Not all adapters and adapter drivers support SWD multi-drop. Only the following
|
||||
adapter drivers are SWD multi-drop capable:
|
||||
cmsis_dap (use an adapter with CMSIS-DAP version 2.0), ftdi, all bitbang based.
|
||||
|
||||
@subsection SPI Transport
|
||||
@cindex SPI
|
||||
@cindex Serial Peripheral Interface
|
||||
The Serial Peripheral Interface (SPI) is a general purpose transport
|
||||
which uses four wire signaling. Some processors use it as part of a
|
||||
solution for flash programming.
|
||||
|
||||
@anchor{swimtransport}
|
||||
@subsection SWIM Transport
|
||||
@cindex SWIM
|
||||
|
@@ -85,7 +85,8 @@ struct log_callback {
|
||||
int log_add_callback(log_callback_fn fn, void *priv);
|
||||
int log_remove_callback(log_callback_fn fn, void *priv);
|
||||
|
||||
char *alloc_vprintf(const char *fmt, va_list ap);
|
||||
char *alloc_vprintf(const char *fmt, va_list ap)
|
||||
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 1, 0)));
|
||||
char *alloc_printf(const char *fmt, ...)
|
||||
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 1, 2)));
|
||||
|
||||
|
@@ -392,31 +392,8 @@ COMMAND_HANDLER(handle_adapter_name)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(adapter_transports_command)
|
||||
COMMAND_HANDLER(dump_adapter_driver_list)
|
||||
{
|
||||
char **transports;
|
||||
int retval;
|
||||
|
||||
retval = CALL_COMMAND_HANDLER(transport_list_parse, &transports);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
retval = allow_transports(CMD_CTX, (const char **)transports);
|
||||
|
||||
if (retval != ERROR_OK) {
|
||||
for (unsigned int i = 0; transports[i]; i++)
|
||||
free(transports[i]);
|
||||
free(transports);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_adapter_list_command)
|
||||
{
|
||||
if (strcmp(CMD_NAME, "list") == 0 && CMD_ARGC > 0)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
command_print(CMD, "The following debug adapters are available:");
|
||||
for (unsigned int i = 0; adapter_drivers[i]; i++) {
|
||||
const char *name = adapter_drivers[i]->name;
|
||||
command_print(CMD, "%u: %s", i + 1, name);
|
||||
@@ -425,6 +402,14 @@ COMMAND_HANDLER(handle_adapter_list_command)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_adapter_list_command)
|
||||
{
|
||||
if (CMD_ARGC)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
return CALL_COMMAND_HANDLER(dump_adapter_driver_list);
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_adapter_driver_command)
|
||||
{
|
||||
int retval;
|
||||
@@ -459,7 +444,8 @@ COMMAND_HANDLER(handle_adapter_driver_command)
|
||||
*/
|
||||
LOG_ERROR("The specified debug interface was not found (%s)",
|
||||
CMD_ARGV[0]);
|
||||
CALL_COMMAND_HANDLER(handle_adapter_list_command);
|
||||
command_print(CMD, "The following adapter drivers are available:");
|
||||
CALL_COMMAND_HANDLER(dump_adapter_driver_list);
|
||||
return ERROR_JTAG_INVALID_INTERFACE;
|
||||
}
|
||||
|
||||
@@ -1137,13 +1123,6 @@ static const struct command_registration adapter_command_handlers[] = {
|
||||
.usage = "",
|
||||
.chain = adapter_srst_command_handlers,
|
||||
},
|
||||
{
|
||||
.name = "transports",
|
||||
.handler = adapter_transports_command,
|
||||
.mode = COMMAND_CONFIG,
|
||||
.help = "Declare transports the adapter supports.",
|
||||
.usage = "transport ...",
|
||||
},
|
||||
{
|
||||
.name = "usb",
|
||||
.mode = COMMAND_ANY,
|
||||
|
@@ -427,7 +427,7 @@ static int bcm2835gpio_blink(bool on)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static struct bitbang_interface bcm2835gpio_bitbang = {
|
||||
static const struct bitbang_interface bcm2835gpio_bitbang_swd_write_generic = {
|
||||
.read = bcm2835gpio_read,
|
||||
.write = bcm2835gpio_write,
|
||||
.swdio_read = bcm2835_swdio_read,
|
||||
@@ -436,11 +436,19 @@ static struct bitbang_interface bcm2835gpio_bitbang = {
|
||||
.blink = bcm2835gpio_blink,
|
||||
};
|
||||
|
||||
static const struct bitbang_interface bcm2835gpio_bitbang_swd_write_fast = {
|
||||
.read = bcm2835gpio_read,
|
||||
.write = bcm2835gpio_write,
|
||||
.swdio_read = bcm2835_swdio_read,
|
||||
.swdio_drive = bcm2835_swdio_drive,
|
||||
.swd_write = bcm2835gpio_swd_write_fast,
|
||||
.blink = bcm2835gpio_blink,
|
||||
};
|
||||
|
||||
static int bcm2835gpio_init(void)
|
||||
{
|
||||
LOG_INFO("BCM2835 GPIO JTAG/SWD bitbang driver");
|
||||
|
||||
bitbang_interface = &bcm2835gpio_bitbang;
|
||||
adapter_gpio_config = adapter_gpio_get_config();
|
||||
|
||||
if (transport_is_jtag() && !bcm2835gpio_jtag_mode_possible()) {
|
||||
@@ -509,6 +517,8 @@ LOG_INFO("pads conf set to %08x", pads_base[BCM2835_PADS_GPIO_0_27_OFFSET]);
|
||||
initialize_gpio(ADAPTER_GPIO_IDX_TRST);
|
||||
}
|
||||
|
||||
const struct bitbang_interface *bcm2835gpio_bitbang = &bcm2835gpio_bitbang_swd_write_generic;
|
||||
|
||||
if (transport_is_swd()) {
|
||||
/* swdio and its buffer should be initialized in the order that prevents
|
||||
* two outputs from being connected together. This will occur if the
|
||||
@@ -529,16 +539,18 @@ LOG_INFO("pads conf set to %08x", pads_base[BCM2835_PADS_GPIO_0_27_OFFSET]);
|
||||
if (adapter_gpio_config[ADAPTER_GPIO_IDX_SWCLK].drive == ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL &&
|
||||
adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].drive == ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL) {
|
||||
LOG_DEBUG("BCM2835 GPIO using fast mode for SWD write");
|
||||
bcm2835gpio_bitbang.swd_write = bcm2835gpio_swd_write_fast;
|
||||
bcm2835gpio_bitbang = &bcm2835gpio_bitbang_swd_write_fast;
|
||||
} else {
|
||||
LOG_DEBUG("BCM2835 GPIO using generic mode for SWD write");
|
||||
bcm2835gpio_bitbang.swd_write = bcm2835gpio_swd_write_generic;
|
||||
assert(bcm2835gpio_bitbang == &bcm2835gpio_bitbang_swd_write_generic);
|
||||
}
|
||||
}
|
||||
|
||||
initialize_gpio(ADAPTER_GPIO_IDX_SRST);
|
||||
initialize_gpio(ADAPTER_GPIO_IDX_LED);
|
||||
|
||||
bitbang_interface = bcm2835gpio_bitbang;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
@@ -1120,23 +1120,13 @@ static int linux_thread_extra_info(struct target *target,
|
||||
|
||||
while (temp) {
|
||||
if (temp->threadid == threadid) {
|
||||
char *pid = " PID: ";
|
||||
char *pid_current = "*PID: ";
|
||||
char *name = "Name: ";
|
||||
int str_size = strlen(pid) + strlen(name);
|
||||
char *tmp_str = calloc(1, str_size + 50);
|
||||
char *tmp_str_ptr = tmp_str;
|
||||
|
||||
/* discriminate current task */
|
||||
if (temp->status == 3)
|
||||
tmp_str_ptr += sprintf(tmp_str_ptr, "%s",
|
||||
pid_current);
|
||||
else
|
||||
tmp_str_ptr += sprintf(tmp_str_ptr, "%s", pid);
|
||||
|
||||
tmp_str_ptr += sprintf(tmp_str_ptr, "%d, ", (int)temp->pid);
|
||||
sprintf(tmp_str_ptr, "%s", name);
|
||||
sprintf(tmp_str_ptr, "%s", temp->name);
|
||||
char *tmp_str = alloc_printf("%cPID: %" PRIu32 ", Name: %s",
|
||||
temp->status == 3 ? '*' : ' ',
|
||||
temp->pid, temp->name);
|
||||
if (!tmp_str) {
|
||||
LOG_ERROR("Out of memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
char *hex_str = calloc(1, strlen(tmp_str) * 2 + 1);
|
||||
size_t pkt_len = hexify(hex_str, (const uint8_t *)tmp_str,
|
||||
strlen(tmp_str), strlen(tmp_str) * 2 + 1);
|
||||
|
@@ -2367,7 +2367,9 @@ static int adiv5_jim_spot_configure(struct jim_getopt_info *goi,
|
||||
return e;
|
||||
dap = dap_instance_by_jim_obj(goi->interp, o_t);
|
||||
if (!dap) {
|
||||
Jim_SetResultString(goi->interp, "DAP name invalid!", -1);
|
||||
const char *dap_name = Jim_GetString(o_t, NULL);
|
||||
Jim_SetResultFormatted(goi->interp, "DAP '%s' not found",
|
||||
dap_name);
|
||||
return JIM_ERR;
|
||||
}
|
||||
if (*dap_p && *dap_p != dap) {
|
||||
|
@@ -61,6 +61,7 @@ static int armv8_cache_d_inner_flush_level(struct armv8_common *armv8, struct ar
|
||||
goto done;
|
||||
c_way -= 1;
|
||||
} while (c_way >= 0);
|
||||
keep_alive();
|
||||
c_index -= 1;
|
||||
} while (c_index >= 0);
|
||||
|
||||
|
@@ -166,54 +166,6 @@ struct transport *get_current_transport(void)
|
||||
* Infrastructure for Tcl interface to transports.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Makes and stores a copy of a set of transports passed as
|
||||
* parameters to a command.
|
||||
*
|
||||
* @param vector where the resulting copy is stored, as an argv-style
|
||||
* NULL-terminated vector.
|
||||
*/
|
||||
COMMAND_HELPER(transport_list_parse, char ***vector)
|
||||
{
|
||||
char **argv;
|
||||
unsigned int n = CMD_ARGC;
|
||||
unsigned int j = 0;
|
||||
|
||||
*vector = NULL;
|
||||
|
||||
if (n < 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
/* our return vector must be NULL terminated */
|
||||
argv = calloc(n + 1, sizeof(char *));
|
||||
if (!argv)
|
||||
return ERROR_FAIL;
|
||||
|
||||
for (unsigned int i = 0; i < n; i++) {
|
||||
struct transport *t;
|
||||
|
||||
for (t = transport_list; t; t = t->next) {
|
||||
if (strcmp(t->name, CMD_ARGV[i]) != 0)
|
||||
continue;
|
||||
argv[j++] = strdup(CMD_ARGV[i]);
|
||||
break;
|
||||
}
|
||||
if (!t) {
|
||||
LOG_ERROR("no such transport '%s'", CMD_ARGV[i]);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
*vector = argv;
|
||||
return ERROR_OK;
|
||||
|
||||
fail:
|
||||
for (unsigned int i = 0; i < n; i++)
|
||||
free(argv[i]);
|
||||
free(argv);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_transport_init)
|
||||
{
|
||||
LOG_DEBUG("%s", __func__);
|
||||
|
@@ -77,8 +77,6 @@ struct transport *get_current_transport(void);
|
||||
|
||||
int transport_register_commands(struct command_context *ctx);
|
||||
|
||||
COMMAND_HELPER(transport_list_parse, char ***vector);
|
||||
|
||||
int allow_transports(struct command_context *ctx, const char * const *vector);
|
||||
|
||||
bool transport_is_jtag(void);
|
||||
|
25
tcl/board/ti_am261_launchpad.cfg
Normal file
25
tcl/board/ti_am261_launchpad.cfg
Normal file
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
|
||||
#
|
||||
# Texas Instruments AM261 Launchpad
|
||||
# https://www.ti.com/tool/LP-AM261
|
||||
#
|
||||
|
||||
# AM263 Launchpad has an xds110 onboard.
|
||||
source [find interface/xds110.cfg]
|
||||
|
||||
transport select jtag
|
||||
|
||||
# default JTAG configuration has only SRST and no TRST
|
||||
reset_config srst_only srst_push_pull
|
||||
|
||||
# delay after SRST goes inactive
|
||||
adapter srst delay 20
|
||||
|
||||
if { ![info exists SOC] } {
|
||||
set SOC am261
|
||||
}
|
||||
|
||||
source [find target/ti_k3.cfg]
|
||||
|
||||
adapter speed 250
|
25
tcl/board/ti_am263p_launchpad.cfg
Normal file
25
tcl/board/ti_am263p_launchpad.cfg
Normal file
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
|
||||
#
|
||||
# Texas Instruments AM263P Launchpad
|
||||
# https://www.ti.com/tool/LP-AM263P
|
||||
#
|
||||
|
||||
# AM263P Launchpad has an xds110 onboard.
|
||||
source [find interface/xds110.cfg]
|
||||
|
||||
transport select jtag
|
||||
|
||||
# default JTAG configuration has only SRST and no TRST
|
||||
reset_config srst_only srst_push_pull
|
||||
|
||||
# delay after SRST goes inactive
|
||||
adapter srst delay 20
|
||||
|
||||
if { ![info exists SOC] } {
|
||||
set SOC am263p
|
||||
}
|
||||
|
||||
source [find target/ti_k3.cfg]
|
||||
|
||||
adapter speed 250
|
25
tcl/board/ti_am62levm.cfg
Normal file
25
tcl/board/ti_am62levm.cfg
Normal file
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
|
||||
#
|
||||
# Texas Instruments AM62L EVM:
|
||||
# Links: https://www.ti.com/tool/TMDS62LEVM
|
||||
#
|
||||
|
||||
# the AM62L3 EVM/SK has an xds110 onboard.
|
||||
source [find interface/xds110.cfg]
|
||||
|
||||
transport select jtag
|
||||
|
||||
# default JTAG configuration has only SRST and no TRST
|
||||
reset_config srst_only srst_push_pull
|
||||
|
||||
# delay after SRST goes inactive
|
||||
adapter srst delay 20
|
||||
|
||||
if { ![info exists SOC] } {
|
||||
set SOC am62l
|
||||
}
|
||||
|
||||
source [find target/ti_k3.cfg]
|
||||
|
||||
adapter speed 2500
|
@@ -36,12 +36,11 @@ dap create $_CHIPNAME.coresight.dap -chain-position $_CHIPNAME.coresight.cpu
|
||||
for { set _core 0 } { $_core < $_cores } { incr _core } {
|
||||
cti create cti.$_core -dap $_CHIPNAME.coresight.dap -ap-num 0 \
|
||||
-baseaddr [lindex $CTIBASE $_core]
|
||||
# Cores are armv8-r but works with aarch64 (since armv8-r not directly supported by openocd yet).
|
||||
if { $_core == 0} {
|
||||
target create core.$_core aarch64 -dap $_CHIPNAME.coresight.dap \
|
||||
target create core.$_core armv8r -dap $_CHIPNAME.coresight.dap \
|
||||
-ap-num 0 -dbgbase [lindex $DBGBASE $_core] -cti cti.$_core
|
||||
} else {
|
||||
target create core.$_core aarch64 -dap $_CHIPNAME.coresight.dap \
|
||||
target create core.$_core armv8r -dap $_CHIPNAME.coresight.dap \
|
||||
-ap-num 0 -dbgbase [lindex $DBGBASE $_core] -cti cti.$_core -defer-examine
|
||||
}
|
||||
}
|
||||
|
@@ -4,8 +4,12 @@
|
||||
# Texas Instruments K3 devices:
|
||||
# * AM243: https://www.ti.com/lit/pdf/spruim2
|
||||
# Has 4 R5 Cores, M4F and an M3
|
||||
# * AM261: https://www.ti.com/lit/pdf/sprujb6
|
||||
# Has 2 R5 Cores and an M4F
|
||||
# * AM263: https://www.ti.com/lit/pdf/spruj17
|
||||
# Has 4 R5 Cores and an M3
|
||||
# * AM263P: https://www.ti.com/lit/pdf/spruj55
|
||||
# Has 4 R5 Cores and an M4F
|
||||
# * AM273: https://www.ti.com/lit/pdf/spruiu0
|
||||
# Has 2 R5 Cores and an M3
|
||||
# * AM625: https://www.ti.com/lit/pdf/spruiv7a
|
||||
@@ -14,6 +18,8 @@
|
||||
# Has 4 ARMV8 Cores and 2 R5 Cores
|
||||
# * AM62P: https://www.ti.com/lit/pdf/spruj83
|
||||
# Has 4 ARMV8 Cores and 2 R5 Cores
|
||||
# * AM62L: https://www.ti.com/lit/pdf/sprujb4
|
||||
# Has 2 ARMv8 Cores only
|
||||
# * AM642: https://www.ti.com/lit/pdf/spruim2
|
||||
# Has 2 ARMV8 Cores and 4 R5 Cores, M4F and an M3
|
||||
# * AM654x: https://www.ti.com/lit/pdf/spruid7
|
||||
@@ -77,8 +83,16 @@ set _gp_mcu_ap_unlock_offsets {0xf0 0x60}
|
||||
# Generic mem-ap port number
|
||||
set _mem_ap_num 2
|
||||
|
||||
# Generic AP_SEL PWR Register number
|
||||
set _power_ap_num 3
|
||||
|
||||
# Generic SPREC RESET BANK and Field number
|
||||
set _powerap_sprec_reset 0xf0
|
||||
|
||||
# Set configuration overrides for each SOC
|
||||
switch $_soc {
|
||||
am261 -
|
||||
am263p -
|
||||
am263 {
|
||||
set _K3_DAP_TAPID 0x2bb7d02f
|
||||
|
||||
@@ -94,6 +108,16 @@ switch $_soc {
|
||||
set R5_DBGBASE {0x90030000 0x90032000 0x90050000 0x90052000}
|
||||
set R5_CTIBASE {0x90038000 0x90039000 0x90058000 0x90059000}
|
||||
set _r5_ap_num 5
|
||||
|
||||
set _power_ap_num 7
|
||||
|
||||
if { "$_soc" == "am263p" } {
|
||||
set _K3_DAP_TAPID 0x1bb9502f
|
||||
}
|
||||
if { "$_soc" == "am261" } {
|
||||
set _K3_DAP_TAPID 0x1bba602f
|
||||
set _r5_cores 2
|
||||
}
|
||||
}
|
||||
am273 {
|
||||
set _K3_DAP_TAPID 0x1bb6a02f
|
||||
@@ -233,6 +257,18 @@ switch $_soc {
|
||||
set R5_CTIBASE {0x9d418000 0x9d518000 0x9d818000}
|
||||
}
|
||||
}
|
||||
am62l {
|
||||
set _K3_DAP_TAPID 0x0bba702f
|
||||
|
||||
# AM62Lx has 1 cluster of 2 A53 cores.
|
||||
set _armv8_cpu_name a53
|
||||
set _armv8_cores 2
|
||||
set ARMV8_DBGBASE {0x90010000 0x90110000}
|
||||
set ARMV8_CTIBASE {0x90020000 0x90120000}
|
||||
|
||||
# Has no supporting microcontrollers
|
||||
set _r5_cores 0
|
||||
}
|
||||
j721e {
|
||||
set _K3_DAP_TAPID 0x0bb6402f
|
||||
# J721E has 1 cluster of 2 A72 cores.
|
||||
@@ -499,3 +535,10 @@ if { 0 == [string compare [adapter name] dmem ] } {
|
||||
# AXI AP access port for SoC address map
|
||||
target create $_CHIPNAME.axi_ap mem_ap -dap $_CHIPNAME.dap -ap-num $_mem_ap_num
|
||||
}
|
||||
|
||||
# Reset system using (Debug Reset) SPREC Register,SYSTEMRESET bit field via apreg
|
||||
proc dbg_sys_reset {} {
|
||||
$::_CHIPNAME.dap apreg $::_power_ap_num $::_powerap_sprec_reset 0x1
|
||||
}
|
||||
|
||||
add_help_text dbg_sys_reset "Debugger initiated system reset attempt via Power-AP"
|
||||
|
Reference in New Issue
Block a user