Commit c1a45e0f authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/startup-mb: default fpga type is LX240T

if wrs_version reports "UNKNOWN" use LX240T (actually, the only image
we currently hav ein the filesystem.

Also, verify the files are there to avoid nastier errors.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d1751295
......@@ -11,15 +11,30 @@ done
# Obtain the type of FPGA (LX130XT or LX240XT)
tfpga=$($WR_HOME/bin/wrs_version -F)
if [ "$tfpga" = "UNKNOWN" ]; then
tfpga="LX240T"
fi
FP_FILE="$WR_HOME/lib/firmware/18p_mb-${tfpga}.bin"
# TODO: Update wrsw_version to read this value from DF.
scb_ver=33
if mtdinfo -a | grep -A 1 dataflash | grep 264 &> /dev/null; then
scb_ver=34
fi
LM_FILE="$WR_HOME/lib/firmware/rt_cpu.elf"
if ! [ -f "$FP_FILE" ]; then
echo "Fatal: can't find \"$FP_FILE\"" >& 2
exit 1;
fi
if ! [ -f "$LM_FILE" ]; then
echo "Fatal: can't find \"$LM_FILE\"" >& 2
exit 1;
fi
$WR_HOME/bin/load-virtex $WR_HOME/lib/firmware/18p_mb-${tfpga}.bin
$WR_HOME/bin/load-lm32 $WR_HOME/lib/firmware/rt_cpu.elf scb_ver=${scb_ver}
$WR_HOME/bin/load-virtex $FP_FILE
$WR_HOME/bin/load-lm32 $LM_FILE scb_ver=${scb_ver}
insmod $WR_HOME/lib/modules/at91_softpwm.ko
insmod $WR_HOME/lib/modules/wr_vic.ko
insmod $WR_HOME/lib/modules/wr-nic.ko macaddr=$val
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment