Skip to content
Snippets Groups Projects
Commit 10770d41 authored by Harvey Leicester's avatar Harvey Leicester Committed by Adam Wujek
Browse files

[FEATURE: #333] rootfs/wr/sbin/startup-mb.sh: apply spll settings on load of urv


Signed-off-by: default avatarAdam Wujek <dev_public@wujek.eu>
Signed-off-by: default avatarHarvey Leicester <harvey.macdonald.leicester@cern.ch>
parent 05f939f8
Branches
Tags
No related merge requests found
#!/bin/ash
export WR_HOME="/wr"
dotconfig=/wr/etc/dot-config
insmod $WR_HOME/lib/modules/asix.ko
if [ -e /proc/sys/net/ipv4/conf/eth1 ]; then
......@@ -21,6 +22,28 @@ for arg in $(cat /proc/cmdline); do
fi;
done
if [ -f "$dotconfig" ]; then
. "$dotconfig"
else
echo "$0 unable to source dot-config ($dotconfig)!"
fi
SPLL_SETTINGS=""
if [ -n "$CONFIG_SPLL_MPLL_KP" ]; then
SPLL_SETTINGS="$SPLL_SETTINGS main_pll_kp=$CONFIG_SPLL_MPLL_KP"
fi
if [ -n "$CONFIG_SPLL_MPLL_KI" ]; then
SPLL_SETTINGS="$SPLL_SETTINGS main_pll_ki=$CONFIG_SPLL_MPLL_KI"
fi
if [ -n "$CONFIG_SPLL_HPLL_KP" ]; then
SPLL_SETTINGS="$SPLL_SETTINGS helper_pll_kp=$CONFIG_SPLL_HPLL_KP"
fi
if [ -n "$CONFIG_SPLL_HPLL_KI" ]; then
SPLL_SETTINGS="$SPLL_SETTINGS helper_pll_ki=$CONFIG_SPLL_HPLL_KI"
fi
# handle monit's restat reason
# no need to remove $MONIT_RR_TMP, since tmp is not persistent
if [ -f "$MONIT_RR_FLASH" ]; then
......@@ -73,11 +96,15 @@ else
fi
# FIXME
# Don't try to do **anything** here. The LM32 **must** be programed
# Don't try to do **anything** here. The SoftCPU (uRV) **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-urv $SOFT_CPU_FILE scb_ver=${scb_ver}
# NOTE: please make sure that the variable to be changed is in the correct
# section (e.g. .sdata) of memory!
echo "SPLL_SETTINGS=$SPLL_SETTINGS"
$WR_HOME/bin/load-urv $SOFT_CPU_FILE scb_ver=${scb_ver} $SPLL_SETTINGS
if [ $? -eq 0 ];
then
echo "load_ok" > $LOAD_URV_STATUS_FILE
......
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