tcl: add SPDX tag
[openocd.git] / tcl / fpga / xilinx-dna.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 proc xilinx_dna_addr {chip} {
4 array set addrs {
5 Spartan6 0x30
6 Series7 0x17
7 }
8 return $addrs($chip)
9 }
10
11 # Get the "Device DNA".
12 # Most Xilinx FPGA devices contain an embedded, unique device identifier.
13 # The identifier is nonvolatile, permanently programmed into
14 # the FPGA, and is unchangeable providing a great serial / tracking number.
15 # This function returns the DNA as a 64 bit integer with the 7 LSBs zeroed.
16 # This is compatible with the FUSE DNA which contains all 64 bits.
17 proc xilinx_get_dna {tap chip} {
18 set XC7_ISC_ENABLE 0x10
19 set XC7_ISC_DISABLE 0x16
20 set XC7_ISC_DNA [xilinx_dna_addr $chip]
21
22 irscan $tap $XC7_ISC_ENABLE
23 runtest 64
24 irscan $tap $XC7_ISC_DNA
25 scan [drscan $tap 32 0 32 0] "%08x %08x" hi lo
26 runtest 64
27 irscan $tap $XC7_ISC_DISABLE
28 runtest 64
29 # openocd interprets DR scans as LSB first, bit-reverse it
30 return [scan [string reverse [format "%032b%032bb0" $lo $hi]] "%i"]
31 }
32
33 # Print out the "Device DNA" in the same format that impact uses.
34 proc xilinx_print_dna {dna} {
35 set dna [expr {$dna >> 64 - 57}]
36 echo [format "DNA = %057b (0x%016x)" $dna $dna]
37 }
38
39 proc xc7_get_dna {tap} {
40 return [xilinx_get_dna $tap Series7]
41 }
42
43 proc xc6s_get_dna {tap} {
44 return [xilinx_get_dna $tap Spartan6]
45 }

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)