view sh/pirelli-init-fc-ffs @ 0:faf27dbe1a63

scripts for initializing aftermarket FFS on Pirelli DP-L10
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 09 Jun 2023 03:27:40 +0000
parents
children
line wrap: on
line source

#!/bin/sh

if [ $# != 1 ]
then
	echo "usage: $0 ttyport" 1>&2
	exit 1
fi

ffsagent=/opt/freecalypso/target-bin/ffsagent-pirelli-am.srec

if [ ! -f $ffsagent ]
then
	echo "Error: $ffsagent is not installed" 1>&2
	exit 1
fi

set -ex

# erase the aftermarket FFS area first
fc-loadtool -h pirelli -Petmoff -t 800 "$1" flash2 erase 0x480000 0x180000

# By running fc-xram *immediately* after our fc-loadtool batch command
# finishes with iota-off exit mode, we avoid giving the official fw
# in flash an extra boot cycle.

fc-xram -h pirelli -t 1300 "$1" $ffsagent rvinterf -b
sleep .5
fc-fsio exec /opt/freecalypso/scripts/pirelli-am-ffsinit
sleep .3
fc-shell poweroff
sleep .1
kill `cat /tmp/rvinterf.pid`