aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2020-10-12 00:11:46 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-03-10 21:33:40 +0000
commit184724d14e120a9901fedfe05692bcd270f5eb57 (patch)
treea08223244e56f4226cb2d5042b3ffc5caeb67572 /src/openocd.c
parentf9509c92dba370be363f5641d3fefe2250bee10c (diff)
downloadriscv-openocd-184724d14e120a9901fedfe05692bcd270f5eb57.zip
riscv-openocd-184724d14e120a9901fedfe05692bcd270f5eb57.tar.gz
riscv-openocd-184724d14e120a9901fedfe05692bcd270f5eb57.tar.bz2
arm_tpiu_swo: add support for independent TPIU and SWO
This is supposed to replace big part of armv7m_trace.[ch], since TPIU is not only the one implemented in Cortex-M3 and M4. Change-Id: I7588d16cbefe9cdb371c52fb0aa5cdfb48518804 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5858 Tested-by: jenkins
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 83c3545..4fec563 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -38,6 +38,7 @@
#include <pld/pld.h>
#include <target/arm_cti.h>
#include <target/arm_adi_v5.h>
+#include <target/arm_tpiu_swo.h>
#include <rtt/rtt.h>
#include <server/server.h>
@@ -173,6 +174,10 @@ COMMAND_HANDLER(handle_init_command)
return ERROR_FAIL;
command_context_mode(CMD_CTX, COMMAND_EXEC);
+ /* in COMMAND_EXEC, after target_examine(), only tpiu or only swo */
+ if (command_run_line(CMD_CTX, "tpiu init") != ERROR_OK)
+ return ERROR_FAIL;
+
/* initialize telnet subsystem */
gdb_target_add_all(all_targets);
@@ -255,6 +260,7 @@ static struct command_context *setup_command_handler(Jim_Interp *interp)
&pld_register_commands,
&cti_register_commands,
&dap_register_commands,
+ &arm_tpiu_swo_register_commands,
NULL
};
for (unsigned i = 0; NULL != command_registrants[i]; i++) {
@@ -355,6 +361,7 @@ int openocd_main(int argc, char *argv[])
flash_free_all_banks();
gdb_service_free();
+ arm_tpiu_swo_cleanup_all();
server_free();
unregister_all_commands(cmd_ctx, NULL);