aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-11-03 10:43:48 -0700
committerTim Newsome <tim@sifive.com>2023-11-06 09:25:46 -0800
commitb5bd88441c3745e37f87c9940809f212f96c3547 (patch)
tree45185424e522f840668faf88ebfab333e62065ac /tcl
parentb75bfab0261aa06597ee68895884a62eabceec18 (diff)
parent05ee88915520d1dd82da94a016a9374a1f3a8129 (diff)
downloadriscv-openocd-b5bd88441c3745e37f87c9940809f212f96c3547.zip
riscv-openocd-b5bd88441c3745e37f87c9940809f212f96c3547.tar.gz
riscv-openocd-b5bd88441c3745e37f87c9940809f212f96c3547.tar.bz2
Merge commit '05ee88915520d1dd82da94a016a9374a1f3a8129' into from_upstream
Conflicts: src/jtag/drivers/xds110.c src/target/riscv/riscv.c src/target/riscv/riscv_semihosting.c tcl/target/esp_common.cfg Change-Id: If0c02817df03b7fd700cc84b4da2c02d36737d28
Diffstat (limited to 'tcl')
-rw-r--r--tcl/board/bemicro_cycloneiii.cfg2
-rw-r--r--tcl/board/snps_hsdk_4xd.cfg19
-rw-r--r--tcl/cpld/xilinx-xc3s.cfg40
-rw-r--r--tcl/cpld/xilinx-xc4v.cfg31
-rw-r--r--tcl/cpld/xilinx-xc4vfx_40_60_100_140.cfg22
-rw-r--r--tcl/cpld/xilinx-xc5v.cfg41
-rw-r--r--tcl/cpld/xilinx-xc5vfx_100_130_200.cfg21
-rw-r--r--tcl/cpld/xilinx-xc6s.cfg5
-rw-r--r--tcl/cpld/xilinx-xc6v.cfg35
-rw-r--r--tcl/cpld/xilinx-xc7.cfg15
-rw-r--r--tcl/cpld/xilinx-xc7v.cfg37
-rw-r--r--tcl/cpld/xilinx-xc7vh580t.cfg25
-rw-r--r--tcl/cpld/xilinx-xc7vh870t.cfg28
-rw-r--r--tcl/cpld/xilinx-xcu.cfg102
-rw-r--r--tcl/fpga/altera-arriaii.cfg2
-rw-r--r--tcl/fpga/altera-cycloneiii.cfg2
-rw-r--r--tcl/fpga/altera-cycloneiv.cfg2
-rw-r--r--tcl/fpga/altera-cyclonev.cfg2
-rw-r--r--tcl/fpga/efinix_titanium.cfg2
-rw-r--r--tcl/fpga/efinix_trion.cfg2
-rw-r--r--tcl/fpga/gatemate.cfg2
-rw-r--r--tcl/fpga/gowin_gw1n.cfg2
-rw-r--r--tcl/fpga/lattice_certus.cfg2
-rw-r--r--tcl/fpga/lattice_certuspro.cfg2
-rw-r--r--tcl/fpga/lattice_ecp2.cfg2
-rw-r--r--tcl/fpga/lattice_ecp3.cfg2
-rw-r--r--tcl/fpga/lattice_ecp5.cfg2
-rw-r--r--tcl/interface/angie.cfg9
-rw-r--r--tcl/interface/ftdi/sipeed-rv-debugger.cfg13
-rw-r--r--tcl/interface/stlink-dap.cfg2
-rw-r--r--tcl/interface/stlink.cfg2
-rw-r--r--tcl/target/snps_hsdk_4xd.cfg50
-rw-r--r--tcl/target/ti-cjtag.cfg1
-rw-r--r--tcl/target/zynq_7000.cfg4
34 files changed, 474 insertions, 56 deletions
diff --git a/tcl/board/bemicro_cycloneiii.cfg b/tcl/board/bemicro_cycloneiii.cfg
index 7781bd5..95dd394 100644
--- a/tcl/board/bemicro_cycloneiii.cfg
+++ b/tcl/board/bemicro_cycloneiii.cfg
@@ -12,7 +12,7 @@ transport select jtag
adapter speed 10000
-source [find cpld/altera-cycloneiii.cfg]
+source [find fpga/altera-cycloneiii.cfg]
#quartus_cpf --option=bitstream_compression=off -c output_files\cycloneiii_blinker.sof cycloneiii_blinker.rbf
diff --git a/tcl/board/snps_hsdk_4xd.cfg b/tcl/board/snps_hsdk_4xd.cfg
new file mode 100644
index 0000000..5901533
--- /dev/null
+++ b/tcl/board/snps_hsdk_4xd.cfg
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Copyright (C) 2023 Synopsys, Inc.
+# Artemiy Volkov <artemiy@synopsys.com>
+
+# Adapted from tcl/board/snps_hsdk.cfg.
+
+#
+# Synopsys DesignWare ARC HSDK Software Development Platform (HS47D cores)
+#
+
+source [find interface/ftdi/snps_sdp.cfg]
+adapter speed 10000
+
+# ARCs supports only JTAG.
+transport select jtag
+
+# Configure SoC
+source [find target/snps_hsdk_4xd.cfg]
diff --git a/tcl/cpld/xilinx-xc3s.cfg b/tcl/cpld/xilinx-xc3s.cfg
new file mode 100644
index 0000000..a886739
--- /dev/null
+++ b/tcl/cpld/xilinx-xc3s.cfg
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx spartan3
+# https://docs.xilinx.com/v/u/en-US/ug332
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc3s
+}
+
+# the 4 top bits (28:31) are the die stepping. ignore it.
+jtag newtap $_CHIPNAME tap -irlen 6 -ignore-version \
+ -expected-id 0x01414093 \
+ -expected-id 0x0141C093 \
+ -expected-id 0x01428093 \
+ -expected-id 0x01434093 \
+ -expected-id 0x01440093 \
+ -expected-id 0x01448093 \
+ -expected-id 0x01450093 \
+ -expected-id 0x01C10093 \
+ -expected-id 0x01C1A093 \
+ -expected-id 0x01C22093 \
+ -expected-id 0x01C2E093 \
+ -expected-id 0x01C3A093 \
+ -expected-id 0x0140C093 \
+ -expected-id 0x02210093 \
+ -expected-id 0x02218093 \
+ -expected-id 0x02220093 \
+ -expected-id 0x02228093 \
+ -expected-id 0x02230093 \
+ -expected-id 0x02610093 \
+ -expected-id 0x02618093 \
+ -expected-id 0x02620093 \
+ -expected-id 0x02628093 \
+ -expected-id 0x02630093 \
+ -expected-id 0x03840093 \
+ -expected-id 0x0384e093
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
diff --git a/tcl/cpld/xilinx-xc4v.cfg b/tcl/cpld/xilinx-xc4v.cfg
new file mode 100644
index 0000000..3eb46eb
--- /dev/null
+++ b/tcl/cpld/xilinx-xc4v.cfg
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx virtex 4
+# https://docs.xilinx.com/v/u/en-US/ug071
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc4v
+}
+
+# the 4 top bits (28:31) are the die stepping. ignore it.
+jtag newtap $_CHIPNAME tap -irlen 10 -ignore-version \
+ -expected-id 0x01658093 \
+ -expected-id 0x01E58093 \
+ -expected-id 0x0167C093 \
+ -expected-id 0x02068093 \
+ -expected-id 0x01E64093 \
+ -expected-id 0x016A4093 \
+ -expected-id 0x02088093 \
+ -expected-id 0x016B4093 \
+ -expected-id 0x020B0093 \
+ -expected-id 0x016D8093 \
+ -expected-id 0x01700093 \
+ -expected-id 0x01718093 \
+ -expected-id 0x01734093
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
+# cfg_out cfg_in jprogb jstart jshutdown user1-4
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3C4 0x3C5 0x3CB 0x3CC 0x3CD
+virtex2 set_user_codes $_CHIPNAME.pld 0x3C2 0x3C3 0x3E2 0x3E3
diff --git a/tcl/cpld/xilinx-xc4vfx_40_60_100_140.cfg b/tcl/cpld/xilinx-xc4vfx_40_60_100_140.cfg
new file mode 100644
index 0000000..14dde02
--- /dev/null
+++ b/tcl/cpld/xilinx-xc4vfx_40_60_100_140.cfg
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx virtex 4
+# https://docs.xilinx.com/v/u/en-US/ug071
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc4vfx
+}
+
+# the 4 top bits (28:31) are the die stepping. ignore it.
+jtag newtap $_CHIPNAME tap -irlen 14 -ignore-version \
+ -expected-id 0x01E8C093 \
+ -expected-id 0x01EB4093 \
+ -expected-id 0x01EE4093 \
+ -expected-id 0x01F14093 \
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
+# cfg_out cfg_in jprogb jstart jshutdown user1-4
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3FC4 0x3FC5 0x3FCB 0x3FCC 0x3FCD
+virtex2 set_user_codes $_CHIPNAME.pld 0x3FC2 0x3FC3 0x3FE2 0x3FE3
diff --git a/tcl/cpld/xilinx-xc5v.cfg b/tcl/cpld/xilinx-xc5v.cfg
new file mode 100644
index 0000000..f88bbc1
--- /dev/null
+++ b/tcl/cpld/xilinx-xc5v.cfg
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx virtex 5
+# https://docs.xilinx.com/v/u/en-US/ug191
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc5v
+}
+
+# the 4 top bits (28:31) are the die stepping. ignore it.
+jtag newtap $_CHIPNAME tap -irlen 10 -ignore-version \
+ -expected-id 0x0286E093 \
+ -expected-id 0x02896093 \
+ -expected-id 0x028AE093 \
+ -expected-id 0x028D6093 \
+ -expected-id 0x028EC093 \
+ -expected-id 0x0290C093 \
+ -expected-id 0x0295C093 \
+ -expected-id 0x02A56093 \
+ -expected-id 0x02A6E093 \
+ -expected-id 0x02A96093 \
+ -expected-id 0x02AAE093 \
+ -expected-id 0x02AD6093 \
+ -expected-id 0x02AEC093 \
+ -expected-id 0x02B0C093 \
+ -expected-id 0x02B5C093 \
+ -expected-id 0x02E72093 \
+ -expected-id 0x02E9A093 \
+ -expected-id 0x02ECE093 \
+ -expected-id 0x02F3E093 \
+ -expected-id 0x03276093 \
+ -expected-id 0x032C6093 \
+ -expected-id 0x04502093 \
+ -expected-id 0x0453E093
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
+# cfg_out cfg_in jprogb jstart jshutdown user1-4
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3C4 0x3C5 0x3CB 0x3CC 0x3CD
+virtex2 set_user_codes $_CHIPNAME.pld 0x3C2 0x3C3 0x3E2 0x3E3
diff --git a/tcl/cpld/xilinx-xc5vfx_100_130_200.cfg b/tcl/cpld/xilinx-xc5vfx_100_130_200.cfg
new file mode 100644
index 0000000..7420233
--- /dev/null
+++ b/tcl/cpld/xilinx-xc5vfx_100_130_200.cfg
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx virtex 5
+# https://docs.xilinx.com/v/u/en-US/ug191
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc5vfx
+}
+
+# the 4 top bits (28:31) are the die stepping. ignore it.
+jtag newtap $_CHIPNAME tap -irlen 14 -ignore-version \
+ -expected-id 0x032D8093 \
+ -expected-id 0x03300093 \
+ -expected-id 0x03334093
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
+# cfg_out cfg_in jprogb jstart jshutdown user1-4
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3FC4 0x3FC5 0x3FCB 0x3FCC 0x3FCD
+virtex2 set_user_codes $_CHIPNAME.pld 0x3FC2 0x3FC3 0x3FE2 0x3FE3
diff --git a/tcl/cpld/xilinx-xc6s.cfg b/tcl/cpld/xilinx-xc6s.cfg
index 82b87fb..92b2605 100644
--- a/tcl/cpld/xilinx-xc6s.cfg
+++ b/tcl/cpld/xilinx-xc6s.cfg
@@ -25,7 +25,8 @@ jtag newtap $_CHIPNAME tap -irlen 6 -ignore-version \
-expected-id 0x0401D093 \
-expected-id 0x0403D093
-pld device virtex2 $_CHIPNAME.tap
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
+virtex2 set_user_codes $_CHIPNAME.pld 0x02 0x03 0x1A 0x1B
set XC6S_CFG_IN 0x05
set XC6S_JSHUTDOWN 0x0d
@@ -34,6 +35,7 @@ set XC6S_JSTART 0x0c
set XC6S_BYPASS 0x3f
proc xc6s_program {tap} {
+ echo "DEPRECATED! use 'virtex2 program ...' not 'xc6s_program'"
global XC6S_JSHUTDOWN XC6S_JPROGRAM XC6S_JSTART XC6S_BYPASS
irscan $tap $XC6S_JSHUTDOWN
irscan $tap $XC6S_JPROGRAM
@@ -43,6 +45,7 @@ proc xc6s_program {tap} {
#xtp038 and xc3sprog approach
proc xc6s_program_iprog {tap} {
+ echo "DEPRECATED! use 'virtex2 program ...' not 'xc6s_program_iprog'"
global XC6S_JSHUTDOWN XC6S_JSTART XC6S_BYPASS XC6S_CFG_IN
irscan $tap $XC6S_JSHUTDOWN
runtest 16
diff --git a/tcl/cpld/xilinx-xc6v.cfg b/tcl/cpld/xilinx-xc6v.cfg
new file mode 100644
index 0000000..d37439c
--- /dev/null
+++ b/tcl/cpld/xilinx-xc6v.cfg
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx virtex 6
+# https://www.xilinx.com/support/documentation/user_guides/ug360.pdf
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc6v
+}
+
+# the 4 top bits (28:31) are the die stepping. ignore it.
+jtag newtap $_CHIPNAME tap -irlen 10 -ignore-version \
+ -expected-id 0x042A2093 \
+ -expected-id 0x042A4093 \
+ -expected-id 0x042A8093 \
+ -expected-id 0x042AC093 \
+ -expected-id 0x04244093 \
+ -expected-id 0x0424A093 \
+ -expected-id 0x0424C093 \
+ -expected-id 0x04250093 \
+ -expected-id 0x04252093 \
+ -expected-id 0x04256093 \
+ -expected-id 0x0423A093 \
+ -expected-id 0x04286093 \
+ -expected-id 0x04288093 \
+ -expected-id 0x042C4093 \
+ -expected-id 0x042CA093 \
+ -expected-id 0x042CC093 \
+ -expected-id 0x042D0093
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
+# cfg_out cfg_in jprogb jstart jshutdown user1-4
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3C4 0x3C5 0x3CB 0x3CC 0x3CD
+virtex2 set_user_codes $_CHIPNAME.pld 0x3C2 0x3C3 0x3E2 0x3E3
diff --git a/tcl/cpld/xilinx-xc7.cfg b/tcl/cpld/xilinx-xc7.cfg
index 91a07f9..f5b0733 100644
--- a/tcl/cpld/xilinx-xc7.cfg
+++ b/tcl/cpld/xilinx-xc7.cfg
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
-# xilinx series 7 (artix, kintex, virtex)
+# xilinx series 7 (spartan, artix, kintex, virtex)
# http://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
if { [info exists CHIPNAME] } {
@@ -40,16 +40,8 @@ jtag newtap $_CHIPNAME tap -irlen 6 -ignore-version \
-expected-id 0x03691093 \
-expected-id 0x03696093
-#jtag newtap $_CHIPNAME tap -irlen 24 -ignore-version \
-# -expected-id 0x036B3093 -expected-id 0x036B7093 \
-# -expected-id 0x036BB093 -expected-id 0x036BF093 \
-# -expected-id 0x036D5093
-
-#jtag newtap $_CHIPNAME tap -irlen 22 -ignore-version -expected-id 0x036D9093
-
-#jtag newtap $_CHIPNAME tap -irlen 38 -ignore-version -expected-id 0x036DB093
-
-pld device virtex2 $_CHIPNAME.tap 1
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap -no_jstart
+virtex2 set_user_codes $_CHIPNAME.pld 0x02 0x03 0x22 0x23
set XC7_JSHUTDOWN 0x0d
set XC7_JPROGRAM 0x0b
@@ -57,6 +49,7 @@ set XC7_JSTART 0x0c
set XC7_BYPASS 0x3f
proc xc7_program {tap} {
+ echo "DEPRECATED! use 'virtex2 program ...' not 'xc7_program'"
global XC7_JSHUTDOWN XC7_JPROGRAM XC7_JSTART XC7_BYPASS
irscan $tap $XC7_JSHUTDOWN
irscan $tap $XC7_JPROGRAM
diff --git a/tcl/cpld/xilinx-xc7v.cfg b/tcl/cpld/xilinx-xc7v.cfg
new file mode 100644
index 0000000..8385948
--- /dev/null
+++ b/tcl/cpld/xilinx-xc7v.cfg
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx series 7 (artix, kintex, virtex)
+# http://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
+# https://bsdl.info/view.htm?sid=08e275a0cd3ac38988ca59b002289d77
+# https://bsdl.info/view.htm?sid=44dae65d3cf9593188ca59b002289d77
+#
+# this config file is for XC7VX1140T and XC7V2000T only.
+# for other virtex-7 devices use xilinx-xc7vh580t.cfg or xilinx-xc7vh870t.cfg or xilinx-xc7.cfg
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc7v
+}
+
+#0x036D5093: XC7VX1140T
+#0x036By093: XC7V2000T
+#y = xx11 = 3, 7, B or F
+
+jtag newtap $_CHIPNAME tap -irlen 24 -ignore-version \
+ -expected-id 0x036B3093 -expected-id 0x036B7093 \
+ -expected-id 0x036BB093 -expected-id 0x036BF093 \
+ -expected-id 0x036D5093
+
+#CFG_OUT_SLR0 0x124924
+#CFG_IN_SLR0 0x164924
+#CFG_OUT_SLR1 0x904924
+#CFG_IN_SLR1 0x905924
+#CFG_OUT_SLR2 0x924124
+#CFG_IN_SLR2 0x924164
+#CFG_OUT_SLR3 0x924904
+#CFG_IN_SLR3 0x924905
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap -no_jstart
+# cfg_out cfg_in jprogb jstart jshutdown
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3FFFFF 0x3FFFFF 0x2CB2CB 0x30C30C 0x34D34D
diff --git a/tcl/cpld/xilinx-xc7vh580t.cfg b/tcl/cpld/xilinx-xc7vh580t.cfg
new file mode 100644
index 0000000..3748049
--- /dev/null
+++ b/tcl/cpld/xilinx-xc7vh580t.cfg
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx series 7 (artix, kintex, virtex)
+# http://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
+# https://bsdl.info/view.htm?sid=65c6b2cfe1467b4988ca59b002289d77
+#
+# this config file is for xc7vh580t only.
+# for other virtex-7 devices use xilinx-xc7vh870t.cfg or xilinx-xc7v.cfg or xilinx-xc7.cfg
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc7vh580t
+}
+
+jtag newtap $_CHIPNAME tap -irlen 22 -ignore-version -expected-id 0x036D9093
+
+#CFG_OUT_SLR0 0x0492A0
+#CFG_IN_SLR0 0x0592A0
+#CFG_OUT_SLR1 0x2412A0
+#CFG_IN_SLR1 0x2416A0
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap -no_jstart
+# cfg_out cfg_in jprogb jstart jshutdown
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3FFFFF 0x3FFFFF 0x0B2EA0 0x0C32A0 0x0D36A0
diff --git a/tcl/cpld/xilinx-xc7vh870t.cfg b/tcl/cpld/xilinx-xc7vh870t.cfg
new file mode 100644
index 0000000..25e2e63
--- /dev/null
+++ b/tcl/cpld/xilinx-xc7vh870t.cfg
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# xilinx series 7 (artix, kintex, virtex)
+# http://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
+# https://bsdl.info/view.htm?sid=d9ff0bb764df004588ca59b002289d77
+#
+# this config file is for xc7vh870t only.
+# for other virtex-7 devices use xilinx-xc7vh580t.cfg or xilinx-xc7v.cfg or xilinx-xc7.cfg
+#
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME xc7vh870t
+}
+
+jtag newtap $_CHIPNAME tap -irlen 38 -ignore-version -expected-id 0x036DB093
+
+#CFG_OUT_SLR0 0x0492A092A0
+#CFG_IN_SLR0 0x0592A092A0
+#CFG_OUT_SLR1 0x2412A092A0
+#CFG_IN_SLR1 0x2416A092A0
+#CFG_OUT_SLR2 0x2492A012A0
+#CFG_IN_SLR2 0x2492A016A0
+
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap -no_jstart
+# cfg_out cfg_in jprogb jstart jshutdown
+virtex2 set_instr_codes $_CHIPNAME.pld 0x3FFFFFFFFF 0x3FFFFFFFFF 0x0B2EA02EA0 0x0C32A032A0 0x0D36A036A0
diff --git a/tcl/cpld/xilinx-xcu.cfg b/tcl/cpld/xilinx-xcu.cfg
index 9df696d..4d7f26c 100644
--- a/tcl/cpld/xilinx-xcu.cfg
+++ b/tcl/cpld/xilinx-xcu.cfg
@@ -12,32 +12,61 @@ if { [info exists CHIPNAME] } {
# The various chips in the Ultrascale family have different IR length.
# Set $CHIP before including this file to determine the device.
array set _XCU_DATA {
- XCKU025 {0x03824093 6}
- XCKU035 {0x03823093 6}
- XCKU040 {0x03822093 6}
- XCKU060 {0x03919093 6}
- XCKU095 {0x03844093 6}
- XCKU3P {0x04A63093 6}
- XCKU5P {0x04A62093 6}
- XCKU9P {0x0484A093 6}
- XCKU11P {0x04A4E093 6}
- XCKU13P {0x04A52093 6}
- XCKU15P {0x04A56093 6}
- XCVU065 {0x03939093 6}
- XCVU080 {0x03843093 6}
- XCVU095 {0x03842093 6}
- XCVU3P {0x04B39093 6}
- XCKU085 {0x0380F093 12}
- XCKU115 {0x0390D093 12}
- XCVU125 {0x0392D093 12}
- XCVU5P {0x04B2B093 12}
- XCVU7P {0x04B29093 12}
- XCVU160 {0x03933093 18}
- XCVU190 {0x03931093 18}
- XCVU440 {0x0396D093 18}
- XCVU9P {0x04B31093 18}
- XCVU11P {0x04B49093 18}
- XCVU13P {0x04B51093 24}
+ XCKU025 {0x03824093 6}
+ XCKU035 {0x03823093 6}
+ XCKU040 {0x03822093 6}
+ XCKU060 {0x03919093 6}
+ XCKU060_CIV {0x0381b093 6}
+ XCKU095 {0x03844093 6}
+ XCKU095_CIV {0x03845093 6}
+ XCKU3P {0x04A63093 6}
+ XCKU5P {0x04A62093 6}
+ XCKU9P {0x0484A093 6}
+ XCKU11P {0x04A4E093 6}
+ XCKU11P_CIV {0x04A51093 6}
+ XCKU13P {0x04A52093 6}
+ XCKU15P {0x04A56093 6}
+ XCKU15P_CIV {0x04A59093 6}
+ XCVU065 {0x03939093 6}
+ XCVU065_CIV {0x0393b093 6}
+ XCVU080 {0x03843093 6}
+ XCVU080_CIV {0x03845093 6}
+ XCVU095 {0x03842093 6}
+ XCVU2P {0x04aea093 6}
+ XCVU3P {0x04B39093 6}
+ XCVU3P_CIV {0x04b3d093 6}
+ XCAU10P {0x04AC4033 6}
+ XCAU10P_FFVB676 {0x04AC4093 6}
+ XCAU15P {0x04AC2033 6}
+ XCAU15P_FFVB676 {0x04AC2093 6}
+ XCAU20P {0x04A65093 6}
+ XCAU25P {0x04A64093 6}
+ XCKU5P_CIV {0x04A64093 6}
+ XCKU19P {0x04ACF093 6}
+ XCKU19P_CIV {0x04AD3093 6}
+ XCKU085 {0x0380F093 12}
+ XCKU115 {0x0390D093 12}
+ XCVU125 {0x0392D093 12}
+ XCVU125_CIV {0x0392f093 12}
+ XCVU5P {0x04B2B093 12}
+ XCVU5P_CIV {0x04b2f093 12}
+ XCVU7P {0x04B29093 12}
+ XCVU7P_CIV {0x04b2d093 12}
+ XCVU160 {0x03933093 18}
+ XCVU190 {0x03931093 18}
+ XCVU440 {0x0396D093 18}
+ XCVU440_CIV {0x0396f093 18}
+ XCVU9P {0x04B31093 18}
+ XCVU9P_CIV {0x04b35093 18}
+ XCVU11P {0x04B49093 18}
+ XCVU11P_CIV {0x04b4f093 18}
+ XCU200_FSGD2104 {0x04b37093 18}
+ XCU250 {0x04b57093 24}
+ XCVU13P {0x04B51093 24}
+ XCVU13P_CIV {0x04b55093 24}
+ XCVU15P {0x04ba3093 24}
+ XCVU19P {0x04ba1093 24}
+ XCVU19P_CIV {0x04ba5093 24}
}
if { ![info exists CHIP] } {
@@ -54,7 +83,25 @@ set _IRLEN [lindex $_XCU_DATA($CHIP) 1]
# the 4 top bits (28:31) are the die stepping/revisions. ignore it.
jtag newtap $_CHIPNAME tap -irlen $_IRLEN -ignore-version -expected-id $_EXPID
-pld device virtex2 $_CHIPNAME.tap 1
+pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap -no_jstart
+
+# set the correct instruction codes for jtag hub and
+# at least the right code for jprogb, jstart and jshutdown for SSI devices
+if { $_IRLEN == 6 } {
+ virtex2 set_user_codes $_CHIPNAME.pld 0x2 0x3 0x22 0x23
+} elseif {$_IRLEN == 12 } {
+ puts "loading bitstream through jtag will not work, but reprogram (refresh)"
+ virtex2 set_instr_codes $_CHIPNAME.pld 0x905 0x904 0x2cb 0x30c 0x34d
+ virtex2 set_user_codes $_CHIPNAME.pld 0x0a4 0x0e4 0x8a4 0x8e4
+} elseif {$_IRLEN == 18 } {
+ puts "loading bitstream through jtag will not work, but reprogram (refresh)"
+ virtex2 set_instr_codes $_CHIPNAME.pld 0x24905 0x24904 0x0b2cb 0x0c30c 0x0d34d
+ virtex2 set_user_codes $_CHIPNAME.pld 0x000a4 0x000e4 0x008a4 0x008e4
+} else {
+ puts "loading bitstream through jtag will not work, but reprogram (refresh)"
+ virtex2 set_instr_codes $_CHIPNAME.pld 0x924905 0x924904 0x2cb2cb 0x30c30c 0x34d34d
+ virtex2 set_user_codes $_CHIPNAME.pld 0x0a4924 0x0e4924 0x8a4924 0x8e4924
+}
set XCU_JSHUTDOWN 0x0d
set XCU_JPROGRAM 0x0b
@@ -62,6 +109,7 @@ set XCU_JSTART 0x0c
set XCU_BYPASS 0x3f
proc xcu_program {tap} {
+ echo "DEPRECATED! use 'virtex2 program ...' not 'xcu_program'"
global XCU_JSHUTDOWN XCU_JPROGRAM XCU_JSTART XCU_BYPASS
irscan $tap $XCU_JSHUTDOWN
irscan $tap $XCU_JPROGRAM
diff --git a/tcl/fpga/altera-arriaii.cfg b/tcl/fpga/altera-arriaii.cfg
index ae752df..d59c182 100644
--- a/tcl/fpga/altera-arriaii.cfg
+++ b/tcl/fpga/altera-arriaii.cfg
@@ -28,4 +28,4 @@ jtag newtap $_CHIPNAME tap -irlen 10 \
-expected-id 0x025030dd -expected-id 0x024820dd \
-expected-id 0x025140dd
-pld device intel $_CHIPNAME.tap arriaii
+pld create $_CHIPNAME.pld intel -chain-position $_CHIPNAME.tap -family arriaii
diff --git a/tcl/fpga/altera-cycloneiii.cfg b/tcl/fpga/altera-cycloneiii.cfg
index e143572..d9be645 100644
--- a/tcl/fpga/altera-cycloneiii.cfg
+++ b/tcl/fpga/altera-cycloneiii.cfg
@@ -32,4 +32,4 @@ jtag newtap $_CHIPNAME tap -irlen 10 \
-expected-id 0x027000dd -expected-id 0x027030dd \
-expected-id 0x027020dd
-pld device intel $_CHIPNAME.tap cycloneiii
+pld create $_CHIPNAME.pld intel -chain-position $_CHIPNAME.tap -family cycloneiii
diff --git a/tcl/fpga/altera-cycloneiv.cfg b/tcl/fpga/altera-cycloneiv.cfg
index 59243cf..6a908e8 100644
--- a/tcl/fpga/altera-cycloneiv.cfg
+++ b/tcl/fpga/altera-cycloneiv.cfg
@@ -38,4 +38,4 @@ jtag newtap $_CHIPNAME tap -irlen 10 \
-expected-id 0x028030dd -expected-id 0x028140dd \
-expected-id 0x028040dd
-pld device intel $_CHIPNAME.tap cycloneiv
+pld create $_CHIPNAME.pld intel -chain-position $_CHIPNAME.tap -family cycloneiv
diff --git a/tcl/fpga/altera-cyclonev.cfg b/tcl/fpga/altera-cyclonev.cfg
index 1e9c9c4..46532a5 100644
--- a/tcl/fpga/altera-cyclonev.cfg
+++ b/tcl/fpga/altera-cyclonev.cfg
@@ -44,4 +44,4 @@ jtag newtap $_CHIPNAME tap -irlen 10 \
-expected-id 0x02d110dd -expected-id 0x02d010dd \
-expected-id 0x02d120dd -expected-id 0x02d020dd
-pld device intel $_CHIPNAME.tap cyclonev
+pld create $_CHIPNAME.pld intel -chain-position $_CHIPNAME.tap -family cyclonev
diff --git a/tcl/fpga/efinix_titanium.cfg b/tcl/fpga/efinix_titanium.cfg
index 681b58f..3c2cdd7 100644
--- a/tcl/fpga/efinix_titanium.cfg
+++ b/tcl/fpga/efinix_titanium.cfg
@@ -20,4 +20,4 @@ jtag newtap $_CHIPNAME tap -irlen 5 -ignore-version \
-expected-id 0x00680A79 \
-expected-id 0x00684A79
-pld device efinix $_CHIPNAME.tap
+pld create $_CHIPNAME.pld efinix -chain-position $_CHIPNAME.tap -family titanium
diff --git a/tcl/fpga/efinix_trion.cfg b/tcl/fpga/efinix_trion.cfg
index ecd2eda..1c789f5 100644
--- a/tcl/fpga/efinix_trion.cfg
+++ b/tcl/fpga/efinix_trion.cfg
@@ -14,4 +14,4 @@ jtag newtap $_CHIPNAME tap -irlen 4 -ignore-version \
-expected-id 0x00240A79 \
-expected-id 0x00220A79
-pld device efinix $_CHIPNAME.tap
+pld create $_CHIPNAME.pld efinix -chain-position $_CHIPNAME.tap -family trion
diff --git a/tcl/fpga/gatemate.cfg b/tcl/fpga/gatemate.cfg
index cc19fd4..e8f3382 100644
--- a/tcl/fpga/gatemate.cfg
+++ b/tcl/fpga/gatemate.cfg
@@ -13,4 +13,4 @@ if { [info exists CHIPNAME] } {
jtag newtap $_CHIPNAME tap -irlen 6 -ignore-version \
-expected-id 0x20000001
-pld device gatemate $_CHIPNAME.tap
+pld create $_CHIPNAME.pld gatemate -chain-position $_CHIPNAME.tap
diff --git a/tcl/fpga/gowin_gw1n.cfg b/tcl/fpga/gowin_gw1n.cfg
index 43d66b7..5e85066 100644
--- a/tcl/fpga/gowin_gw1n.cfg
+++ b/tcl/fpga/gowin_gw1n.cfg
@@ -26,4 +26,4 @@ jtag newtap $_CHIPNAME tap -irlen 8 -ignore-version \
-expected-id 0x1100181B \
-expected-id 0x0100481B
-pld device gowin $_CHIPNAME.tap
+pld create $_CHIPNAME.pld gowin -chain-position $_CHIPNAME.tap
diff --git a/tcl/fpga/lattice_certus.cfg b/tcl/fpga/lattice_certus.cfg
index 95b6e59..9ddb7d8 100644
--- a/tcl/fpga/lattice_certus.cfg
+++ b/tcl/fpga/lattice_certus.cfg
@@ -15,4 +15,4 @@ if { [info exists CHIPNAME] } {
jtag newtap $_CHIPNAME tap -irlen 8 -irmask 0x83 -ircapture 0x1 \
-expected-id 0x310F1043 -expected-id 0x310F0043
-pld device lattice $_CHIPNAME.tap
+pld create $_CHIPNAME.pld lattice -chain-position $_CHIPNAME.tap
diff --git a/tcl/fpga/lattice_certuspro.cfg b/tcl/fpga/lattice_certuspro.cfg
index c15a379..acaaa57 100644
--- a/tcl/fpga/lattice_certuspro.cfg
+++ b/tcl/fpga/lattice_certuspro.cfg
@@ -15,4 +15,4 @@ jtag newtap $_CHIPNAME tap -irlen 8 -irmask 0x83 -ircapture 0x1 \
-expected-id 0x010f4043
# -expected-id 0x01112043
-pld device lattice $_CHIPNAME.tap
+pld create $_CHIPNAME.pld lattice -chain-position $_CHIPNAME.tap
diff --git a/tcl/fpga/lattice_ecp2.cfg b/tcl/fpga/lattice_ecp2.cfg
index a1aa2ef..5b01787 100644
--- a/tcl/fpga/lattice_ecp2.cfg
+++ b/tcl/fpga/lattice_ecp2.cfg
@@ -28,4 +28,4 @@ jtag newtap $_CHIPNAME tap -irlen 8 \
-expected-id 0x01271043 -expected-id 0x01272043 -expected-id 0x01274043 \
-expected-id 0x01273043 -expected-id 0x01275043
-pld device lattice $_CHIPNAME.tap
+pld create $_CHIPNAME.pld lattice -chain-position $_CHIPNAME.tap
diff --git a/tcl/fpga/lattice_ecp3.cfg b/tcl/fpga/lattice_ecp3.cfg
index 7cd5706..21c8ffa 100644
--- a/tcl/fpga/lattice_ecp3.cfg
+++ b/tcl/fpga/lattice_ecp3.cfg
@@ -19,4 +19,4 @@ jtag newtap $_CHIPNAME tap -irlen 8 \
-expected-id 0x01010043 -expected-id 0x01012043 \
-expected-id 0x01014043 -expected-id 0x01015043
-pld device lattice $_CHIPNAME.tap
+pld create $_CHIPNAME.pld lattice -chain-position $_CHIPNAME.tap
diff --git a/tcl/fpga/lattice_ecp5.cfg b/tcl/fpga/lattice_ecp5.cfg
index 4144249..cdc63f0 100644
--- a/tcl/fpga/lattice_ecp5.cfg
+++ b/tcl/fpga/lattice_ecp5.cfg
@@ -27,4 +27,4 @@ jtag newtap $_CHIPNAME tap -irlen 8 -irmask 0x83 -ircapture 0x1 \
-expected-id 0x41113043 -expected-id 0x81111043 -expected-id 0x81112043 \
-expected-id 0x81113043
-pld device lattice $_CHIPNAME.tap
+pld create $_CHIPNAME.pld lattice -chain-position $_CHIPNAME.tap
diff --git a/tcl/interface/angie.cfg b/tcl/interface/angie.cfg
new file mode 100644
index 0000000..26cbe39
--- /dev/null
+++ b/tcl/interface/angie.cfg
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (C) 2023 by NanoXplore, France - all rights reserved
+#
+# configuration file for ANGIE Adapter from NanoXplore.
+#
+
+adapter driver angie
+adapter speed 10000
+reset_config trst_and_srst trst_push_pull srst_open_drain
diff --git a/tcl/interface/ftdi/sipeed-rv-debugger.cfg b/tcl/interface/ftdi/sipeed-rv-debugger.cfg
new file mode 100644
index 0000000..ca65398
--- /dev/null
+++ b/tcl/interface/ftdi/sipeed-rv-debugger.cfg
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+#
+# Interface file for BL702-based SIPEED RV Debugger
+#
+
+adapter driver ftdi
+adapter speed 6000
+
+ftdi device_desc "JTAG Debugger"
+ftdi vid_pid 0x0403 0x6010
+ftdi layout_init 0x0008 0x001b
+ftdi layout_signal nSRST -oe 0x0020 -data 0x0020
diff --git a/tcl/interface/stlink-dap.cfg b/tcl/interface/stlink-dap.cfg
index 5c24cbd..99c81c1 100644
--- a/tcl/interface/stlink-dap.cfg
+++ b/tcl/interface/stlink-dap.cfg
@@ -11,7 +11,7 @@
#
adapter driver st-link
-st-link vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753 0x0483 0x3754
+st-link vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753 0x0483 0x3754 0x0483 0x3755 0x0483 0x3757
# transport select dapdirect_jtag
# transport select dapdirect_swd
diff --git a/tcl/interface/stlink.cfg b/tcl/interface/stlink.cfg
index e4906b7..8578bf2 100644
--- a/tcl/interface/stlink.cfg
+++ b/tcl/interface/stlink.cfg
@@ -8,7 +8,7 @@
adapter driver hla
hla_layout stlink
hla_device_desc "ST-LINK"
-hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753 0x0483 0x3754
+hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753 0x0483 0x3754 0x0483 0x3755 0x0483 0x3757
# Optionally specify the serial number of ST-LINK/V2 usb device. ST-LINK/V2
# devices seem to have serial numbers with unreadable characters. ST-LINK/V2
diff --git a/tcl/target/snps_hsdk_4xd.cfg b/tcl/target/snps_hsdk_4xd.cfg
new file mode 100644
index 0000000..1520e3d
--- /dev/null
+++ b/tcl/target/snps_hsdk_4xd.cfg
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Copyright (C) 2023 Synopsys, Inc.
+# Artemiy Volkov <artemiy@synopsys.com>
+
+# Adapted from tcl/target/snps_hsdk.cfg.
+
+#
+# HS Development Kit SoC.
+#
+# Contains quad-core ARC HS47D.
+#
+
+source [find cpu/arc/hs.tcl]
+
+set _coreid 0
+set _dbgbase [expr {$_coreid << 13}]
+
+# CHIPNAME will be used to choose core family (600, 700 or EM). As far as
+# OpenOCD is concerned EM and HS are identical.
+set _CHIPNAME arc-em
+
+
+proc setup_cpu {core_index expected_id} {
+ global _coreid
+ global _dbgbase
+ global _CHIPNAME
+
+ set _TARGETNAME $_CHIPNAME.cpu$core_index
+ jtag newtap $_CHIPNAME cpu$core_index -irlen 4 -ircapture 0x1 -expected-id $expected_id
+
+ target create $_TARGETNAME arcv2 -chain-position $_TARGETNAME
+ $_TARGETNAME configure -coreid $_coreid
+ $_TARGETNAME configure -dbgbase $_dbgbase
+ $_TARGETNAME configure -event reset-assert "arc_hs_reset $_TARGETNAME"
+
+ arc_hs_init_regs
+
+ $_TARGETNAME arc cache l2 auto 1
+
+ set _coreid [expr {$_coreid + 1}]
+ set _dbgbase [expr {$_coreid << 13}]
+}
+
+# OpenOCD discovers JTAG TAPs in reverse order.
+
+setup_cpu 4 0x100c54b1
+setup_cpu 3 0x100854b1
+setup_cpu 2 0x100454b1
+setup_cpu 1 0x100054b1
diff --git a/tcl/target/ti-cjtag.cfg b/tcl/target/ti-cjtag.cfg
index d5e13e2..97111f1 100644
--- a/tcl/target/ti-cjtag.cfg
+++ b/tcl/target/ti-cjtag.cfg
@@ -5,6 +5,7 @@
# Read section 6.3 in http://www.ti.com/lit/pdf/swru319 for more information.
proc ti_cjtag_to_4pin_jtag {jrc} {
# Bypass
+ runtest 20
irscan $jrc 0x3f -endstate RUN/IDLE
# Two zero bit scans and a one bit drshift
pathmove RUN/IDLE DRSELECT DRCAPTURE DREXIT1 DRPAUSE
diff --git a/tcl/target/zynq_7000.cfg b/tcl/target/zynq_7000.cfg
index a6f8995..f5b4478 100644
--- a/tcl/target/zynq_7000.cfg
+++ b/tcl/target/zynq_7000.cfg
@@ -46,7 +46,8 @@ adapter speed 1000
${_TARGETNAME}0 configure -event reset-assert-post "cortex_a dbginit"
${_TARGETNAME}1 configure -event reset-assert-post "cortex_a dbginit"
-pld device virtex2 zynq_pl.bs 1
+pld create zynq_pl.pld virtex2 -chain-position zynq_pl.bs -no_jstart
+virtex2 set_user_codes $zynq_pl.pld 0x02 0x03 0x22 0x23
set XC7_JSHUTDOWN 0x0d
set XC7_JPROGRAM 0x0b
@@ -54,6 +55,7 @@ set XC7_JSTART 0x0c
set XC7_BYPASS 0x3f
proc zynqpl_program {tap} {
+ echo "DEPRECATED! use 'virtex2 program ...' not 'zynqpl_program'"
global XC7_JSHUTDOWN XC7_JPROGRAM XC7_JSTART XC7_BYPASS
irscan $tap $XC7_JSHUTDOWN
irscan $tap $XC7_JPROGRAM