view sh/pirelli-init-fc-ffs @ 13:f232fb350e1c

top Makefile: add bootutil
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 10 Jun 2023 05:00:20 +0000
parents faf27dbe1a63
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`