# HG changeset patch # User Mychaela Falconia # Date 1686281260 0 # Node ID faf27dbe1a63263419d517c2928a33af5bb23815 scripts for initializing aftermarket FFS on Pirelli DP-L10 diff -r 000000000000 -r faf27dbe1a63 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Fri Jun 09 03:27:40 2023 +0000 @@ -0,0 +1,11 @@ +INSTALL_PREFIX= /opt/freecalypso + +all: + +clean: + +install: + mkdir -p ${INSTALL_PREFIX}/bin + install -c -m 755 sh/* ${INSTALL_PREFIX}/bin + mkdir -p ${INSTALL_PREFIX}/scripts + install -c -m 644 cmd/* ${INSTALL_PREFIX}/scripts diff -r 000000000000 -r faf27dbe1a63 cmd/pirelli-am-ffsinit --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmd/pirelli-am-ffsinit Fri Jun 09 03:27:40 2023 +0000 @@ -0,0 +1,7 @@ +# This fc-fsio command script initializes aftermarket FFS for FreeCalypso fw +# running on Pirelli DP-L10. + +format /fc-ffs +pirelli-magnetite-init +upload-subtree /opt/freecalypso/aud-pirelli /aud +write-charging-config /opt/freecalypso/charging/pirelli/manual diff -r 000000000000 -r faf27dbe1a63 sh/pirelli-init-fc-ffs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sh/pirelli-init-fc-ffs Fri Jun 09 03:27:40 2023 +0000 @@ -0,0 +1,32 @@ +#!/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`