tinyriscv-openocd/tcl/cpld
Robert Jordens 867bdb2e92 jtagspi: new protocol that includes transfer length
This commit contains a rewrite of the jtagspi protocol and covers both
changes in the jtagspi.c openocd driver and the bscan_spi
(xilinx_bscan_spi) proxy bitstreams. The changes are as follows:

1. Always perform IR scan to ensure proper clearing of BYPASSed DRs.
2. Insert alignment cycles for all BYPASSed TAPs:

  The previous logic was erroneous. The delay in clock cyles from a bit
  written to the jtag interface to a bit read by the jtag interface is:

  * The number of BYPASSed TAPs before this (jtagspi) tap
  * The length of the jtagspi data register (1)
  * The number of BYPASSed TAPs before this one.

  I.e. it is just the number of enabled TAPs. This also gets rid of the
  configuration parameter DR_LENGTH.

3. Use marker bit to start spi transfer

  If there are TAPs ahead of this one on the JTAG chain, and we are in
  DR-SHIFT, there will be old bits toggled through first before the first
  valid bit destined for the flash.
  This delays the begin of the JTAGSPI transaction until the first high bit.

4. New jtagspi protocol

  A JTAGSPI transfer now consists of:

  * an arbitrary number of 0 bits (from BYPASS registers in front of the
    JTAG2SPI DR)
  * a marker bit (1) indicating the start of the JTAG2SPI transaction
  * 32 bits (big endian) describing the length of the SPI transaction
  * a number of SPI clock cycles (corresponding to 3.) with CS_N asserted
  * an arbitrary number of cycles (to shift MISO/TDO data through
    subsequent BYPASS registers)

5. xilinx_bscan_spi: clean up, add ultrascale

This is tested on the following configurations:

* KC705: XC7K325T
* Sayma AMC: XCKU040
* Sayma AMC + RTM): XCKU040 + XC7A15T, a board with integrated FTDI JTAG
  adapter, SCANSTA JTAG router, a Xilinx Ultrascale XCKU040 and a Xilinx
  Artix 7 15T. https://github.com/m-labs/sinara/wiki/Sayma
* Custom board with Lattice FPGA + XC7A35T
* CUstom board with 3x XCKU115-2FLVA1517E

Change-Id: I7361e9fb284ebb916302941735eebef3612aa103
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/4236
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2018-01-13 19:36:42 +00:00
..
altera-5m570z-cpld.cfg tcl/cpld: add config file for Altera 5M570Z CPLD (MAXV family) 2017-05-09 21:41:46 +01:00
altera-epm240.cfg tcl/cpld: add config file for Altera EPM240 CPLD (MAXII family) 2016-08-14 02:05:34 +01:00
jtagspi.cfg jtagspi: new protocol that includes transfer length 2018-01-13 19:36:42 +00:00
lattice-lc4032ze.cfg Add config file for Lattice LC4032ZE CPLD (ispMACH 4000ZE family) 2012-07-17 08:29:32 +00:00
xilinx-xc6s.cfg tcl: Support for reading "Device DNA" from Spartan 6 devices. 2015-10-21 09:11:48 +01:00
xilinx-xc7.cfg xilinx-xc7: correct Artix7 15T IDCODE 2016-08-10 09:42:37 +01:00
xilinx-xcf-p.cfg XCF (Xilinx platfrom flash) support. 2018-01-13 09:13:14 +00:00
xilinx-xcf-s.cfg XCF (Xilinx platfrom flash) support. 2018-01-13 09:13:14 +00:00
xilinx-xcr3256.cfg Xilinx xcr3256.cfg basic config script 2009-10-12 15:12:35 +02:00