1 |
load_base_board_description "cygmon"; |
load_base_board_description "cygmon" |
2 |
|
|
3 |
set_board_info testcase_timeout 30; |
set_board_info testcase_timeout 30 |
4 |
|
|
5 |
proc ${board}_init { dest } { |
proc ${board}_init { dest } { |
6 |
global usparc_init_count; |
global usparc_init_count |
7 |
set shell_prompt [board_info $dest shell_prompt]; |
set shell_prompt [board_info $dest shell_prompt] |
8 |
|
|
9 |
if ![info exists usparc_init_count] { |
if ![info exists usparc_init_count] { |
10 |
set usparc_init_count 0; |
set usparc_init_count 0 |
11 |
} else { |
} else { |
12 |
incr usparc_init_count; |
incr usparc_init_count |
13 |
if { $usparc_init_count == 3 } { |
if { $usparc_init_count == 3 } { |
14 |
return -1; |
return -1 |
15 |
} |
} |
16 |
|
|
17 |
} |
} |
18 |
remote_close $dest; |
remote_close $dest |
19 |
set shell_id [remote_open $dest]; |
set shell_id [remote_open $dest] |
20 |
if { $shell_id == "" || $shell_id < 0 } { |
if { $shell_id == "" || $shell_id < 0 } { |
21 |
return [remote_reboot $dest]; |
return [remote_reboot $dest] |
22 |
} else { |
} else { |
23 |
remote_binary $dest; |
remote_binary $dest |
24 |
remote_send $dest "\n"; |
remote_send $dest "\n" |
25 |
set got_one 0; |
set got_one 0 |
26 |
remote_expect $dest 5 { |
remote_expect $dest 5 { |
27 |
-re "$shell_prompt" { set got_one 1; exp_continue; } |
-re "$shell_prompt" { set got_one 1; exp_continue; } |
28 |
default { |
default { |
29 |
if { ! $got_one } { |
if { ! $got_one } { |
30 |
remote_close $dest; |
remote_close $dest |
31 |
return [remote_reboot $dest]; |
return [remote_reboot $dest] |
32 |
} |
} |
33 |
} |
} |
34 |
} |
} |
35 |
remote_send $dest "m \[15\]1fff1001f00 32\n"; |
remote_send $dest "m \[15\]1fff1001f00 32\n" |
36 |
remote_expect $dest 5 { |
remote_expect $dest 5 { |
37 |
-re "$shell_prompt" { |
-re "$shell_prompt" { |
38 |
unset usparc_init_count; |
unset usparc_init_count |
39 |
remote_close $dest; |
remote_close $dest |
40 |
return 0; |
return 0 |
41 |
} |
} |
42 |
default { |
default { |
43 |
remote_close $dest; |
remote_close $dest |
44 |
return [remote_reboot $dest]; |
return [remote_reboot $dest] |
45 |
} |
} |
46 |
} |
} |
47 |
} |
} |