aboutsummaryrefslogtreecommitdiff
path: root/config/base68k.exp
diff options
context:
space:
mode:
Diffstat (limited to 'config/base68k.exp')
-rw-r--r--config/base68k.exp154
1 files changed, 77 insertions, 77 deletions
diff --git a/config/base68k.exp b/config/base68k.exp
index a9b322c..c76bd57 100644
--- a/config/base68k.exp
+++ b/config/base68k.exp
@@ -34,27 +34,27 @@ proc base68k_ld { dest prog } {
return "untested"
}
if [is_remote host] {
- set prog [remote_download host $prog];
+ set prog [remote_download host $prog]
if { $prog == "" } {
- verbose -log "Unable to download $prog to host.";
- return "untested";
+ verbose -log "Unable to download $prog to host."
+ return "untested"
}
}
if [board_info $dest exists objcopy] {
- set OBJCOPY [board_info $dest objcopy];
+ set OBJCOPY [board_info $dest objcopy]
set exec_file "${prog}.srec"
set objcopy_args ""
if [board_info $dest exists use_vma_offset] {
- set objcopy_args "--adjust-vma=[board_info $dest hex_startaddr]";
+ set objcopy_args "--adjust-vma=[board_info $dest hex_startaddr]"
}
set status [remote_exec host "$OBJCOPY $objcopy_args -O srec $prog ${prog}.srec"]
- set result [lindex $status 1];
+ set result [lindex $status 1]
regsub -all -- "\[\r\n\]*" $result "" result
if { $result != "" || [lindex $status 0] != 0 } {
warning "Got \"$result\" from $OBJCOPY"
verbose -log "Couldn't convert to srecord for downloading"
- remote_close $dest;
+ remote_close $dest
return "untested"
} else {
verbose "Converted $prog to an srecord." 2
@@ -63,7 +63,7 @@ proc base68k_ld { dest prog } {
set exec_file $prog
}
- set value 0;
+ set value 0
if ![board_info $dest exists fileid] {
while { $value < 2 } {
set rom68k_shell_id [remote_open $dest]
@@ -72,15 +72,15 @@ proc base68k_ld { dest prog } {
verbose -log "$prog not executed, couldn't connect to target."
return "untested"
}
- incr value;
+ incr value
} else {
- break;
+ break
}
}
# dbug has problems if we go into binary mode, so this allows us to
# disable entry into binary mode.
if ![board_info $dest exists no_binary_mode] {
- remote_binary $dest;
+ remote_binary $dest
}
}
@@ -88,17 +88,17 @@ proc base68k_ld { dest prog } {
# can load it
if [is_remote host] {
global objdir
- set exec_file [remote_upload host ${exec_file} "${objdir}/a.out"];
+ set exec_file [remote_upload host ${exec_file} "${objdir}/a.out"]
}
- set got_p 0;
+ set got_p 0
for { set tries 0; } { (! $got_p) && $tries < 5 } { incr tries } {
remote_send $dest "\r\n\r\n"
remote_expect $dest 5 {
-re "${shell_prompt}$" {
verbose "Got prompt."
set result 0
- set got_p 1;
+ set got_p 1
}
timeout {
warning "Never got prompt."
@@ -107,7 +107,7 @@ proc base68k_ld { dest prog } {
if { ! $got_p } {
if $tries<=4 then {
if { $tries == 3 } then {
- remote_reboot $dest;
+ remote_reboot $dest
} else {
remote_send $dest "\r\n"
}
@@ -119,9 +119,9 @@ proc base68k_ld { dest prog } {
# scrogged -- the remote_expect above will fail in a lot of
# non-clean ways.
if { ! $got_p } {
- remote_close $dest;
- remote_reboot $dest;
- return "unresolved";
+ remote_close $dest
+ remote_reboot $dest
+ return "unresolved"
} else {
# Flush out any remaining cruft.
remote_expect $dest 2 {
@@ -133,7 +133,7 @@ proc base68k_ld { dest prog } {
if [board_info $dest exists download_command] {
# Load the program.
- remote_send $dest "\r\n";
+ remote_send $dest "\r\n"
# dbug has problems sending download command immediately after a
# newline, so we wait for the prompt to come back first.
remote_expect $dest 5 {
@@ -150,29 +150,29 @@ proc base68k_ld { dest prog } {
[board_info $dest download_response] { }
timeout {
perror "Download command never responded."
- return "unresolved";
+ return "unresolved"
}
}
}
}
verbose "Writing records to target..."
- set status [remote_transmit $dest $exec_file];
+ set status [remote_transmit $dest $exec_file]
if { $exec_file != $prog } {
remote_file build delete $exec_file
}
if { $status != 0 } {
- remote_close $dest;
+ remote_close $dest
verbose -log "Transmission of $exec_file to the target failed." 3
return "unresolved"
}
verbose "Wrote records to target...waiting for prompt."
remote_send $dest "\n"
- set got_p 0;
+ set got_p 0
remote_expect $dest 50 {
-re "$shell_prompt$" {
verbose "Got prompt."
- set got_p 1;
+ set got_p 1
}
timeout { }
}
@@ -183,120 +183,120 @@ proc base68k_ld { dest prog } {
-re ".+" { exp_continue }
default { }
}
- return "pass";
+ return "pass"
} else {
- remote_close $dest;
- remote_reboot $dest;
- return "unresolved";
+ remote_close $dest
+ remote_reboot $dest
+ return "unresolved"
}
}
proc base68k_spawn { dest prog args } {
- set shell_prompt [board_info $dest shell_prompt];
+ set shell_prompt [board_info $dest shell_prompt]
- set result [remote_ld $dest $prog];
+ set result [remote_ld $dest $prog]
if { $result != "pass" } {
- return [list $result ""];
+ return [list $result ""]
}
if [board_info $dest exists startaddr] {
- set go_command "[board_info $dest go_command] [board_info $dest startaddr]";
+ set go_command "[board_info $dest go_command] [board_info $dest startaddr]"
} else {
- set go_command "[board_info $dest go_command]";
+ set go_command "[board_info $dest go_command]"
}
- verbose "Sending $go_command, waiting for results.";
- remote_send $dest "${go_command}\n";
- return { "pass" "" };
+ verbose "Sending $go_command, waiting for results."
+ remote_send $dest "${go_command}\n"
+ return { "pass" "" }
}
proc base68k_wait { dest timeout } {
- set shell_prompt [board_info $dest shell_prompt];
- set noappend 0;
- set result -1;
+ set shell_prompt [board_info $dest shell_prompt]
+ set noappend 0
+ set result -1
- set output "";
+ set output ""
remote_expect $dest $timeout {
-re [board_info $dest go_response] {
- append output $expect_out(buffer);
- set noappend 1;
- set result 0;
- exp_continue -continue_timer;
+ append output $expect_out(buffer)
+ set noappend 1
+ set result 0
+ exp_continue -continue_timer
}
-re "$shell_prompt$" {
- verbose "Got prompt.";
- set result 0;
+ verbose "Got prompt."
+ set result 0
}
-re "\[\r\n\]+" {
if { ! $noappend } {
- append output $expect_out(buffer);
+ append output $expect_out(buffer)
if { [string length $output] < 512000 } {
- exp_continue -continue_timer;
+ exp_continue -continue_timer
} else {
- set result -1;
+ set result -1
}
}
}
timeout {
- warning "Nothing ever came back.";
- set result -1;
+ warning "Nothing ever came back."
+ set result -1
}
}
if [board_info $dest exists output_end] {
- regsub "[board_info $dest output_end]" "$output" "\n" output;
+ regsub "[board_info $dest output_end]" "$output" "\n" output
}
# There has got to be a better way. (We need to do this in order to remove
# the echoed "go command".
if [board_info $dest exists startaddr] {
- set go_command "[board_info $dest go_command] [board_info $dest startaddr]";
+ set go_command "[board_info $dest go_command] [board_info $dest startaddr]"
} else {
- set go_command "[board_info $dest go_command]";
+ set go_command "[board_info $dest go_command]"
}
- regsub "^.*$go_command\[\r\n\]*" "$output" "" output;
- regsub "^.*$go_command\[\r\n\]*" "$output" "" output;
+ regsub "^.*$go_command\[\r\n\]*" "$output" "" output
+ regsub "^.*$go_command\[\r\n\]*" "$output" "" output
# We always want to check for a status, even if there was a funky weird
# failure above.
- set status [check_for_board_status output];
+ set status [check_for_board_status output]
if { $result == 0 } {
- set result $status;
- verbose -log "exit status was $status";
+ set result $status
+ verbose -log "exit status was $status"
}
# A negative value indicates that we should reboot. Otherwise, return
# the exit status from the program if we got one (and we should have).
- return [list $result "$output"];
+ return [list $result "$output"]
}
proc base68k_load { dest prog args } {
global base68k_retry
- set shell_prompt [board_info $dest shell_prompt];
+ set shell_prompt [board_info $dest shell_prompt]
if { [llength $args] > 0 } {
for { set x 0; } { $x < [llength $args] } { incr x ; } {
if { [lindex $args $x] != "" } {
- verbose -log "Cannot pass parameters or input file to this target";
- return [list "unsupported" ""];
+ verbose -log "Cannot pass parameters or input file to this target"
+ return [list "unsupported" ""]
}
}
}
- set result [remote_spawn $dest $prog];
+ set result [remote_spawn $dest $prog]
if { [lindex $result 0] != "pass" } {
- return $result;
+ return $result
}
# FIXME: The value 360 below should be a parameter.
- set result [remote_wait $dest 360];
- set output [lindex $result 1];
- set status [lindex $result 0];
+ set result [remote_wait $dest 360]
+ set output [lindex $result 1]
+ set status [lindex $result 0]
verbose "output from board is $output"
@@ -304,20 +304,20 @@ proc base68k_load { dest prog args } {
send_log "\n"
if { $status > 0 } {
- return [list "fail" $output];
+ return [list "fail" $output]
} elseif { $status == 0 } {
- return [list "pass" $output];
+ return [list "pass" $output]
} else {
if [info exists base68k_retry] {
- return [list "fail" $output];
+ return [list "fail" $output]
}
- set base68k_retry 1;
- remote_reboot $dest;
- set status [eval base68k_load \{$dest\} \{$prog\} $args];
- unset base68k_retry;
- return $status;
+ set base68k_retry 1
+ remote_reboot $dest
+ set status [eval base68k_load \{$dest\} \{$prog\} $args]
+ unset base68k_retry
+ return $status
}
}
-set_board_info protocol "base68k";
+set_board_info protocol "base68k"
set_board_info send_initial_cr 1