20 |
# This file was written by Bob Manson (manson@cygnus.com) |
# This file was written by Bob Manson (manson@cygnus.com) |
21 |
|
|
22 |
# We use GDB to talk to a vr4300 board. |
# We use GDB to talk to a vr4300 board. |
23 |
load_generic_config "base68k"; |
load_generic_config "base68k" |
24 |
|
|
25 |
set_board_info shell_prompt "NEC010> "; |
set_board_info shell_prompt "NEC010> " |
26 |
set_board_info download_command "load tty0\n"; |
set_board_info download_command "load tty0\n" |
27 |
set_board_info download_response "Downloading from"; |
set_board_info download_response "Downloading from" |
28 |
set_board_info go_command "g -e"; |
set_board_info go_command "g -e" |
29 |
set_board_info startaddr "a0100000" |
set_board_info startaddr "a0100000" |
30 |
set_board_info hex_startaddr "0xa0100000" |
set_board_info hex_startaddr "0xa0100000" |
31 |
set_board_info go_response "(^|\[\r\n\])(Exception Cause|\[0-9a-z\]+ \[0-9a-z\]+ break|\\*\\*\\*EXIT code )\[^\r\n\]*\[\r\n\]" |
set_board_info go_response "(^|\[\r\n\])(Exception Cause|\[0-9a-z\]+ \[0-9a-z\]+ break|\\*\\*\\*EXIT code )\[^\r\n\]*\[\r\n\]" |
33 |
|
|
34 |
# Reset the prompt to what GDB needs. |
# Reset the prompt to what GDB needs. |
35 |
proc ${board}_init { dest } { |
proc ${board}_init { dest } { |
36 |
global doing_ddb_init; |
global doing_ddb_init |
37 |
if [is_remote host] { |
if [is_remote host] { |
38 |
return; |
return |
39 |
} |
} |
40 |
|
|
41 |
if ![info exists doing_ddb_init] { |
if ![info exists doing_ddb_init] { |
42 |
set doing_ddb_init 1; |
set doing_ddb_init 1 |
43 |
|
|
44 |
for { set i 1; } { $i <= 3 } {incr i } { |
for { set i 1; } { $i <= 3 } {incr i } { |
45 |
remote_close $dest; |
remote_close $dest |
46 |
for { set x 0; } { $x < 3 } { incr x; } { |
for { set x 0; } { $x < 3 } { incr x; } { |
47 |
set shell_id [remote_open $dest]; |
set shell_id [remote_open $dest] |
48 |
if { $shell_id == "" || $shell_id < 0 } { |
if { $shell_id == "" || $shell_id < 0 } { |
49 |
remote_reboot $dest; |
remote_reboot $dest |
50 |
} else { |
} else { |
51 |
break; |
break |
52 |
} |
} |
53 |
} |
} |
54 |
|
|
55 |
set count 0; |
set count 0 |
56 |
remote_send $dest "\n"; |
remote_send $dest "\n" |
57 |
remote_expect $dest 20 { |
remote_expect $dest 20 { |
58 |
-re ".*PMON> $" { |
-re ".*PMON> $" { |
59 |
remote_send $dest "set prompt \"NEC010> \"\n"; |
remote_send $dest "set prompt \"NEC010> \"\n" |
60 |
exp_continue; |
exp_continue |
61 |
} |
} |
62 |
-re "NEC010> $" { |
-re "NEC010> $" { |
63 |
set i 10; |
set i 10 |
64 |
} |
} |
65 |
timeout { } |
timeout { } |
66 |
-re "0x0" { |
-re "0x0" { |
67 |
count++; |
count++ |
68 |
if(count<5) { |
if(count<5) { |
69 |
exp_continue; |
exp_continue |
70 |
} |
} |
71 |
} |
} |
72 |
} |
} |
73 |
if { $i < 3 } { |
if { $i < 3 } { |
74 |
remote_reboot $dest; |
remote_reboot $dest |
75 |
} |
} |
76 |
} |
} |
77 |
remote_close $dest; |
remote_close $dest |
78 |
unset doing_ddb_init; |
unset doing_ddb_init |
79 |
} else { |
} else { |
80 |
return; |
return |
81 |
} |
} |
82 |
} |
} |
83 |
|
|
86 |
|
|
87 |
# If no output format is specified, use objcopy. |
# If no output format is specified, use objcopy. |
88 |
if ![board_info $board exists output_format] { |
if ![board_info $board exists output_format] { |
89 |
set tempfil [lookfor_file $tool_root_dir binutils/objcopy]; |
set tempfil [lookfor_file $tool_root_dir binutils/objcopy] |
90 |
if { $tempfil != "" } { |
if { $tempfil != "" } { |
91 |
set_board_info objcopy $tempfil |
set_board_info objcopy $tempfil |
92 |
} else { |
} else { |