diff --git a/scripts/ci/plat/cva6/flash-firmware.sh b/scripts/ci/plat/cva6/flash-firmware.sh index e2daaf204..27254a609 100755 --- a/scripts/ci/plat/cva6/flash-firmware.sh +++ b/scripts/ci/plat/cva6/flash-firmware.sh @@ -24,7 +24,7 @@ start_record_tty "$TTYDEV" 115200 "$LOGFILE" cva6-tty # Wait for bootrom break power_on -./scripts/ci/utils/wait_for.py "$LOGFILE" "Hit any key to enter update mode" +wait_for "Hit any key to enter update mode" echo -n 'a' > "$TTYDEV" sleep 1 @@ -34,12 +34,12 @@ printf "0: %.8x" "$FILESIZE" | sed -E 's/0: (..)(..)(..)(..)/0: \4\3\2\1/' | xxd sleep 1 # Send bytes -dd if="$FIRMWARE_FILENAME" of="$TTYDEV" bs=1 status=progress 2>&1 | awk 'NR % 5 == 0' +dd if="$FIRMWARE_FILENAME" of="$TTYDEV" ## Uboot phase (TFTP) # Wait for uboot prompt and send firmware image -./scripts/ci/utils/wait_for.py "$LOGFILE" "Hit any key to stop autoboot" +wait_for "Hit any key to stop autoboot" echo 'a' > "$TTYDEV" rm -f "$TFTP_DIR/fw_payload.bin" @@ -47,8 +47,11 @@ cp "$FIRMWARE_FILENAME" "$TFTP_DIR/fw_payload.bin" echo "setenv serverip $HOST_IP" > "$TTYDEV" ; sleep 1 echo "setenv ipaddr $BOARD_IP" > "$TTYDEV" ; sleep 1 -echo "tftp fw_payload.bin" > "$TTYDEV" ; sleep 1 -echo "mmc write 80200000 800 1800" > "$TTYDEV" ; sleep 1 + +echo "tftp fw_payload.bin" > "$TTYDEV" +wait_for "=>" +echo "mmc write 80200000 800 1800" > "$TTYDEV" +wait_for "=>" stop_record_tty cva6-tty power_off diff --git a/scripts/ci/test-setup.sh b/scripts/ci/test-setup.sh index b8216c3fd..1b45506ce 100755 --- a/scripts/ci/test-setup.sh +++ b/scripts/ci/test-setup.sh @@ -121,6 +121,15 @@ function stop_record_tty { screen -wipe } +function wait_for { + if [[ "$#" -ne 1 ];; then + echo "usage: wait_for [pattern]" + exit 1 + fi + + ./scripts/ci/utils/wait_for.py "$LOGFILE" "$1" +} + ############# ## Cleanup ## #############