diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2009-10-09 09:14:27 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2009-10-09 09:14:27 +0200 |
commit | 20a3b14828c5015647fa438e0cbee84685bcdf5f (patch) | |
tree | bda0e74286ee254951492546f2d883f0fbb81bd6 /src/helper | |
parent | bffe824df6f92a2e88932c9b6d01b26b3a0cc598 (diff) | |
parent | 60e24aa597cde2703e933759aebff5d3c2dde314 (diff) | |
download | openocd+libswd-20a3b14828c5015647fa438e0cbee84685bcdf5f.tar.gz openocd+libswd-20a3b14828c5015647fa438e0cbee84685bcdf5f.tar.bz2 openocd+libswd-20a3b14828c5015647fa438e0cbee84685bcdf5f.tar.xz openocd+libswd-20a3b14828c5015647fa438e0cbee84685bcdf5f.zip |
Merge commit 'origin/master'
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/startup.tcl | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index 229aa066..b12d02bb 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -134,6 +134,23 @@ proc ocd_gdb_restart {target_id} { reset halt } + +# This reset logic may be overridden by board/target/... scripts as needed +# to provide a reset that, if possible, is close to a power-up reset. +# +# Exit requirements include: (a) JTAG must be working, (b) the scan +# chain was validated with "jtag arp_init" (or equivalent), (c) nothing +# stays in reset. No TAP-specific scans were performed. It's OK if +# some targets haven't been reset yet; they may need TAP-specific scans. +# +# The "mode" values include: halt, init, run (from "reset" command); +# startup (at OpenOCD server startup, when JTAG may not yet work); and +# potentially more (for reset types like cold, warm, etc) +proc init_reset { mode } { + jtag arp_init-reset +} + + global in_process_reset set in_process_reset 0 @@ -189,10 +206,7 @@ proc ocd_process_reset_inner { MODE } { # Use TRST or TMS/TCK operations to reset all the tap controllers. # TAP reset events get reported; they might enable some taps. - # - # REVISIT arp_init-reset pulses SRST (if it can) with TRST active; - # but SRST events aren't reported (unlike "jtag arp_reset", below) - jtag arp_init-reset + init_reset $MODE # Examine all targets on enabled taps. foreach t $targets { @@ -361,11 +375,11 @@ proc capture_catch {a} { } -# Executed during "init". Can be implemented by target script -# tar +# Executed during "init". Can be overridden +# by board/target/... scripts proc jtag_init {} { if {[catch {jtag arp_init} err]!=0} { # try resetting additionally - jtag arp_init-reset + init_reset startup } -}
\ No newline at end of file +} |