Commit daa99f80 authored by Federico Vaga's avatar Federico Vaga Committed by Adam Wujek

userspace:startup: make clear why FPGA and LM32 must be programmed in order

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 978907f9
......@@ -57,13 +57,31 @@ else
echo "load_error" > $LOAD_FPGA_STATUS_FILE
fi
# FIXME
# Don't try to do **anything** here. The LM32 **must** be programed
# before doing anything else. We do not know yet the reson but without
# the following step the FPGA cannot be access properly
$WR_HOME/bin/load-lm32 $LM_FILE scb_ver=${scb_ver}
if [ $? -eq 0 ];
then
echo "load_ok" > $LOAD_LM32_STATUS_FILE
else
echo "Fatal: load LM32 failed" >& 2
echo "load_error" > $LOAD_LM32_STATUS_FILE
fi
# FIXME also this sleep is necessary because the LM32 does some magic
sleep 1
# At this offset there is an ID. Just check that it's there as a
# small proof that we correctly programmed the FPGA
CHK_ADDR=0x10030034
CHK_EXP=0xcafebabe
CHK_VAL=$(devmem $CHK_ADDR | tr '[:upper:]' '[:lower:]')
if [ $CHK_VAL != $CHK_EXP ]
if [ $CHK_VAL == $CHK_EXP ]
then
echo "The FPGA and the LM32 are programmed"
else
echo "The bitstream $FP_FILE is not correct or there something is not working with the FPGA"
echo "Expected: [$CHK_ADDR] = $CHK_EXP"
echo "Current: [$CHK_ADDR] = $CHK_VAL"
......@@ -71,14 +89,6 @@ then
exit
fi
$WR_HOME/bin/load-lm32 $LM_FILE scb_ver=${scb_ver}
if [ $? -eq 0 ];
then
echo "load_ok" > $LOAD_LM32_STATUS_FILE
else
echo "Fatal: load LM32 failed" >& 2
echo "load_error" > $LOAD_LM32_STATUS_FILE
fi
insmod $WR_HOME/lib/modules/at91_softpwm.ko
insmod $WR_HOME/lib/modules/wr_vic.ko
......
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