tool/run/load/fastboot: detect fastboot driver

Replace the unconditional sleep "until the board comes up" by the
detection of the fastboot-driver message. This shortens the total boot
time and reveals U-boots initial output, e.g., messages reporting
trouble with bringing up the fastboot driver.
This commit is contained in:
Norman Feske 2024-11-15 10:11:06 +01:00 committed by Christian Helmuth
parent 9e5e648073
commit 3bb894370a

View File

@ -34,8 +34,27 @@ proc run_load { } {
set device [load_fastboot_device] set device [load_fastboot_device]
set uimg [file join [run_dir] boot uImage] set uimg [file join [run_dir] boot uImage]
# sleep a bit, board might need some time to come up # show boot log up to the life sign of U-boot's fastboot driver
sleep 8 puts stderr "Waiting for U-boot's fastboot driver message"
spawn /bin/sh -c "[log_serial_cmd]"
set timeout 60
set boot_loader_failed false
expect {
-re {.*musb-hdrc.*\n} { }
eof {
puts stderr "Aborting, boot log received EOF"
set boot_loader_failed true
}
timeout {
puts stderr "Loading of boot loader timed out"
set boot_loader_failed true
}
}
close
if {$boot_loader_failed} {
return false }
puts stderr "U-boot fastboot driver is up"
set fastboot_cmd [list fastboot] set fastboot_cmd [list fastboot]
if {$device != ""} { if {$device != ""} {