ipdbg: fix double free of virtual-ir data
[openocd.git] / tcl / cpld / xilinx-xc6s.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 # xilinx spartan6
4 # http://www.xilinx.com/support/documentation/user_guides/ug380.pdf
5
6 if { [info exists CHIPNAME] } {
7 set _CHIPNAME $CHIPNAME
8 } else {
9 set _CHIPNAME xc6s
10 }
11
12 # the 4 top bits (28:31) are the die stepping. ignore it.
13 jtag newtap $_CHIPNAME tap -irlen 6 -ignore-version \
14 -expected-id 0x04000093 \
15 -expected-id 0x04001093 \
16 -expected-id 0x04002093 \
17 -expected-id 0x04004093 \
18 -expected-id 0x04024093 \
19 -expected-id 0x04008093 \
20 -expected-id 0x04028093 \
21 -expected-id 0x0400E093 \
22 -expected-id 0x0402E093 \
23 -expected-id 0x04011093 \
24 -expected-id 0x04031093 \
25 -expected-id 0x0401D093 \
26 -expected-id 0x0403D093
27
28 pld create $_CHIPNAME.pld virtex2 -chain-position $_CHIPNAME.tap
29 virtex2 set_user_codes $_CHIPNAME.pld 0x02 0x03 0x1A 0x1B
30
31 set XC6S_CFG_IN 0x05
32 set XC6S_JSHUTDOWN 0x0d
33 set XC6S_JPROGRAM 0x0b
34 set XC6S_JSTART 0x0c
35 set XC6S_BYPASS 0x3f
36
37 proc xc6s_program {tap} {
38 echo "DEPRECATED! use 'virtex2 program ...' not 'xc6s_program'"
39 global XC6S_JSHUTDOWN XC6S_JPROGRAM XC6S_JSTART XC6S_BYPASS
40 irscan $tap $XC6S_JSHUTDOWN
41 irscan $tap $XC6S_JPROGRAM
42 irscan $tap $XC6S_JSTART
43 irscan $tap $XC6S_BYPASS
44 }
45
46 #xtp038 and xc3sprog approach
47 proc xc6s_program_iprog {tap} {
48 echo "DEPRECATED! use 'virtex2 program ...' not 'xc6s_program_iprog'"
49 global XC6S_JSHUTDOWN XC6S_JSTART XC6S_BYPASS XC6S_CFG_IN
50 irscan $tap $XC6S_JSHUTDOWN
51 runtest 16
52 irscan $tap $XC6S_CFG_IN
53 # xtp038 IPROG 16bit flipped
54 drscan $tap 16 0xffff 16 0x9955 16 0x66aa 16 0x850c 16 0x7000 16 0x0004
55 irscan $tap $XC6S_JSTART
56 runtest 32
57 irscan $tap $XC6S_BYPASS
58 runtest 1
59 }
60
61 set XC6S_ISC_ENABLE 0x10
62 set XC6S_ISC_DISABLE 0x16
63 set XC6S_ISC_DNA 0x30
64
65 # Get the "Device DNA" from the Spartan 6.
66 # Most Xilinx FPGA devices contain an embedded, unique device identifier called
67 # the "Device DNA". The identifier is nonvolatile, permanently programmed into
68 # the FPGA, and is unchangeable providing a great serial / tracking number.
69 proc xc6s_get_dna {tap} {
70 global XC6S_ISC_ENABLE XC6S_ISC_DISABLE XC6S_ISC_DNA
71 irscan $tap $XC6S_ISC_ENABLE
72 runtest 64
73 irscan $tap $XC6S_ISC_DNA
74 # Device DNA is 57 bits long, but we can only read 32bits at a time
75 # with OpenOCD.
76 set dna [drscan $tap 16 0 16 0 16 0 9 0]
77 runtest 64
78 irscan $tap $XC6S_ISC_DISABLE
79 runtest 64
80
81 # Convert the binary data into the order impact uses
82 scan $dna "%x %x %x %x" v1 v2 v3 v4
83 set bin_dna [string reverse [concat [format "%09b" $v4][format "%016b" $v3][format "%016b" $v2][format "%016b" $v1]]]
84
85 # Return a hex version of binary
86 scan [format "0b%s" $bin_dna] "%i" hex_dna
87 return $hex_dna
88 }
89
90 # Print out the "Device DNA" in the same format that impact uses.
91 proc xc6s_print_dna {tap} {
92 set hex_dna [xc6s_get_dna $tap]
93
94 puts [format "DNA = %57b (0x%x)\n" $hex_dna $hex_dna]
95 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)