Add files for openocd v0.11
authorJoel Stanley <joel@jms.id.au>
Wed, 17 Feb 2021 06:39:47 +0000 (17:09 +1030)
committerJoel Stanley <joel@jms.id.au>
Wed, 24 Feb 2021 06:42:39 +0000 (17:12 +1030)
The protocol used by the spi bridge firmware changed as of openocd
v0.11. As this is the version packaged by Debian Bullseye, add the
firmware for convince.

Signed-off-by: Joel Stanley <joel@jms.id.au>
openocd/README
openocd/bscan_spi_xc7a100t_openocd_v0.11.bit [new file with mode: 0644]
openocd/bscan_spi_xc7a200t_openocd_v0.11.bit [new file with mode: 0644]
openocd/bscan_spi_xc7a35t_openocd_v0.11.bit [new file with mode: 0644]
openocd/flash-arty
openocd/xilinx-xc7.cfg

index 33295bf919870d693394b36575909d1e5683d33e..15a2d869b9e0d5ccd42073bddb55da5306163ab8 100644 (file)
@@ -23,10 +23,11 @@ Info : JTAG tap: xc7.tap tap/device found: 0x0362d093 (mfg: 0x049 (Xilinx), part
 Error: Unknown flash device (ID 0x00ffffff)
 
 If you find yourself with a later openocd version that contians 867bdb2e9248
-("jtagspi: new protocol that includes transfer length") you should fetch the
-bitstream from the master branch:
+("jtagspi: new protocol that includes transfer length"), such as v0.11 as
+packaged by Debian Bullseye, you should use the bitstream from the master
+branch:
 
 https://github.com/quartiq/bscan_spi_bitstreams/blob/master/bscan_spi_xc7a35t.bit?raw=true
 https://github.com/quartiq/bscan_spi_bitstreams/blob/master/bscan_spi_xc7a100t.bit?raw=true
 
-
+These are in the microwatt repository as bscan_spi_xc7a*t_openocd_v0.11.bit.
diff --git a/openocd/bscan_spi_xc7a100t_openocd_v0.11.bit b/openocd/bscan_spi_xc7a100t_openocd_v0.11.bit
new file mode 100644 (file)
index 0000000..c456de3
Binary files /dev/null and b/openocd/bscan_spi_xc7a100t_openocd_v0.11.bit differ
diff --git a/openocd/bscan_spi_xc7a200t_openocd_v0.11.bit b/openocd/bscan_spi_xc7a200t_openocd_v0.11.bit
new file mode 100644 (file)
index 0000000..851fac1
Binary files /dev/null and b/openocd/bscan_spi_xc7a200t_openocd_v0.11.bit differ
diff --git a/openocd/bscan_spi_xc7a35t_openocd_v0.11.bit b/openocd/bscan_spi_xc7a35t_openocd_v0.11.bit
new file mode 100644 (file)
index 0000000..be649f0
Binary files /dev/null and b/openocd/bscan_spi_xc7a35t_openocd_v0.11.bit differ
index 558b92929bb6ab929c67355ce3822188f69ac234..5cb534d39933145ff0c8ad588121f3476824e513 100755 (executable)
@@ -20,6 +20,15 @@ def flash(config, flash_proxy, address, data, filetype="", set_qe=False):
     print(script)
     subprocess.call(["openocd", "-f", config, "-c", script])
 
+def get_version():
+    a = subprocess.run(["openocd", "-v"], capture_output=True)
+    if a.returncode != 0:
+        return ""
+    if a.stderr.count(b"0.10"):
+        return ""
+    if a.stderr.count(b"0.11"):
+        return "_openocd_v0.11"
+
 parser = argparse.ArgumentParser()
 parser.add_argument("file", help="file to write to flash")
 parser.add_argument("-a", "--address", help="offset in flash", type=lambda x: int(x,0), default=0)
@@ -27,12 +36,14 @@ parser.add_argument("-f", "--fpga", help="a35, a100 or a200", default="a35")
 parser.add_argument("-t", "--filetype", help="file type such as 'bin'", default="")
 args = parser.parse_args()
 
+version = get_version()
+
 if args.fpga.lower() == "a35":
-        proxy = "bscan_spi_xc7a35t.bit"
+        proxy = "bscan_spi_xc7a35t{}.bit".format(version)
 elif args.fpga.lower() == "a100":
-        proxy = "bscan_spi_xc7a100t.bit"
+        proxy = "bscan_spi_xc7a100t{}.bit".format(version)
 elif args.fpga.lower() == "a200":
-        proxy = "bscan_spi_xc7a200t.bit"
+        proxy = "bscan_spi_xc7a200t{}.bit".format(version)
 else:
     print("error: specify a35, a100 or a200 when flashing")
     sys.exit()
index 5359d4ff31ccfe0ab8b422110e18b559074c2256..8824ccfcf4be1867116c90f77ff6a1916036e6e4 100644 (file)
@@ -51,10 +51,10 @@ proc jtagspi_program {bin addr {type ""} } {
        global _FLASHNAME
        if { $type eq "" } {
                flash write_image erase $bin $addr
-               flash verify_bank $_FLASHNAME $bin $addr
+               flash verify_image $bin $addr
        } else {
                flash write_image erase $bin $addr $type
-               flash verify_bank $_FLASHNAME $bin $addr $type
+               flash verify_image $bin $addr $type
        }
 }
 # end jtagspi.cfg