From 41d5fcc0b1480ccf50da517500cf26b6e9b9d9ac Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Fri, 12 Dec 2025 18:22:12 +0100 Subject: [PATCH] tcl/target/gd32vf103: simplify passing of reset halt option The pluggable reset events are invoked only in the context of proc ocd_process_reset_inner, so we can use $halt variable directly and avoid proc init_reset redefinition. Change-Id: Ie74c340c51cb2c55d8ffc9f74bb1a1a8e3461515 Signed-off-by: Tomas Vanek Reviewed-on: https://review.openocd.org/c/openocd/+/9315 Tested-by: jenkins Reviewed-by: Tom Hebb Reviewed-by: Antonio Borneo --- tcl/target/gd32vf103.cfg | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tcl/target/gd32vf103.cfg b/tcl/target/gd32vf103.cfg index 52378692a..026437b82 100644 --- a/tcl/target/gd32vf103.cfg +++ b/tcl/target/gd32vf103.cfg @@ -96,7 +96,7 @@ $_TARGETNAME configure -event reset-assert { # Since haltreq is write-only and there's no way to leave it unchanged, # we'd have to figure out its proper value anyway. set val $dmcontrol_dmactive - if {$_RESETMODE ne "run"} { + if {$halt} { set val [expr {$val | $dmcontrol_haltreq}] } riscv dmi_write $dmcontrol $val @@ -131,14 +131,3 @@ $_TARGETNAME configure -event reset-deassert-post { } } } - -# Capture the mode of a given reset so that we can use it later in the -# reset-assert handler. -proc init_reset { mode } { - global _RESETMODE - set _RESETMODE $mode - - if {[using_jtag]} { - jtag arp_init-reset - } -}