run: add power cycle procedure

The 'run_genode_until' procedure only called 'run_power_on' to reset
the target machine. That works will with the softreset module, which
is used by all x86-based test system but falls short regarding ARM
boards. The way those boards are connected requires turning the power
off and on for a complete cycle.
This commit is contained in:
Josef Söntgen 2019-02-01 11:50:08 +01:00 committed by Norman Feske
parent 369d60bc21
commit 1c0541e7cb
2 changed files with 25 additions and 4 deletions

View File

@ -100,8 +100,8 @@ proc autopilot_run_genode_until {{wait_for_re forever} {timeout_value 0} {runnin
set retry 3
while { $retry != 0 } {
if {[expr [run_power_on] == false]} {
puts "Power on step failed, retry."
if {![run_power_cycle]} {
puts "Power cycle step failed, retry."
sleep 3
incr retry -1;
continue

View File

@ -291,8 +291,12 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
set retry 3
while { $retry != 0 } {
if {[expr [run_power_on] == false]} {
puts "Power on step failed, retry."
#
# Depending an the used run module, a reset can include
# shutting the power off and turning it on again.
#
if (![run_power_cycle]) {
puts "Power cycle step failed, retry."
sleep 3
incr retry -1;
continue
@ -738,6 +742,23 @@ proc run_power_on { } { return true; }
proc run_power_off { } { return true; }
##
# Default power cycle fallback procedure
#
proc run_power_cycle { } {
#
# On targets that are directly connected to a socket,
# turn the socket off and on again. On targets that
# use a module were that is not required, e.g. softreset,
# power_off is a NOP. Note, we give the target some time
# to effectively drain energy before switching it on again.
#
run_power_off
sleep 1
return [run_power_on]
}
##
# Default core linker options
#