---
 flash/flash-rescue.batch |   10 ----------
 flash/flash-rescue.sh    |    4 ----
 flash/flash.batch        |   10 ----------
 flash/flash.sh           |   29 ++++++++++++++++++++++++++++-
 4 files changed, 28 insertions(+), 25 deletions(-)
 delete mode 100644 flash/flash-rescue.batch
 delete mode 100755 flash/flash-rescue.sh
 delete mode 100644 flash/flash.batch

diff --git a/flash/flash-rescue.batch b/flash/flash-rescue.batch
deleted file mode 100644
index 0c0201d..0000000
--- a/flash/flash-rescue.batch
+++ /dev/null
@@ -1,10 +0,0 @@
-cable milkymist
-detect
-instruction CFG_OUT 000100 BYPASS
-instruction CFG_IN 000101 BYPASS
-pld load fjmem.bit
-initbus fjmem opcode=000010
-frequency 6000000
-detectflash 0
-endian big
-flashmem 0x2E0000 ../src/flickernoise.fbiz noverify
diff --git a/flash/flash-rescue.sh b/flash/flash-rescue.sh
deleted file mode 100755
index 81a6a88..0000000
--- a/flash/flash-rescue.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-set -e
-make -C ../src flickernoise.fbiz
-jtag -n flash-rescue.batch
diff --git a/flash/flash.batch b/flash/flash.batch
deleted file mode 100644
index 8091a20..0000000
--- a/flash/flash.batch
+++ /dev/null
@@ -1,10 +0,0 @@
-cable milkymist
-detect
-instruction CFG_OUT 000100 BYPASS
-instruction CFG_IN 000101 BYPASS
-pld load fjmem.bit
-initbus fjmem opcode=000010
-frequency 6000000
-detectflash 0
-endian big
-flashmem 0x920000 ../src/flickernoise.fbiz noverify
diff --git a/flash/flash.sh b/flash/flash.sh
index 54fae19..3c16c7f 100755
--- a/flash/flash.sh
+++ b/flash/flash.sh
@@ -1,4 +1,31 @@
 #!/bin/sh
+
 set -e
+
 make -C ../src flickernoise.fbiz
-jtag -n flash.batch
+
+BATCH_FILE=flash.batch
+
+ADDRESS=0x920000
+if [ "$1" == "rescue" ]; then
+    ADDRESS=0x2E0000
+fi
+
+batch() {
+    echo -e "$1" >> "${BATCH_FILE}"
+}
+
+rm -rf ${BATCH_FILE}
+
+batch "cable milkymist"
+batch "detect"
+batch "instruction CFG_OUT 000100 BYPASS"
+batch "instruction CFG_IN 000101 BYPASS"
+batch "pld load fjmem.bit"
+batch "initbus fjmem opcode=000010"
+batch "frequency 6000000"
+batch "detectflash 0"
+batch "endian big"
+batch "flashmem ${ADDRESS} ../src/flickernoise.fbiz noverify"
+
+jtag -n flash.batch.tmp
-- 
1.7.0.4

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode
Twitter: www.twitter.com/milkymistvj
Ideas? http://milkymist.uservoice.com

Reply via email to