tcl/board: add configuration for Novena's integrated FPGA
[openocd.git] / tcl / tools / firmware-recovery.tcl
1 echo "\n\nFirmware recovery helpers"
2 echo "Use -c firmware_help to get help\n"
3
4 set known_boards {
5 "asus-rt-n16 ASUS RT-N16"
6 "asus-rt-n66u ASUS RT-N66U"
7 "linksys-wrt54gl Linksys WRT54GL v1.1"
8 "netgear-dg834v3 Netgear DG834G v3"
9 "tp-link_tl-mr3020 TP-LINK TL-MR3020"
10 "bt-homehubv1 BT HomeHub v1"
11 }
12
13 proc firmware_help { } {
14 echo "
15 Your OpenOCD command should look like this:
16 openocd -f interface/<jtag adapter>.cfg -f tools/firmware-recovery.tcl -c \"<commands>*; shutdown\"
17
18 Where:
19 <jtag adapter> is one of the supported devices, e.g. ftdi/jtagkey2
20 <commands> are firmware-recovery commands separated by semicolon
21
22 Supported commands:
23 firmware_help get this help
24 list_boards list known boards and exit
25 board <name> select board you work with
26 list_partitions list partitions of the currently selected board
27 dump_part <name> <filename> save partition's contents to a file
28 erase_part <name> erase the given partition
29 flash_part <name> <filename> erase, flash and verify the given partition
30 ram_boot <filename> load binary file to RAM and run it
31 adapter_khz <freq> set JTAG clock frequency in kHz
32
33 For example, to clear nvram and reflash CFE on an RT-N16 using TUMPA, run:
34 openocd -f interface/ftdi/tumpa.cfg -f tools/firmware-recovery.tcl \\
35 -c \"board asus-rt-n16; erase_part nvram; flash_part CFE cfe-n16.bin; shutdown\"
36 \n\n"
37 shutdown
38 }
39
40 # set default, can be overriden later
41 adapter_khz 1000
42
43 proc get_partition { name } {
44 global partition_list
45 dict get $partition_list $name
46 }
47
48 proc partition_desc { name } { lindex [get_partition $name] 0 }
49 proc partition_start { name } { lindex [get_partition $name] 1 }
50 proc partition_size { name } { lindex [get_partition $name] 2 }
51
52 proc list_boards { } {
53 global known_boards
54 echo "List of the supported boards:\n"
55 echo "Board name\t\tDescription"
56 echo "-----------------------------------"
57 foreach i $known_boards {
58 echo $i
59 }
60 echo "\n\n"
61 }
62
63 proc board { name } {
64 script [find board/$name.cfg]
65 }
66
67 proc list_partitions { } {
68 global partition_list
69 set fstr "%-16s%-14s%-14s%s"
70 echo "\nThe currently selected board is known to have these partitions:\n"
71 echo [format $fstr Name Start Size Description]
72 echo "-------------------------------------------------------"
73 for {set i 0} {$i < [llength $partition_list]} {incr i 2} {
74 set key [lindex $partition_list $i]
75 echo [format $fstr $key [partition_start $key] [partition_size $key] [partition_desc $key]]
76 }
77 echo "\n\n"
78 }
79
80 # Magic to work with any targets, including semi-functional
81 proc prepare_target { } {
82 init
83 catch {halt}
84 catch {reset init}
85 catch {halt}
86 }
87
88 proc dump_part { name filename } {
89 prepare_target
90 dump_image $filename [partition_start $name] [partition_size $name]
91 }
92
93 proc erase_part { name } {
94 prepare_target
95 flash erase_address [partition_start $name] [partition_size $name]
96 }
97
98 proc flash_part { name filename } {
99 prepare_target
100 flash write_image erase $filename [partition_start $name] bin
101 echo "Verifying:"
102 verify_image $filename [partition_start $name]
103 }
104
105 proc ram_boot { filename } {
106 global ram_boot_address
107 prepare_target
108 load_image $filename $ram_boot_address bin
109 resume $ram_boot_address
110 }
111
112 echo ""

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)