aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorDaniel Anselmi <danselmi@gmx.ch>2023-03-21 23:23:12 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2023-05-27 06:44:31 +0000
commit78688fea984b69d1986b6b730ff2935668cc9208 (patch)
treeeb7974054e6ce0b1b9912a52d219fe19c778cca2 /tcl
parent2dd34cbe0b6d8d485a63b039058085b7ceec70e6 (diff)
downloadriscv-openocd-78688fea984b69d1986b6b730ff2935668cc9208.zip
riscv-openocd-78688fea984b69d1986b6b730ff2935668cc9208.tar.gz
riscv-openocd-78688fea984b69d1986b6b730ff2935668cc9208.tar.bz2
flash/jtagspi: sending command and setting parameters without probing.
Change-Id: I6b9d90265ca5112b9ab2aae97bb4c6cf3ebc4112 Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7432 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Diffstat (limited to 'tcl')
-rw-r--r--tcl/cpld/jtagspi.cfg12
1 files changed, 11 insertions, 1 deletions
diff --git a/tcl/cpld/jtagspi.cfg b/tcl/cpld/jtagspi.cfg
index 7071e5e..4c84792 100644
--- a/tcl/cpld/jtagspi.cfg
+++ b/tcl/cpld/jtagspi.cfg
@@ -23,11 +23,21 @@ if { [info exists FLASHNAME] } {
target create $_TARGETNAME testee -chain-position $_CHIPNAME.tap
flash bank $_FLASHNAME jtagspi 0 0 0 0 $_TARGETNAME $_JTAGSPI_IR
-proc jtagspi_init {chain_id proxy_bit} {
+# initialize jtagspi flash
+# chain_id: identifier of pld (you can get a list with 'pld devices')
+# proxy_bit: file with bitstream connecting JTAG and SPI interface in the PLD.
+# release_from_pwr_down_cmd: optional, command sent to spi flash before probing.
+# ex: 0xAB to release from power-dowm.
+# Just omit it to not send a command.
+
+proc jtagspi_init {chain_id proxy_bit {release_from_pwr_down_cmd -1}} {
# load proxy bitstream $proxy_bit and probe spi flash
global _FLASHNAME
pld load $chain_id $proxy_bit
reset halt
+ if {$release_from_pwr_down_cmd != -1} {
+ jtagspi cmd $_FLASHNAME 0 $release_from_pwr_down_cmd
+ }
flash probe $_FLASHNAME
}