2024-08-26 17:14:53 +02:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
#set -x
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "Hello from $(hostname)"
|
|
|
|
|
|
|
|
path="$1"
|
|
|
|
|
|
|
|
cd "$path"
|
|
|
|
|
|
|
|
# First kill any picocom instance
|
|
|
|
killall picocom || true
|
|
|
|
|
|
|
|
# Setup the environment
|
|
|
|
. env.sh
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# Then perform the boot
|
2024-09-05 17:24:43 +02:00
|
|
|
#./fpgactl -w bitstream.bit -b opensbi.bin -k kernel.bin -i initrd.bin -r rootfs.img
|
|
|
|
./fpgactl -w bitstream.bit -b opensbi.bin -k kernel.bin -i initrd.bin
|
2024-08-26 17:14:53 +02:00
|
|
|
|
|
|
|
# Restart it again only loading the bootrom and OpenSBI (notice OpenSBI
|
|
|
|
# relocates itself so it will likely be gone by now)
|
2024-08-29 14:41:09 +02:00
|
|
|
sleep 1 && ./fpgactl -b opensbi.bin &
|
2024-08-26 17:14:53 +02:00
|
|
|
|
2024-08-30 18:37:15 +02:00
|
|
|
timeout=$((30 * 60)) # Always stop after 30 min
|
|
|
|
timeout_silent=$((10 * 60)) # Stop if 10 min without output
|
|
|
|
|
2024-08-26 17:14:53 +02:00
|
|
|
# Set dead switch
|
2024-08-30 18:37:15 +02:00
|
|
|
sleep $timeout && killall picocom &
|
2024-08-26 17:14:53 +02:00
|
|
|
|
2024-09-06 08:42:02 +02:00
|
|
|
# Note: --imap igncr is broken so we replace it with LF.
|
|
|
|
# See https://github.com/npat-efault/picocom/pull/114
|
|
|
|
# It looks like picocom is abandoned, we may want to switch to minicom or
|
|
|
|
# stty+cat
|
|
|
|
picocom --imap crlf -q -x $(($timeout_silent*1000)) -b 115200 $FPGACTL_UART
|