aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-05-17 16:24:27 -0700
committerTim Newsome <tim@sifive.com>2018-11-19 12:49:35 -0800
commit022b6e77076d0da828333e8d2a4a358baec5a6cc (patch)
tree8b7f6bdd0527451326545c8a0f8f179f73cabfef
parent7079e0ca7d14c7cb4e897aec0e343c932248125f (diff)
downloadriscv-openocd-deinit.zip
riscv-openocd-deinit.tar.gz
riscv-openocd-deinit.tar.bz2
Disable the DM when OpenOCD exits.deinit
gdb/OpenOCD already remove all the breakpoints when exiting, so I think this is all we need to do to restore the hart to the state it was in before connecting. Issue #200. Change-Id: Ibcde7a3b68d221dd2718b8b51dfc7946350a8fcb
-rw-r--r--src/target/riscv/riscv-013.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 00714aa..57e3126 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -1334,6 +1334,9 @@ int wait_for_authbusy(struct target *target, uint32_t *dmstatus)
static void deinit_target(struct target *target)
{
LOG_DEBUG("riscv_deinit_target()");
+
+ dmi_write(target, DMI_DMCONTROL, 0);
+
riscv_info_t *info = (riscv_info_t *) target->arch_info;
free(info->version_specific);
/* TODO: free register arch_info */