summaryrefslogtreecommitdiff
path: root/src/jtag
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-17 08:29:20 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-18 07:21:42 -0800
commitcb7dbc1af41068f826246beb53870c01d8973bb8 (patch)
treeb32165dedbf769d667d0a3deeb86e4183f1bfb9e /src/jtag
parent903daa796a226152fe56245758c8388b79d12988 (diff)
downloadopenocd_libswd-cb7dbc1af41068f826246beb53870c01d8973bb8.tar.gz
openocd_libswd-cb7dbc1af41068f826246beb53870c01d8973bb8.tar.bz2
openocd_libswd-cb7dbc1af41068f826246beb53870c01d8973bb8.tar.xz
openocd_libswd-cb7dbc1af41068f826246beb53870c01d8973bb8.zip
split startup.tcl file across modules
Moves definitions for each layer into their own file, eliminating layering violations in the built-in TCL code. Updates src/Makefile.am rules to include all files in the final startup.tcl input file, and others Makefile.am rules to distribute the new files in our packages.
Diffstat (limited to 'src/jtag')
-rw-r--r--src/jtag/Makefile.am2
-rw-r--r--src/jtag/startup.tcl41
2 files changed, 43 insertions, 0 deletions
diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am
index ba722c6d..85d98c07 100644
--- a/src/jtag/Makefile.am
+++ b/src/jtag/Makefile.am
@@ -94,4 +94,6 @@ noinst_HEADERS = \
rlink/st7.h \
minidummy/jtag_minidriver.h
+EXTRA_DIST = startup.tcl
+
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl
new file mode 100644
index 00000000..999f5d02
--- /dev/null
+++ b/src/jtag/startup.tcl
@@ -0,0 +1,41 @@
+# Defines basic Tcl procs for OpenOCD JTAG module
+
+# Executed during "init". Can be overridden
+# by board/target/... scripts
+proc jtag_init {} {
+ if {[catch {jtag arp_init} err]!=0} {
+ # try resetting additionally
+ init_reset startup
+ }
+}
+
+#########
+
+# TODO: power_restore and power_dropout are currently neither
+# documented nor supported except on ZY1000.
+
+proc power_restore {} {
+ puts "Sensed power restore."
+ reset init
+}
+
+add_help_text power_restore "Overridable procedure run when power restore is detected. Runs 'reset init' by default."
+
+proc power_dropout {} {
+ puts "Sensed power dropout."
+}
+
+#########
+
+# TODO: srst_deasserted and srst_asserted are currently neither
+# documented nor supported except on ZY1000.
+
+proc srst_deasserted {} {
+ puts "Sensed nSRST deasserted."
+ reset init
+}
+add_help_text srst_deasserted "Overridable procedure run when srst deassert is detected. Runs 'reset init' by default."
+
+proc srst_asserted {} {
+ puts "Sensed nSRST asserted."
+}