summaryrefslogtreecommitdiff
path: root/src/flash
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/flash
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/flash')
-rw-r--r--src/flash/Makefile.am2
-rw-r--r--src/flash/startup.tcl16
2 files changed, 18 insertions, 0 deletions
diff --git a/src/flash/Makefile.am b/src/flash/Makefile.am
index bbcc34c3..b687182d 100644
--- a/src/flash/Makefile.am
+++ b/src/flash/Makefile.am
@@ -79,4 +79,6 @@ noinst_HEADERS = \
s3c24xx_nand.h \
s3c24xx_regs_nand.h
+EXTRA_DIST = startup.tcl
+
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
diff --git a/src/flash/startup.tcl b/src/flash/startup.tcl
new file mode 100644
index 00000000..fcebbe01
--- /dev/null
+++ b/src/flash/startup.tcl
@@ -0,0 +1,16 @@
+# Defines basic Tcl procs for OpenOCD flash module
+
+# Show flash in human readable form
+# This is an example of a human readable form of a low level fn
+proc flash_banks {} {
+ set i 0
+ set result ""
+ foreach {a} [ocd_flash_banks] {
+ if {$i > 0} {
+ set result "$result\n"
+ }
+ set result [format "$result#%d: %s at 0x%08x, size 0x%08x, buswidth %d, chipwidth %d" $i $a(name) $a(base) $a(size) $a(bus_width) $a(chip_width)]
+ set i [expr $i+1]
+ }
+ return $result
+}