diff --git a/chip-update-firmware.sh b/chip-update-firmware.sh index 8a5d1f8..6ca92b1 100755 --- a/chip-update-firmware.sh +++ b/chip-update-firmware.sh @@ -25,7 +25,7 @@ UBI_PREFIX="chip" UBI_SUFFIX="ubi.sparse" UBI_TYPE="400000-4000-680" -while getopts "sgpbfnhB:N:F:" opt; do +while getopts "sgpbfnrhB:N:F:" opt; do case $opt in s) echo "== Server selected ==" @@ -51,6 +51,10 @@ while getopts "sgpbfnhB:N:F:" opt; do echo "== No Limit mode ==" NO_LIMIT="while itest.b *0x80400000 -ne 03; do i2c mw 0x34 0x30 0x03; i2c read 0x34 0x30 1 0x80400000; done; " ;; + r) + echo "== Reset after flash ==" + RESET_COMMAND="reset" + ;; B) BRANCH="$OPTARG" echo "== ${BRANCH} branch selected ==" @@ -73,6 +77,7 @@ while getopts "sgpbfnhB:N:F:" opt; do echo " -b -- Buildroot" echo " -f -- Force clean" echo " -n -- No limit [enable greater power draw]" + echo " -r -- Reset [reset device after flash]" echo " -B -- Branch(optional) [eg. -B testing]" echo " -N -- Build#(optional) [eg. -N 150]" echo " -F -- Format(optional) [eg. -F Toshiba_4G_MLC]" diff --git a/common.sh b/common.sh index 42f35a8..8e02494 100755 --- a/common.sh +++ b/common.sh @@ -177,7 +177,12 @@ flash_images() { echo "echo going to fastboot mode" >> $ubootcmds echo "fastboot 0" >> $ubootcmds - echo "reset" >> $ubootcmds + + if [ -z $RESET_COMMAND ]; then + RESET_COMMAND="while true; do; sleep 10; done;" + fi + + echo "$RESET_COMMAND" >> $ubootcmds mkimage -A arm -T script -C none -n "flash $FLAVOR" -d $ubootcmds $ubootscr || RC=1 @@ -197,6 +202,7 @@ flash_images() { if wait_for_fastboot; then fastboot -i 0x1f3a -u flash UBI $IMAGESDIR/chip-$nand_erasesize-$nand_writesize-$nand_oobsize.ubi.sparse || RC=1 + fastboot -i 0x1f3a continue > /dev/null else echo "failed to flash the UBI image" RC=1